Accepted
Code
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
ll tc;
cin>>tc;
while(tc--)
{
ll n;
cin>>n;
string s;
cin>>s;
ll c=0,mx=0;
for(int i=0;i<s.size();i++)
{
if(s[i]=='0')
{
c++;
mx=max(mx,c);
}
else
c=0;
}
cout<<mx<<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:48:40
- Judged At
- 2024-11-11 02:32:28
- Judged By
- Score
- 100
- Total Time
- 26ms
- Peak Memory
- 744.0 KiB