# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
20406 | 2017-02-11T05:07:41 Z | Evnormal(#39, kriii) | Can polan into space? (OJUZ11_space) | C++14 | 133 ms | 8936 KB |
#include <stdio.h> int N; long long A[200200],B[200200],C[200200]; long long D[200200]; int vi[200200],vj[200200]; long long p; int pi; long long q; int qi,qj; int main() { scanf ("%d",&N); for (int i=1;i<=N;i++) scanf ("%lld %lld %lld",&A[i],&B[i],&C[i]); C[1] = B[1]; B[1] = A[1]; A[1] = 0; C[N] = B[N]; B[N] = A[N]; A[N] = 0; p = B[1]; pi = 0; q = C[1]; qi = 0; qj = 1; D[1] = -1e16; for (int i=2;i<=N+1;i++){ D[i] = q + A[i]; vi[i] = qi; vj[i] = qj; q += B[i]; if (q < p + C[i]){ q = p + C[i]; qi = pi; qj = i; } if (q < D[i-1] + C[i]){ q = D[i-1] + C[i]; qi = i - 1; qj = i; } p += B[i]; if (p < D[i-1] + B[i]){ p = D[i-1] + B[i]; pi = i-1; } } printf ("%lld\n",D[N+1]); int x = N+1; while (x){ int i = vi[x], j = vj[x]; if (x <= N) printf ("%d ",x); for (int k=x-1;k>j;k--) printf ("%d ",k); for (int k=i+1;k<j;k++) printf ("%d ",k); printf ("%d ",j); x = i; } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 8936 KB | Output is correct |
2 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
3 | Correct | 0 ms | 8936 KB | Output is correct |
4 | Correct | 0 ms | 8936 KB | Output is correct |
5 | Correct | 0 ms | 8936 KB | Output is correct |
6 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
7 | Correct | 0 ms | 8936 KB | Output is correct |
8 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
9 | Correct | 0 ms | 8936 KB | Output is correct |
10 | Correct | 0 ms | 8936 KB | Output is correct |
11 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
12 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
13 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
14 | Correct | 0 ms | 8936 KB | Output is correct |
15 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
16 | Correct | 0 ms | 8936 KB | Output is correct |
17 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
18 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
19 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
20 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
21 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 8936 KB | Output is correct |
2 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
3 | Correct | 0 ms | 8936 KB | Output is correct |
4 | Correct | 0 ms | 8936 KB | Output is correct |
5 | Correct | 0 ms | 8936 KB | Output is correct |
6 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
7 | Correct | 0 ms | 8936 KB | Output is correct |
8 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
9 | Correct | 0 ms | 8936 KB | Output is correct |
10 | Correct | 0 ms | 8936 KB | Output is correct |
11 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
12 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
13 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
14 | Correct | 0 ms | 8936 KB | Output is correct |
15 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
16 | Correct | 0 ms | 8936 KB | Output is correct |
17 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
18 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
19 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
20 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
21 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
22 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
23 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
24 | Correct | 0 ms | 8936 KB | Output is correct |
25 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
26 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
27 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
28 | Correct | 0 ms | 8936 KB | Output is correct |
29 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
30 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
31 | Correct | 0 ms | 8936 KB | Output is correct |
32 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
33 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
34 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
35 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
36 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
37 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 8936 KB | Output is correct |
2 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
3 | Correct | 0 ms | 8936 KB | Output is correct |
4 | Correct | 0 ms | 8936 KB | Output is correct |
5 | Correct | 0 ms | 8936 KB | Output is correct |
6 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
7 | Correct | 0 ms | 8936 KB | Output is correct |
8 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
9 | Correct | 0 ms | 8936 KB | Output is correct |
10 | Correct | 0 ms | 8936 KB | Output is correct |
11 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
12 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
13 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
14 | Correct | 0 ms | 8936 KB | Output is correct |
15 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
16 | Correct | 0 ms | 8936 KB | Output is correct |
17 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
18 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
19 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
20 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
21 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
22 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
23 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
24 | Correct | 0 ms | 8936 KB | Output is correct |
25 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
26 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
27 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
28 | Correct | 0 ms | 8936 KB | Output is correct |
29 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
30 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
31 | Correct | 0 ms | 8936 KB | Output is correct |
32 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
33 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
34 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
35 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
36 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
37 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
38 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
39 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
40 | Correct | 0 ms | 8936 KB | Output is correct |
41 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
42 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
43 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
44 | Correct | 0 ms | 8936 KB | Output is correct |
45 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
46 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
47 | Correct | 0 ms | 8936 KB | Output is correct |
48 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
49 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
50 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
51 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
52 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
53 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 8936 KB | Output is correct |
2 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
3 | Correct | 0 ms | 8936 KB | Output is correct |
4 | Correct | 0 ms | 8936 KB | Output is correct |
5 | Correct | 0 ms | 8936 KB | Output is correct |
6 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
7 | Correct | 0 ms | 8936 KB | Output is correct |
8 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
9 | Correct | 0 ms | 8936 KB | Output is correct |
10 | Correct | 0 ms | 8936 KB | Output is correct |
11 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
12 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
13 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
14 | Correct | 0 ms | 8936 KB | Output is correct |
15 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
16 | Correct | 0 ms | 8936 KB | Output is correct |
17 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
18 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
19 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
20 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
21 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
22 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
23 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
24 | Correct | 0 ms | 8936 KB | Output is correct |
25 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
26 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
27 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
28 | Correct | 0 ms | 8936 KB | Output is correct |
29 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
30 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
31 | Correct | 0 ms | 8936 KB | Output is correct |
32 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
33 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
34 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
35 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
36 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
37 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
38 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
39 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
40 | Correct | 0 ms | 8936 KB | Output is correct |
41 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
42 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
43 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
44 | Correct | 0 ms | 8936 KB | Output is correct |
45 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
46 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
47 | Correct | 0 ms | 8936 KB | Output is correct |
48 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
49 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
50 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
51 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
52 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
53 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
54 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
55 | Incorrect | 6 ms | 8936 KB | Output isn't correct |
56 | Correct | 6 ms | 8936 KB | Output is correct |
57 | Incorrect | 6 ms | 8936 KB | Output isn't correct |
58 | Incorrect | 6 ms | 8936 KB | Output isn't correct |
59 | Incorrect | 6 ms | 8936 KB | Output isn't correct |
60 | Incorrect | 6 ms | 8936 KB | Output isn't correct |
61 | Correct | 0 ms | 8936 KB | Output is correct |
62 | Incorrect | 3 ms | 8936 KB | Output isn't correct |
63 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
64 | Incorrect | 3 ms | 8936 KB | Output isn't correct |
65 | Correct | 6 ms | 8936 KB | Output is correct |
66 | Incorrect | 3 ms | 8936 KB | Output isn't correct |
67 | Incorrect | 3 ms | 8936 KB | Output isn't correct |
68 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
69 | Incorrect | 9 ms | 8936 KB | Output isn't correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 8936 KB | Output is correct |
2 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
3 | Correct | 0 ms | 8936 KB | Output is correct |
4 | Correct | 0 ms | 8936 KB | Output is correct |
5 | Correct | 0 ms | 8936 KB | Output is correct |
6 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
7 | Correct | 0 ms | 8936 KB | Output is correct |
8 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
9 | Correct | 0 ms | 8936 KB | Output is correct |
10 | Correct | 0 ms | 8936 KB | Output is correct |
11 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
12 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
13 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
14 | Correct | 0 ms | 8936 KB | Output is correct |
15 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
16 | Correct | 0 ms | 8936 KB | Output is correct |
17 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
18 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
19 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
20 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
21 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
22 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
23 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
24 | Correct | 0 ms | 8936 KB | Output is correct |
25 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
26 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
27 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
28 | Correct | 0 ms | 8936 KB | Output is correct |
29 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
30 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
31 | Correct | 0 ms | 8936 KB | Output is correct |
32 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
33 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
34 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
35 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
36 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
37 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
38 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
39 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
40 | Correct | 0 ms | 8936 KB | Output is correct |
41 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
42 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
43 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
44 | Correct | 0 ms | 8936 KB | Output is correct |
45 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
46 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
47 | Correct | 0 ms | 8936 KB | Output is correct |
48 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
49 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
50 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
51 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
52 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
53 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
54 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
55 | Incorrect | 6 ms | 8936 KB | Output isn't correct |
56 | Correct | 6 ms | 8936 KB | Output is correct |
57 | Incorrect | 6 ms | 8936 KB | Output isn't correct |
58 | Incorrect | 6 ms | 8936 KB | Output isn't correct |
59 | Incorrect | 6 ms | 8936 KB | Output isn't correct |
60 | Incorrect | 6 ms | 8936 KB | Output isn't correct |
61 | Correct | 0 ms | 8936 KB | Output is correct |
62 | Incorrect | 3 ms | 8936 KB | Output isn't correct |
63 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
64 | Incorrect | 3 ms | 8936 KB | Output isn't correct |
65 | Correct | 6 ms | 8936 KB | Output is correct |
66 | Incorrect | 3 ms | 8936 KB | Output isn't correct |
67 | Incorrect | 3 ms | 8936 KB | Output isn't correct |
68 | Incorrect | 0 ms | 8936 KB | Output isn't correct |
69 | Incorrect | 9 ms | 8936 KB | Output isn't correct |
70 | Incorrect | 6 ms | 8936 KB | Output isn't correct |
71 | Incorrect | 133 ms | 8936 KB | Output isn't correct |
72 | Correct | 96 ms | 8936 KB | Output is correct |
73 | Incorrect | 119 ms | 8936 KB | Output isn't correct |
74 | Correct | 86 ms | 8936 KB | Output is correct |
75 | Incorrect | 106 ms | 8936 KB | Output isn't correct |
76 | Incorrect | 113 ms | 8936 KB | Output isn't correct |
77 | Incorrect | 43 ms | 8936 KB | Output isn't correct |
78 | Incorrect | 113 ms | 8936 KB | Output isn't correct |
79 | Incorrect | 126 ms | 8936 KB | Output isn't correct |
80 | Correct | 109 ms | 8936 KB | Output is correct |
81 | Incorrect | 23 ms | 8936 KB | Output isn't correct |
82 | Incorrect | 89 ms | 8936 KB | Output isn't correct |
83 | Incorrect | 116 ms | 8936 KB | Output isn't correct |
84 | Incorrect | 123 ms | 8936 KB | Output isn't correct |
85 | Incorrect | 119 ms | 8936 KB | Output isn't correct |
86 | Incorrect | 123 ms | 8936 KB | Output isn't correct |
87 | Incorrect | 116 ms | 8936 KB | Output isn't correct |
88 | Incorrect | 16 ms | 8936 KB | Output isn't correct |
89 | Incorrect | 69 ms | 8936 KB | Output isn't correct |
90 | Incorrect | 46 ms | 8936 KB | Output isn't correct |
91 | Incorrect | 3 ms | 8936 KB | Output isn't correct |
92 | Incorrect | 46 ms | 8936 KB | Output isn't correct |