Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
void solve()
{
ll n;
cin >> n;
string s;
cin>>s;
ll ans = 0, c = 0;
for(int i = 0; i < n; i++){
if(s[i] == '1')c++;
else{
ans = max(ans, c);
c = 0;
}
}
cout<<ans<<endl;
}
int main()
{
int tc = 1, cs = 1;
cin >> tc;
while (tc--)
{
// cout<<"Case "<<cs<<": ";
solve();
}
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:46
- Judged At
- 2024-11-05 14:41:46
- Judged By
- Score
- 5
- Total Time
- 17ms
- Peak Memory
- 588.0 KiB