#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int N,Q;
string s;
cin>>N>>Q>>s;
vector<string> S={};
for(int i=0;i<Q;i++){
S.push_back(s);
string q;
cin>>q;
if(q[0] != 'q'){
int a;
cin>>a;
s[a-1] = '1'-s[a-1]+'0';
continue;
}
int l,r;
cin>>l>>r;
l--;
int ans = 0;
for(string ss:S){
bool ok = true;
for(int j=l;j<r;j++)if(ss[j] == '0') ok = false;
ans += ok;
}
cout<<ans<<endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
5012 ms |
4552 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
1236 KB |
Output is correct |
2 |
Correct |
37 ms |
1268 KB |
Output is correct |
3 |
Correct |
76 ms |
1224 KB |
Output is correct |
4 |
Correct |
116 ms |
1436 KB |
Output is correct |
5 |
Runtime error |
1200 ms |
524288 KB |
Execution killed with signal 9 |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
122 ms |
1280 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |