Submission #1004984

#TimeUsernameProblemLanguageResultExecution timeMemory
1004984vjudge1Street Lamps (APIO19_street_lamps)C++17
20 / 100
5064 ms524288 KiB
#include <bits/stdc++.h> using namespace std; const int N = 3e5 + 10; int n, q; string s; int main(){ cin >> n >> q >> s; vector<string> vec; vec.push_back(s); for (int i = 0; i < q; i ++){ string qx; cin >> qx; if (qx[0] == 't'){ int x; cin >> x; x--; s[x] = '1' - s[x] + '0'; } else{ int a, b; cin >> a >> b; a--, b--; int ans = 0; for (string x : vec){ bool good = 1; for (int i = a; i < b; i ++) if (x[i] == '0') good = 0; ans += good; } cout << ans << endl; } vec.push_back(s); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...