# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
716528 | 1zaid1 | 가로등 (APIO19_street_lamps) | C++17 | 109 ms | 3956 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
const signed M = 1e4, MOD = 998244353;
bitset<101> bt[M];
signed main() {
cin.tie(0)->sync_with_stdio(0);
int n, q;
cin >> n >> q;
string s;
cin >> s;
for (int i = 0; i < s.size(); i++) bt[i+1][0] = s[i] == '1';
for (int i = 0; i < q; i++) {
string s;
cin >> s;
if (s == "query") {
int l, r;
cin >> l >> r;
bitset<101> b = bt[l];
for (int j = l; j < r; j++) b &= bt[j];
cout << b.count() << endl;
// cout << b << endl;
}
for (int j = 1; j <= n; j++) bt[j][i+1] = bt[j][i];
if (s == "toggle") {
int x;
cin >> x;
bt[x][i+1] = !bt[x][i+1];
}
}
// for (int i = 1; i <= n; i++){
// for (int j = 0; j < q; j++) cout << bt[i][j]; cout << endl;
// }
return 0;
}
/*
5 7
11011
query 1 2
query 1 2
query 1 6
query 3 4
toggle 3
query 3 4
query 1 6
*/
컴파일 시 표준 에러 (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... |