# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
125682 | 2019-07-06T08:25:46 Z | 김세빈(#3068) | 단층 (JOI16_ho_t5) | C++14 | 2000 ms | 8260 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; struct query{ ll x, d, l; query() {} query(ll x, ll d, ll l) : x(x), d(d), l(l) {} }; vector <query> Q; ll n, q; int main() { ll i, j, x, y, d, l; scanf("%lld%lld", &n, &q); for(i=0; i<q; i++){ scanf("%lld%lld%lld", &x, &d, &l); Q.emplace_back(x, d, l + l); } reverse(Q.begin(), Q.end()); for(i=0; i<n; i++){ x = -i - 1; y = i; for(j=0; j<q; j++){ if(Q[j].d == 1){ if(x >= -Q[j].x){ y -= Q[j].l; } } else{ if(y >= Q[j].x){ x -= Q[j].l; } } } printf("%lld\n", (-1 - x - y) >> 1); } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 256 KB | Output is correct |
6 | Correct | 2 ms | 376 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
8 | Correct | 2 ms | 376 KB | Output is correct |
9 | Correct | 2 ms | 396 KB | Output is correct |
10 | Correct | 2 ms | 376 KB | Output is correct |
11 | Correct | 2 ms | 376 KB | Output is correct |
12 | Correct | 2 ms | 376 KB | Output is correct |
13 | Correct | 2 ms | 380 KB | Output is correct |
14 | Correct | 2 ms | 256 KB | Output is correct |
15 | Correct | 2 ms | 376 KB | Output is correct |
16 | Correct | 2 ms | 376 KB | Output is correct |
17 | Correct | 2 ms | 356 KB | Output is correct |
18 | Correct | 2 ms | 376 KB | Output is correct |
19 | Correct | 2 ms | 376 KB | Output is correct |
20 | Correct | 2 ms | 252 KB | Output is correct |
21 | Correct | 2 ms | 376 KB | Output is correct |
22 | Correct | 2 ms | 380 KB | Output is correct |
23 | Correct | 2 ms | 376 KB | Output is correct |
24 | Correct | 2 ms | 424 KB | Output is correct |
25 | Correct | 2 ms | 256 KB | Output is correct |
26 | Correct | 2 ms | 256 KB | Output is correct |
27 | Correct | 2 ms | 256 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 256 KB | Output is correct |
6 | Correct | 2 ms | 376 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
8 | Correct | 2 ms | 376 KB | Output is correct |
9 | Correct | 2 ms | 396 KB | Output is correct |
10 | Correct | 2 ms | 376 KB | Output is correct |
11 | Correct | 2 ms | 376 KB | Output is correct |
12 | Correct | 2 ms | 376 KB | Output is correct |
13 | Correct | 2 ms | 380 KB | Output is correct |
14 | Correct | 2 ms | 256 KB | Output is correct |
15 | Correct | 2 ms | 376 KB | Output is correct |
16 | Correct | 2 ms | 376 KB | Output is correct |
17 | Correct | 2 ms | 356 KB | Output is correct |
18 | Correct | 2 ms | 376 KB | Output is correct |
19 | Correct | 2 ms | 376 KB | Output is correct |
20 | Correct | 2 ms | 252 KB | Output is correct |
21 | Correct | 2 ms | 376 KB | Output is correct |
22 | Correct | 2 ms | 380 KB | Output is correct |
23 | Correct | 2 ms | 376 KB | Output is correct |
24 | Correct | 2 ms | 424 KB | Output is correct |
25 | Correct | 2 ms | 256 KB | Output is correct |
26 | Correct | 2 ms | 256 KB | Output is correct |
27 | Correct | 2 ms | 256 KB | Output is correct |
28 | Correct | 41 ms | 560 KB | Output is correct |
29 | Correct | 50 ms | 504 KB | Output is correct |
30 | Correct | 52 ms | 504 KB | Output is correct |
31 | Correct | 42 ms | 568 KB | Output is correct |
32 | Correct | 52 ms | 504 KB | Output is correct |
33 | Correct | 40 ms | 504 KB | Output is correct |
34 | Correct | 46 ms | 504 KB | Output is correct |
35 | Correct | 50 ms | 504 KB | Output is correct |
36 | Correct | 37 ms | 504 KB | Output is correct |
37 | Correct | 42 ms | 504 KB | Output is correct |
38 | Correct | 45 ms | 504 KB | Output is correct |
39 | Correct | 38 ms | 504 KB | Output is correct |
40 | Correct | 42 ms | 500 KB | Output is correct |
41 | Correct | 46 ms | 632 KB | Output is correct |
42 | Correct | 45 ms | 760 KB | Output is correct |
43 | Correct | 34 ms | 504 KB | Output is correct |
44 | Correct | 40 ms | 632 KB | Output is correct |
45 | Correct | 44 ms | 632 KB | Output is correct |
46 | Correct | 53 ms | 632 KB | Output is correct |
47 | Correct | 54 ms | 652 KB | Output is correct |
48 | Correct | 14 ms | 504 KB | Output is correct |
49 | Correct | 14 ms | 504 KB | Output is correct |
50 | Correct | 14 ms | 504 KB | Output is correct |
51 | Correct | 13 ms | 504 KB | Output is correct |
52 | Correct | 14 ms | 504 KB | Output is correct |
53 | Correct | 14 ms | 504 KB | Output is correct |
54 | Correct | 14 ms | 504 KB | Output is correct |
55 | Correct | 13 ms | 504 KB | Output is correct |
56 | Correct | 14 ms | 504 KB | Output is correct |
57 | Correct | 14 ms | 504 KB | Output is correct |
58 | Correct | 13 ms | 504 KB | Output is correct |
59 | Correct | 13 ms | 504 KB | Output is correct |
60 | Correct | 14 ms | 632 KB | Output is correct |
61 | Correct | 14 ms | 504 KB | Output is correct |
62 | Correct | 32 ms | 500 KB | Output is correct |
63 | Correct | 34 ms | 632 KB | Output is correct |
64 | Correct | 42 ms | 508 KB | Output is correct |
65 | Correct | 42 ms | 504 KB | Output is correct |
66 | Correct | 43 ms | 592 KB | Output is correct |
67 | Correct | 43 ms | 504 KB | Output is correct |
68 | Correct | 44 ms | 504 KB | Output is correct |
69 | Correct | 44 ms | 504 KB | Output is correct |
70 | Correct | 3 ms | 376 KB | Output is correct |
71 | Correct | 3 ms | 376 KB | Output is correct |
72 | Correct | 2 ms | 376 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 256 KB | Output is correct |
6 | Correct | 2 ms | 376 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
8 | Correct | 2 ms | 376 KB | Output is correct |
9 | Correct | 2 ms | 396 KB | Output is correct |
10 | Correct | 2 ms | 376 KB | Output is correct |
11 | Correct | 2 ms | 376 KB | Output is correct |
12 | Correct | 2 ms | 376 KB | Output is correct |
13 | Correct | 2 ms | 380 KB | Output is correct |
14 | Correct | 2 ms | 256 KB | Output is correct |
15 | Correct | 2 ms | 376 KB | Output is correct |
16 | Correct | 2 ms | 376 KB | Output is correct |
17 | Correct | 2 ms | 356 KB | Output is correct |
18 | Correct | 2 ms | 376 KB | Output is correct |
19 | Correct | 2 ms | 376 KB | Output is correct |
20 | Correct | 2 ms | 252 KB | Output is correct |
21 | Correct | 2 ms | 376 KB | Output is correct |
22 | Correct | 2 ms | 380 KB | Output is correct |
23 | Correct | 2 ms | 376 KB | Output is correct |
24 | Correct | 2 ms | 424 KB | Output is correct |
25 | Correct | 2 ms | 256 KB | Output is correct |
26 | Correct | 2 ms | 256 KB | Output is correct |
27 | Correct | 2 ms | 256 KB | Output is correct |
28 | Correct | 41 ms | 560 KB | Output is correct |
29 | Correct | 50 ms | 504 KB | Output is correct |
30 | Correct | 52 ms | 504 KB | Output is correct |
31 | Correct | 42 ms | 568 KB | Output is correct |
32 | Correct | 52 ms | 504 KB | Output is correct |
33 | Correct | 40 ms | 504 KB | Output is correct |
34 | Correct | 46 ms | 504 KB | Output is correct |
35 | Correct | 50 ms | 504 KB | Output is correct |
36 | Correct | 37 ms | 504 KB | Output is correct |
37 | Correct | 42 ms | 504 KB | Output is correct |
38 | Correct | 45 ms | 504 KB | Output is correct |
39 | Correct | 38 ms | 504 KB | Output is correct |
40 | Correct | 42 ms | 500 KB | Output is correct |
41 | Correct | 46 ms | 632 KB | Output is correct |
42 | Correct | 45 ms | 760 KB | Output is correct |
43 | Correct | 34 ms | 504 KB | Output is correct |
44 | Correct | 40 ms | 632 KB | Output is correct |
45 | Correct | 44 ms | 632 KB | Output is correct |
46 | Correct | 53 ms | 632 KB | Output is correct |
47 | Correct | 54 ms | 652 KB | Output is correct |
48 | Correct | 14 ms | 504 KB | Output is correct |
49 | Correct | 14 ms | 504 KB | Output is correct |
50 | Correct | 14 ms | 504 KB | Output is correct |
51 | Correct | 13 ms | 504 KB | Output is correct |
52 | Correct | 14 ms | 504 KB | Output is correct |
53 | Correct | 14 ms | 504 KB | Output is correct |
54 | Correct | 14 ms | 504 KB | Output is correct |
55 | Correct | 13 ms | 504 KB | Output is correct |
56 | Correct | 14 ms | 504 KB | Output is correct |
57 | Correct | 14 ms | 504 KB | Output is correct |
58 | Correct | 13 ms | 504 KB | Output is correct |
59 | Correct | 13 ms | 504 KB | Output is correct |
60 | Correct | 14 ms | 632 KB | Output is correct |
61 | Correct | 14 ms | 504 KB | Output is correct |
62 | Correct | 32 ms | 500 KB | Output is correct |
63 | Correct | 34 ms | 632 KB | Output is correct |
64 | Correct | 42 ms | 508 KB | Output is correct |
65 | Correct | 42 ms | 504 KB | Output is correct |
66 | Correct | 43 ms | 592 KB | Output is correct |
67 | Correct | 43 ms | 504 KB | Output is correct |
68 | Correct | 44 ms | 504 KB | Output is correct |
69 | Correct | 44 ms | 504 KB | Output is correct |
70 | Correct | 3 ms | 376 KB | Output is correct |
71 | Correct | 3 ms | 376 KB | Output is correct |
72 | Correct | 2 ms | 376 KB | Output is correct |
73 | Execution timed out | 2041 ms | 8260 KB | Time limit exceeded |
74 | Halted | 0 ms | 0 KB | - |