File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ #include < bits/stdc++.h>
2+
3+ using namespace std ;
4+
5+ string s;
6+
7+ int main () {
8+ cin >> s;
9+ s += s;
10+
11+ int res = 0 ;
12+ for (int i = 0 ; i < s.length (); ++i) {
13+ int cur = 1 ;
14+ while (i + 1 < s.length () && s[i] != s[i + 1 ] && cur < s.length () / 2 )
15+ ++cur, ++i;
16+ res = max (res, cur);
17+ }
18+
19+ printf (" %d\n " , res);
20+
21+ return 0 ;
22+ }
Original file line number Diff line number Diff line change 556556- [ 1023D. Array Restoration] ( http://codeforces.com/contest/1023/problem/D )
557557- [ 1025A. Doggo Recoloring] ( http://codeforces.com/contest/1025/problem/A )
558558- [ 1025B. Weakened Common Divisor] ( http://codeforces.com/contest/1025/problem/B )
559+ - [ 1025C. Plasticine zebra] ( http://codeforces.com/contest/1025/problem/C )
559560- [ 1027A. Palindromic Twist] ( http://codeforces.com/contest/1027/problem/A )
560561- [ 1027B. Numbers on the Chessboard] ( http://codeforces.com/contest/1027/problem/B )
561562- [ 1027C. Minimum Value Rectangle] ( http://codeforces.com/contest/1027/problem/C )
You can’t perform that action at this time.
0 commit comments