Submission #1031956

#TimeUsernameProblemLanguageResultExecution timeMemory
1031956Halym2007Street Lamps (APIO19_street_lamps)C++17
20 / 100
5065 ms524288 KiB
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define pb push_back #define sz size() #define ll long long #define pii pair <int, int> const int N = 1e4 + 5; vector <string> v; int main () { ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); // freopen ("input.txt", "r", stdin); int n, q; string s; cin >> n >> q >> s; while ( q-- ) { string s1; cin >> s1; if (s1 == "query") { int l, r; v.pb (s); cin >> l >> r; int jog = 0; // if (q == 0) { // cout << l - 1 << " " << r - 2 << " " << s << "\n"; // // for (string i : v) { // cout << "biz->" << i << "\n"; // } // return 0; // } for (int i = 0; i < (int)v.sz; ++i) { int tr = 0; for (int j = l - 1; j < r - 1; ++j) { if (v[i][j] == '0') tr = 1; // if (!q) cout << v[i][j]; } if (!tr) { jog++; // if (!q) cout << "gecdi->" << i << "\n"; } // if (!q)cout << "\n"; } // if (!q)return 0; cout << jog << "\n"; } else { int l; cin >> l; v.pb (s); if (s[l - 1] == '0') s[l - 1] = '1'; else s[l - 1] = '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...