/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 516.0 KiB
#2 Wrong Answer 4ms 540.0 KiB
#3 Wrong Answer 2ms 540.0 KiB

Code

#include <stdio.h>
#include <string.h>
int main() {
    int a,b,roy=0,emon=0;
    scanf("%d",&a);

    while (a--) {
        
        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
Submission
Problem
P1113 Fliping Game
Contest
Brain Booster #7
Language
C99 (GCC 13.2.0)
Submit At
2024-11-05 16:02:12
Judged At
2024-11-05 16:02:12
Judged By
Score
5
Total Time
4ms
Peak Memory
540.0 KiB