| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1367047 | Nxmkxing | 가로등 (APIO19_street_lamps) | C++20 | 1 ms | 344 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[0];
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";
}
}
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
