| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1367254 | po_rag526 | 가로등 (APIO19_street_lamps) | C++20 | 1 ms | 580 KiB |
#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int n, q;
string s[N];
int main() {
cin.tie(nullptr)->ios_base::sync_with_stdio(false);
cin >> n >> q >> s[1];
for (int i = 2; i <= q + 1; i++) {
s[i] = s[i-1];
string type;
cin >> type;
if (type == "toggle") {
int pos;
cin >> pos; pos--;
s[i][pos] = '1' + '0' - s[i][pos];
}
else {
int a, b;
cin >> a >> b; a--, b -= 2;
int total = 0;
for (int j = 1; j < i; j++) {
bool ok = true;
for (int k = a; k <= b; k++) {
if (s[j][k] == '0') ok = false;
}
total += ok;
}
cout << total << "\n";
}
}
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
