Code
#include <stdio.h>
#include <string.h>
int main() {
int a,b;
scanf("%d",&a);
while (a--) {
int emon=0,roy=0;
char x[50000];
scanf("%d",&b);
scanf("%s",&x);
for (int i=0;i<b;i++) {
if (x[i]=='1') {
emon++;
}
else {
if (emon>roy) {
roy=emon;
}
emon=0;
}
}
if (emon>roy) {
roy=emon;
}
printf("%d\n",roy);
}
return 0;
}
Information
- Submit By
- Type
- Pretest
- Problem
- P1113 Fliping Game
- Language
- C99 (GCC 13.2.0)
- Submit At
- 2024-11-05 16:04:00
- Judged At
- 2024-11-11 02:28:39
- Judged By
- Score
- 10
- Total Time
- 0ms
- Peak Memory
- 284.0 KiB