Submission #869501

#TimeUsernameProblemLanguageResultExecution timeMemory
869501tch1cherinStreet Lamps (APIO19_street_lamps)C++17
20 / 100
5025 ms524288 KiB
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(nullptr)->sync_with_stdio(false); int N, Q; string S; cin >> N >> Q >> S; vector<string> states = {S}; while (Q--) { string T; cin >> T; if (T == "toggle") { int P; cin >> P; P--; S[P] ^= 1; } else { int L, R; cin >> L >> R; L--, R--; int ans = 0; for (auto value : states) { ans += value.substr(L, R - L) == string(R - L, '1'); } cout << ans << "\n"; } states.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...