摘要: 一般方法:#include #include #include using namespace std;//形如abaint oneCenter(string const& str, int index){ int len = 1 , i = 1; while((index-i)>=0 && (index+i)= 0 && (index+1+i > str; cout<<"Max longest string lenght is " <<solve(str) <<endl;} 阅读全文
posted @ 2014-03-13 23:10 OpenSoucre 阅读(189) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;int main(){ int n; cin >> n; string str; cin >> str; long long cnt = 0, x = 1; for(int i = 0 ; i < n ; ++ i){ if(str[i] == 'B') cnt+=(x << i); } cout<<cnt<<endl;}Codeforces Round #233 (Div. 2) 阅读全文
posted @ 2014-03-13 21:12 OpenSoucre 阅读(157) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;int main(){ int n,p,k; cin >> n >> p >> k; bool hasLeft = true, hasRight = true; int first = p-k,last = p + k; if( p - k = n) last = n,hasRight = false; if(hasLeft) cout>"<<endl;} 阅读全文
posted @ 2014-03-13 20:53 OpenSoucre 阅读(144) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std;int main(){ int n,m; cin >> n >> m; if(n > (m + 1) || m > (n + 1)*2 ) cout= m) { for(int i = 0; i =m){ for(int i = 0; i< m - n; ++ i) cout<<"110"; for(int i =m-n; i < n; ++ i ) cout<< "10"; }else{ for(int i 阅读全文
posted @ 2014-03-13 19:56 OpenSoucre 阅读(152) 评论(0) 推荐(0) 编辑