/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 348.0 KiB
#2 Accepted 25ms 544.0 KiB
#3 Accepted 8ms 540.0 KiB
#4 Accepted 5ms 544.0 KiB
#5 Accepted 9ms 596.0 KiB
#6 Accepted 9ms 604.0 KiB
#7 Accepted 9ms 840.0 KiB
#8 Accepted 9ms 748.0 KiB

Code

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

int main() {
  int t;
  cin >> t;
  while (t--){
    ll n, c = 0, ans = 0;
    string s;
    cin >> n >> s;
    s += '?';
    for (int i = 0; i <= n; i++){
        if (s[i] == '0') c++;
        else ans = max(ans, c), c = 0;
    }
    cout << ans << endl;
  }
}

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:44:55
Judged At
2024-11-11 02:32:39
Judged By
Score
100
Total Time
25ms
Peak Memory
840.0 KiB