| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 161759 | Minnakhmetov | Street Lamps (APIO19_street_lamps) | C++14 | 5077 ms | 12256 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
#define all(aaa) aaa.begin(), aaa.end()
using namespace std;
struct Q {
int type, x, y;
};
string s;
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(NULL);
int n, q;
cin >> n >> q >> s;
vector<Q> qr;
for (int i = 0; i < q; i++) {
string t;
cin >> t;
if (t[0] == 'q') {
int x, y;
cin >> x >> y;
x--;
y -= 2;
qr.push_back({0, x, y});
}
else {
int x;
cin >> x;
x--;
qr.push_back({1, x});
}
}
for (int i = 0; i < qr.size(); i++) {
if (qr[i].type == 0) {
string tmp = s;
int ans = 0;
for (int j = 0; j <= i; j++) {
ans++;
for (int k = qr[i].x; k <= qr[i].y; k++) {
if (tmp[k] == '0') {
ans--;
break;
}
}
if (qr[j].type) {
tmp[qr[j].x] = '0' + (tmp[qr[j].x] == '0');
}
}
cout << ans << "\n";
}
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
