/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 21ms 576.0 KiB
#3 Accepted 4ms 532.0 KiB
#4 Accepted 2ms 360.0 KiB
#5 Accepted 2ms 424.0 KiB
#6 Accepted 2ms 696.0 KiB
#7 Accepted 2ms 856.0 KiB
#8 Accepted 2ms 744.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-11 02:31:56
Judged By
Score
100
Total Time
21ms
Peak Memory
856.0 KiB