# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
382581 | 2021-03-27T19:23:03 Z | rainboy | 가로등 (APIO19_street_lamps) | C | 1 ms | 364 KB |
#include <stdio.h> #define N 300000 #define Q 300000 #define S 100 int main() { static char cc[N + 1]; static int ll[S][S]; int n, q, h, h_, i; scanf("%d%d%s", &n, &q, cc); if (n <= 100 && q <= 100) { for (h = 0; h < q; h++) { static char s[8]; scanf("%s", s); for (i = 0; i < n; i++) ll[h][i] = cc[i] == '0' ? i + 1 : (i == 0 ? 0 : ll[h][i - 1]); if (s[0] == 't') { scanf("%d", &i), i--; cc[i] = (cc[i] - '0' ^ 1) + '0'; } else { int l, r, cnt; scanf("%d%d", &l, &r), l--, r -= 2; cnt = 0; for (h_ = 0; h_ <= h; h_++) if (ll[h_][r] <= l) cnt++; printf("%d\n", cnt); } } } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Correct | 1 ms | 364 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Correct | 1 ms | 364 KB | Output is correct |
5 | Correct | 1 ms | 364 KB | Output is correct |
6 | Correct | 1 ms | 364 KB | Output is correct |
7 | Correct | 1 ms | 364 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 364 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
2 | Correct | 1 ms | 364 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Correct | 1 ms | 364 KB | Output is correct |
5 | Correct | 1 ms | 364 KB | Output is correct |
6 | Correct | 1 ms | 364 KB | Output is correct |
7 | Correct | 1 ms | 364 KB | Output is correct |
8 | Incorrect | 1 ms | 364 KB | Output isn't correct |
9 | Halted | 0 ms | 0 KB | - |