제출 #545246

#제출 시각아이디문제언어결과실행 시간메모리
545246amunduzbaev가로등 (APIO19_street_lamps)C++17
20 / 100
5061 ms524288 KiB
#include "bits/stdc++.h" using namespace std; #define ar array signed main(){ ios::sync_with_stdio(0); cin.tie(0); int n, q; cin>>n>>q; vector<string> s(q + 1); cin>>s[0]; for(int i=1;i<=q;i++){ s[i] = s[i-1]; string t; cin>>t; if(t == "query"){ int l, r; cin>>l>>r; --l, --r; int res = 0; for(int j=0;j<i;j++){ bool ok = 1; for(int k=l;k<r;k++){ if(s[j][k] == '0') ok = 0; } res += ok; } cout<<res<<"\n"; } else { int p; cin>>p; p--; s[i][p] = '1' - s[i][p] + '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...