/ SeriousOJ /

Record Detail

Wrong Answer


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

Code

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define max 250000

int main() {
    int a;
    scanf("%d", &a);

    while (a--) {
        int b;
        scanf("%d", &b);

        char x[max];
        scanf("%s",x);

        int roy= 0,emon=0, i;
        for (i = 0; i < b; i++) {
            if (x[i] == '1') {
                emon++;
                if (emon>roy) {
                    roy=emon;
                }
            } 
            else {
                emon=0;
            }
        }

        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:23:31
Judged At
2024-11-05 16:23:31
Judged By
Score
5
Total Time
4ms
Peak Memory
532.0 KiB