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;
        }
    }
    ans = max(ans, c);
    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 B. Fliping Game
- Contest
- Brain Booster #7
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2024-11-05 14:42:24
- Judged At
- 2024-11-11 02:32:45
- Judged By
- Score
- 5
- Total Time
- 26ms
- Peak Memory
- 548.0 KiB