/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 336.0 KiB
#2 Wrong Answer 25ms 552.0 KiB
#3 Wrong Answer 8ms 376.0 KiB

Code

#include <iostream>
#include <algorithm>
using namespace std;

int max1s(string &s) {
    int m = 0, c = 0;
    for (char x : s) {
        if (x == '1') {
            c++;
            m = max(m, c);
        } else {
            c = 0;
        }
    }
    return m;
}

int main() {
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        string s;
        cin >> s;
        cout << max1s(s) << endl;
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1113 Fliping Game
Contest
Brain Booster #7
Language
C++17 (G++ 13.2.0)
Submit At
2024-11-05 14:39:17
Judged At
2024-11-11 02:32:55
Judged By
Score
5
Total Time
25ms
Peak Memory
552.0 KiB