cses

cses solutions in pure c
git clone git://git.superpozycja.net/cses
log | files | refs

s.c (358B)


      1 #include <stdio.h>
      2 #include <stdlib.h>
      3 
      4 void solve()
      5 {
      6 	int c;
      7 	int prev = '0';
      8 	unsigned long long res = 1;
      9 	unsigned long long running = 1;
     10 	while ((c = getchar()) != EOF) {
     11 		running = c == prev ? running + 1 : 1;
     12 		res = running > res ? running : res;
     13 		prev = c;
     14 	}
     15 	printf("%llu\n", res);
     16 	return;
     17 }
     18 
     19 int main()
     20 {
     21 	int t = 1;
     22 	while (t--)
     23 		solve();
     24 }