Submission #970882

#TimeUsernameProblemLanguageResultExecution timeMemory
970882mannshah1211Street Lamps (APIO19_street_lamps)C++17
0 / 100
53 ms3820 KiB
/** * author: hashman * created: **/ #include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "algo/debug.h" #else #define debug(...) 42 #endif int main() { ios::sync_with_stdio(false); cin.tie(0); int n, q; cin >> n >> q; string s; cin >> s; vector<int> num(n); for (int i = 0; i < n; i++) { num[i] += s[i] - '0'; } for (int i = 0; i < q; i++) { string op; cin >> op; if (op == "query") { int a, b; cin >> a >> b; cout << num[--a] << '\n'; } else { int lamp; cin >> lamp; lamp--; s[lamp] = '1' + '0' - s[lamp]; } } } // Cute is justice!
#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...