Wrong Answer
Code
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define bug(a) cout << #a << " : " << a << endl;
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t = 1; cin >> t;
while (t--) {
int n; cin >> n;
string s;cin>>s;
int cur=0;
int ans=0;
for(int i=0;i<n;i++){
if(s[i]=='1')cur++;
else cur=0;
ans=max(ans,cur);
}
cout<<ans<<endl;
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1113 Fliping Game
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2024-12-06 13:14:35
- Judged At
- 2024-12-06 13:14:35
- Judged By
- Score
- 5
- Total Time
- 11ms
- Peak Memory
- 552.0 KiB