/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 27ms 532.0 KiB
#3 Accepted 6ms 532.0 KiB
#4 Accepted 4ms 316.0 KiB
#5 Accepted 5ms 532.0 KiB
#6 Accepted 7ms 744.0 KiB
#7 Accepted 8ms 788.0 KiB
#8 Accepted 8ms 696.0 KiB

Code

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

#define ll long long

int main() 
{
    ll tc; cin>>tc;
    while(tc--){
      ll n; cin>>n;
      string s; cin>>s;
      
      ll mx = 0, cnt=0;
      for(char ch : s){
        if(ch == '0'){
          cnt++;
          mx = max(mx, cnt);
        }
        else cnt=0;
      }
      cout << mx << endl;
    }
    
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1113 Fliping Game
Language
C++17 (G++ 13.2.0)
Submit At
2024-11-06 15:01:18
Judged At
2024-11-06 15:01:18
Judged By
Score
100
Total Time
27ms
Peak Memory
788.0 KiB