Compile Error
foo.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
Code
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int x(string &m, int n) {
int o = m.length();
int p = 0, q = 0, r = 0,s = 0;
while (q < o) {
if (m[q] == '0') {
s++;
}
while (s > n) {
if (m[p] == '0') {
s--;
}
p++;
}
r = max(r, q - p + 1);
q++;
}
return r;
}
int main() {
int s;
cin >> s;
while (s--) {
int t, u;
string v;
cin >> t >> u;
cin >> v;
int w = x(v, u);
cout << w << endl;
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1162 Roy and Maximum Partition
- Contest
- Brain Booster #8
- Language
- C99 (GCC 13.2.0)
- Submit At
- 2025-02-17 15:39:08
- Judged At
- 2025-02-17 15:39:08
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes