【BZOJ1432】[ZJOI2009]Function(找规律)题面BZOJ洛谷题解这。。。找找规律吧。#include<iostream> using namespace std; int n,k; int main() { cin>>n>>k;k=min(k,n-k+1); cout<<(n==1?1:k<<1)<<endl; return 0; }