/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Accepted 4ms 580.0 KiB
#3 Accepted 2ms 532.0 KiB
#4 Accepted 2ms 500.0 KiB
#5 Accepted 2ms 608.0 KiB
#6 Accepted 2ms 692.0 KiB
#7 Accepted 2ms 788.0 KiB
#8 Accepted 2ms 748.0 KiB

Code

/**
 *  @author:   Binoy Barman
 *  @created:  2024-11-05 20:38:15
**/

#include<bits/stdc++.h>
using namespace std;
#define nl '\n'
#define all(v) v.begin(), v.end()
#define Too_Many_Jobs int tts, tc = 1; cin >> tts; hell: while(tts--)
#define Dark_Lord_Binoy ios_base::sync_with_stdio(false); cin.tie(NULL);

#ifdef LOCAL
#include "debug/whereisit.hpp"
#else
#define dbg(...) 42
#endif
#define int long long

int32_t main() {
Dark_Lord_Binoy
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    Too_Many_Jobs {
        int n;
        cin >> n;
        string s;
        cin >> s;
        int ans = 0, cur = s[0] == '0';
        for (int i = 1; i < n; i++) {
            if(s[i] == '0') cur++;
            else {
                ans = max(cur, ans);
                cur = 0;
            }
        }
        ans = max(cur, ans);
        cout << ans << nl;
    }
    
    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:41:40
Judged At
2024-11-11 02:32:46
Judged By
Score
100
Total Time
4ms
Peak Memory
788.0 KiB