/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Wrong Answer 24ms 536.0 KiB
#3 Wrong Answer 6ms 532.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-05 14:39:17
Judged By
Score
5
Total Time
24ms
Peak Memory
536.0 KiB