제출 #855822

#제출 시각아이디문제언어결과실행 시간메모리
855822NeroZein가로등 (APIO19_street_lamps)C++17
20 / 100
5068 ms30012 KiB
#include "bits/stdc++.h" using namespace std; #ifdef Nero #include "Deb.h" #else #define deb(...) #endif int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n, q; cin >> n >> q; string s; cin >> s; vector<map<int, int>> mp(n); while (q--) { string qs; cin >> qs; for (int i = 0; i < n; ++i) { for (int j = i; j < n; ++j) { if (s[j] == '0') break; mp[i][j + 1]++; } } if (qs == "query") { int l, r; cin >> l >> r; --l, --r; cout << mp[l][r] << '\n'; } else { int i; cin >> i; s[i - 1] ^= 1; } } return 0; }
#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...