Wrong Answer
Code
#include <iostream>
#include <algorithm>
using namespace std;
int max1s(string &s) {
int m = 0, c = 0;
for (char x : s) {
if (x == '1') {
c++;
m = max(m, c);
} else {
c = 0;
}
}
return m;
}
int main() {
int t;
cin >> t;
while (t--) {
int n;
cin >> n;
string s;
cin >> s;
cout << max1s(s) << endl;
}
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:39:17
- Judged At
- 2024-11-11 02:32:55
- Judged By
- Score
- 5
- Total Time
- 25ms
- Peak Memory
- 552.0 KiB