/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 11ms 588.0 KiB
#3 Accepted 3ms 540.0 KiB
#4 Accepted 2ms 540.0 KiB
#5 Accepted 2ms 540.0 KiB
#6 Accepted 2ms 704.0 KiB
#7 Accepted 2ms 884.0 KiB
#8 Accepted 2ms 704.0 KiB

Code

#include <bits/stdc++.h>
#define pb push_back
#define int long long
using namespace std;

const int mod = 998244353;
const int inf = 1e17;
const int N = 1e5+5;

int32_t main(){
    cin.tie(0); cout.tie(0);
    ios_base::sync_with_stdio(false);
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        string s;
        cin>>s;
        int ans = 0, cnt = 0;
        for(int i = 0; i < n; i++){
            if(s[i] == '0'){
                cnt++;
                ans = max(ans, cnt);
            }
            else{
                cnt = 0;
            }
        }

        cout<<ans<<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:58:18
Judged At
2024-11-05 14:58:18
Judged By
Score
100
Total Time
11ms
Peak Memory
884.0 KiB