답안 #829373

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
829373 2023-08-18T09:56:56 Z QwertyPi Uplifting Excursion (BOI22_vault) C++14
80 / 100
1711 ms 524288 KB
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("Ofast")
#define int long long

using namespace std;

const int M = 300 + 11;
const int X = M * M * 2;
const int INF = 1LL << 60;
int a[M * 2];
int s[M * 2];

int norm(int x, int m){
	if(x >= 0) return x;
	return (x % m + m) % m;
}

int dp_p[M][X], dp_n[M][X];
void solve(int m, int L, vector<int> a, int dp[M][X]){
	for(int i = 0; i <= m; i++){
		fill(dp[i], dp[i] + X, -INF);
	}
	for(int i = 1; i <= m; i++) s[i] = min(L, s[i - 1] + i * a[i]);

	dp[0][0] = 0;
	for(int i = 1; i <= m; i++){
		for(int j = 0; j <= m * (i - 1); j++){
			int left = norm(s[i] - s[i - 1] + j - a[i] * i, i);
			int right = min(s[i] + j - s[i - 1], m * i);
			int inc = i;
			int delta = ((s[i] - left) - (s[i - 1] - j)) / i;
			for(int k = left; k <= right; k += inc){
				dp[i][k] = max(dp[i][k], dp[i - 1][j] + delta);
				delta--;
			}
		}
	}
}

int32_t main(){
	int m, L; cin >> m >> L;
	for(int i = 0; i <= m * 2; i++) cin >> a[i];
	
	if(L < 0){
		reverse(a, a + m * 2 + 1); L = -L;
	}

	int sum_p = 0, sum_n = 0;
	for(int i = m + 1; i <= m * 2; i++) {
		sum_p += (i - m) * a[i];
	}
	for(int i = m - 1; i >= 0; i--) {
		sum_n += (m - i) * a[i];
	}

	if(sum_p < L){
		cout << "impossible" << endl;
		return 0;
	}

	int lim = min(sum_n, sum_p - L);

	// positive
	vector<int> b_pos {0}, b_neg {0};
	for(int i = 1; i <= m; i++){
		b_pos.push_back(a[m + i]);
		b_neg.push_back(a[m - i]);
	}

	solve(m, lim + L, b_pos, dp_p);
	solve(m, lim, b_neg, dp_n);

	int ans = -INF;
	for(int i = 0; i <= m * m * 2; i++){
		ans = max(ans, dp_p[m][i] + dp_n[m][i]);
	}
	if(L < 0){
		cout << "impossible" << endl;
		return 0;
	}

	if(ans <= -INF / 2){
		cout << "impossible" << endl;
	}else{
		cout << a[m] + ans << endl;
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 9300 KB Output is correct
2 Correct 6 ms 12372 KB Output is correct
3 Correct 2 ms 6356 KB Output is correct
4 Correct 14 ms 33532 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 57 ms 154700 KB Output is correct
7 Correct 61 ms 154636 KB Output is correct
8 Correct 57 ms 154720 KB Output is correct
9 Correct 67 ms 154664 KB Output is correct
10 Correct 55 ms 154724 KB Output is correct
11 Correct 55 ms 154748 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 9300 KB Output is correct
2 Correct 6 ms 12372 KB Output is correct
3 Correct 2 ms 6356 KB Output is correct
4 Correct 14 ms 33532 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 57 ms 154700 KB Output is correct
7 Correct 61 ms 154636 KB Output is correct
8 Correct 57 ms 154720 KB Output is correct
9 Correct 67 ms 154664 KB Output is correct
10 Correct 55 ms 154724 KB Output is correct
11 Correct 55 ms 154748 KB Output is correct
12 Correct 4 ms 9300 KB Output is correct
13 Correct 5 ms 12372 KB Output is correct
14 Correct 3 ms 6356 KB Output is correct
15 Correct 13 ms 33572 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 55 ms 154752 KB Output is correct
18 Correct 63 ms 154748 KB Output is correct
19 Correct 56 ms 154684 KB Output is correct
20 Correct 57 ms 154692 KB Output is correct
21 Correct 54 ms 154756 KB Output is correct
22 Correct 56 ms 154640 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 132 ms 306124 KB Output is correct
25 Correct 117 ms 306164 KB Output is correct
26 Correct 151 ms 306124 KB Output is correct
27 Correct 162 ms 306168 KB Output is correct
28 Correct 106 ms 306080 KB Output is correct
29 Correct 104 ms 306172 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 33620 KB Output is correct
2 Correct 34 ms 94120 KB Output is correct
3 Correct 34 ms 94160 KB Output is correct
4 Correct 35 ms 94088 KB Output is correct
5 Correct 34 ms 94164 KB Output is correct
6 Correct 35 ms 94196 KB Output is correct
7 Correct 35 ms 94180 KB Output is correct
8 Correct 38 ms 94100 KB Output is correct
9 Correct 34 ms 94128 KB Output is correct
10 Correct 35 ms 94172 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 33620 KB Output is correct
2 Correct 34 ms 94120 KB Output is correct
3 Correct 34 ms 94160 KB Output is correct
4 Correct 35 ms 94088 KB Output is correct
5 Correct 34 ms 94164 KB Output is correct
6 Correct 35 ms 94196 KB Output is correct
7 Correct 35 ms 94180 KB Output is correct
8 Correct 38 ms 94100 KB Output is correct
9 Correct 34 ms 94128 KB Output is correct
10 Correct 35 ms 94172 KB Output is correct
11 Correct 4 ms 9412 KB Output is correct
12 Correct 5 ms 12372 KB Output is correct
13 Correct 2 ms 6356 KB Output is correct
14 Correct 16 ms 33532 KB Output is correct
15 Correct 35 ms 94164 KB Output is correct
16 Correct 34 ms 94100 KB Output is correct
17 Correct 33 ms 94172 KB Output is correct
18 Correct 35 ms 94096 KB Output is correct
19 Correct 34 ms 94164 KB Output is correct
20 Correct 35 ms 94168 KB Output is correct
21 Correct 38 ms 94088 KB Output is correct
22 Correct 34 ms 94152 KB Output is correct
23 Correct 34 ms 94092 KB Output is correct
24 Correct 36 ms 94080 KB Output is correct
25 Correct 34 ms 94184 KB Output is correct
26 Correct 35 ms 94096 KB Output is correct
27 Correct 35 ms 94148 KB Output is correct
28 Correct 36 ms 94132 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 33620 KB Output is correct
2 Correct 34 ms 94120 KB Output is correct
3 Correct 34 ms 94160 KB Output is correct
4 Correct 35 ms 94088 KB Output is correct
5 Correct 34 ms 94164 KB Output is correct
6 Correct 35 ms 94196 KB Output is correct
7 Correct 35 ms 94180 KB Output is correct
8 Correct 38 ms 94100 KB Output is correct
9 Correct 34 ms 94128 KB Output is correct
10 Correct 35 ms 94172 KB Output is correct
11 Correct 13 ms 33636 KB Output is correct
12 Correct 34 ms 94160 KB Output is correct
13 Correct 34 ms 94180 KB Output is correct
14 Correct 35 ms 94056 KB Output is correct
15 Correct 35 ms 94112 KB Output is correct
16 Correct 36 ms 94100 KB Output is correct
17 Correct 36 ms 94060 KB Output is correct
18 Correct 35 ms 94092 KB Output is correct
19 Correct 35 ms 94068 KB Output is correct
20 Correct 34 ms 94084 KB Output is correct
21 Correct 56 ms 154792 KB Output is correct
22 Correct 55 ms 154724 KB Output is correct
23 Correct 57 ms 154704 KB Output is correct
24 Correct 56 ms 154728 KB Output is correct
25 Correct 56 ms 154752 KB Output is correct
26 Correct 58 ms 154776 KB Output is correct
27 Correct 55 ms 154704 KB Output is correct
28 Correct 71 ms 154696 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 9300 KB Output is correct
2 Correct 6 ms 12372 KB Output is correct
3 Correct 2 ms 6356 KB Output is correct
4 Correct 14 ms 33532 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 57 ms 154700 KB Output is correct
7 Correct 61 ms 154636 KB Output is correct
8 Correct 57 ms 154720 KB Output is correct
9 Correct 67 ms 154664 KB Output is correct
10 Correct 55 ms 154724 KB Output is correct
11 Correct 55 ms 154748 KB Output is correct
12 Correct 14 ms 33620 KB Output is correct
13 Correct 34 ms 94120 KB Output is correct
14 Correct 34 ms 94160 KB Output is correct
15 Correct 35 ms 94088 KB Output is correct
16 Correct 34 ms 94164 KB Output is correct
17 Correct 35 ms 94196 KB Output is correct
18 Correct 35 ms 94180 KB Output is correct
19 Correct 38 ms 94100 KB Output is correct
20 Correct 34 ms 94128 KB Output is correct
21 Correct 35 ms 94172 KB Output is correct
22 Correct 4 ms 9412 KB Output is correct
23 Correct 5 ms 12372 KB Output is correct
24 Correct 2 ms 6356 KB Output is correct
25 Correct 16 ms 33532 KB Output is correct
26 Correct 35 ms 94164 KB Output is correct
27 Correct 34 ms 94100 KB Output is correct
28 Correct 33 ms 94172 KB Output is correct
29 Correct 35 ms 94096 KB Output is correct
30 Correct 34 ms 94164 KB Output is correct
31 Correct 35 ms 94168 KB Output is correct
32 Correct 38 ms 94088 KB Output is correct
33 Correct 34 ms 94152 KB Output is correct
34 Correct 34 ms 94092 KB Output is correct
35 Correct 36 ms 94080 KB Output is correct
36 Correct 34 ms 94184 KB Output is correct
37 Correct 35 ms 94096 KB Output is correct
38 Correct 35 ms 94148 KB Output is correct
39 Correct 36 ms 94132 KB Output is correct
40 Correct 13 ms 33636 KB Output is correct
41 Correct 34 ms 94160 KB Output is correct
42 Correct 34 ms 94180 KB Output is correct
43 Correct 35 ms 94056 KB Output is correct
44 Correct 35 ms 94112 KB Output is correct
45 Correct 36 ms 94100 KB Output is correct
46 Correct 36 ms 94060 KB Output is correct
47 Correct 35 ms 94092 KB Output is correct
48 Correct 35 ms 94068 KB Output is correct
49 Correct 34 ms 94084 KB Output is correct
50 Correct 56 ms 154792 KB Output is correct
51 Correct 55 ms 154724 KB Output is correct
52 Correct 57 ms 154704 KB Output is correct
53 Correct 56 ms 154728 KB Output is correct
54 Correct 56 ms 154752 KB Output is correct
55 Correct 58 ms 154776 KB Output is correct
56 Correct 55 ms 154704 KB Output is correct
57 Correct 71 ms 154696 KB Output is correct
58 Correct 5 ms 9300 KB Output is correct
59 Correct 5 ms 12372 KB Output is correct
60 Correct 3 ms 6356 KB Output is correct
61 Correct 13 ms 33540 KB Output is correct
62 Correct 0 ms 212 KB Output is correct
63 Correct 56 ms 154728 KB Output is correct
64 Correct 56 ms 154700 KB Output is correct
65 Correct 56 ms 154732 KB Output is correct
66 Correct 59 ms 154648 KB Output is correct
67 Correct 64 ms 154872 KB Output is correct
68 Correct 70 ms 154724 KB Output is correct
69 Correct 37 ms 94156 KB Output is correct
70 Correct 35 ms 94156 KB Output is correct
71 Correct 35 ms 94100 KB Output is correct
72 Correct 34 ms 94108 KB Output is correct
73 Correct 35 ms 94116 KB Output is correct
74 Correct 34 ms 94156 KB Output is correct
75 Correct 34 ms 94096 KB Output is correct
76 Correct 35 ms 94104 KB Output is correct
77 Correct 35 ms 94176 KB Output is correct
78 Correct 35 ms 94188 KB Output is correct
79 Correct 34 ms 94104 KB Output is correct
80 Correct 36 ms 94096 KB Output is correct
81 Correct 37 ms 94192 KB Output is correct
82 Correct 35 ms 94156 KB Output is correct
83 Correct 56 ms 154696 KB Output is correct
84 Correct 55 ms 154700 KB Output is correct
85 Correct 56 ms 154708 KB Output is correct
86 Correct 56 ms 154716 KB Output is correct
87 Correct 57 ms 154716 KB Output is correct
88 Correct 54 ms 154636 KB Output is correct
89 Correct 56 ms 154644 KB Output is correct
90 Correct 57 ms 154704 KB Output is correct
91 Correct 60 ms 154636 KB Output is correct
92 Correct 58 ms 154720 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 33620 KB Output is correct
2 Correct 34 ms 94120 KB Output is correct
3 Correct 34 ms 94160 KB Output is correct
4 Correct 35 ms 94088 KB Output is correct
5 Correct 34 ms 94164 KB Output is correct
6 Correct 35 ms 94196 KB Output is correct
7 Correct 35 ms 94180 KB Output is correct
8 Correct 38 ms 94100 KB Output is correct
9 Correct 34 ms 94128 KB Output is correct
10 Correct 35 ms 94172 KB Output is correct
11 Correct 13 ms 33636 KB Output is correct
12 Correct 34 ms 94160 KB Output is correct
13 Correct 34 ms 94180 KB Output is correct
14 Correct 35 ms 94056 KB Output is correct
15 Correct 35 ms 94112 KB Output is correct
16 Correct 36 ms 94100 KB Output is correct
17 Correct 36 ms 94060 KB Output is correct
18 Correct 35 ms 94092 KB Output is correct
19 Correct 35 ms 94068 KB Output is correct
20 Correct 34 ms 94084 KB Output is correct
21 Correct 56 ms 154792 KB Output is correct
22 Correct 55 ms 154724 KB Output is correct
23 Correct 57 ms 154704 KB Output is correct
24 Correct 56 ms 154728 KB Output is correct
25 Correct 56 ms 154752 KB Output is correct
26 Correct 58 ms 154776 KB Output is correct
27 Correct 55 ms 154704 KB Output is correct
28 Correct 71 ms 154696 KB Output is correct
29 Correct 13 ms 33620 KB Output is correct
30 Correct 35 ms 94068 KB Output is correct
31 Correct 37 ms 94148 KB Output is correct
32 Correct 34 ms 94164 KB Output is correct
33 Correct 35 ms 94096 KB Output is correct
34 Correct 39 ms 94096 KB Output is correct
35 Correct 35 ms 94148 KB Output is correct
36 Correct 36 ms 94136 KB Output is correct
37 Correct 35 ms 94144 KB Output is correct
38 Correct 34 ms 94112 KB Output is correct
39 Correct 54 ms 154672 KB Output is correct
40 Correct 59 ms 154756 KB Output is correct
41 Correct 55 ms 154744 KB Output is correct
42 Correct 54 ms 154700 KB Output is correct
43 Correct 56 ms 154740 KB Output is correct
44 Correct 56 ms 154708 KB Output is correct
45 Correct 57 ms 154644 KB Output is correct
46 Correct 56 ms 154740 KB Output is correct
47 Correct 112 ms 306072 KB Output is correct
48 Correct 106 ms 306132 KB Output is correct
49 Correct 122 ms 306136 KB Output is correct
50 Correct 113 ms 306120 KB Output is correct
51 Correct 125 ms 306096 KB Output is correct
52 Correct 133 ms 306144 KB Output is correct
53 Correct 122 ms 306156 KB Output is correct
54 Correct 115 ms 306156 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 9300 KB Output is correct
2 Correct 6 ms 12372 KB Output is correct
3 Correct 2 ms 6356 KB Output is correct
4 Correct 14 ms 33532 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 57 ms 154700 KB Output is correct
7 Correct 61 ms 154636 KB Output is correct
8 Correct 57 ms 154720 KB Output is correct
9 Correct 67 ms 154664 KB Output is correct
10 Correct 55 ms 154724 KB Output is correct
11 Correct 55 ms 154748 KB Output is correct
12 Correct 4 ms 9300 KB Output is correct
13 Correct 5 ms 12372 KB Output is correct
14 Correct 3 ms 6356 KB Output is correct
15 Correct 13 ms 33572 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 55 ms 154752 KB Output is correct
18 Correct 63 ms 154748 KB Output is correct
19 Correct 56 ms 154684 KB Output is correct
20 Correct 57 ms 154692 KB Output is correct
21 Correct 54 ms 154756 KB Output is correct
22 Correct 56 ms 154640 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 132 ms 306124 KB Output is correct
25 Correct 117 ms 306164 KB Output is correct
26 Correct 151 ms 306124 KB Output is correct
27 Correct 162 ms 306168 KB Output is correct
28 Correct 106 ms 306080 KB Output is correct
29 Correct 104 ms 306172 KB Output is correct
30 Correct 14 ms 33620 KB Output is correct
31 Correct 34 ms 94120 KB Output is correct
32 Correct 34 ms 94160 KB Output is correct
33 Correct 35 ms 94088 KB Output is correct
34 Correct 34 ms 94164 KB Output is correct
35 Correct 35 ms 94196 KB Output is correct
36 Correct 35 ms 94180 KB Output is correct
37 Correct 38 ms 94100 KB Output is correct
38 Correct 34 ms 94128 KB Output is correct
39 Correct 35 ms 94172 KB Output is correct
40 Correct 4 ms 9412 KB Output is correct
41 Correct 5 ms 12372 KB Output is correct
42 Correct 2 ms 6356 KB Output is correct
43 Correct 16 ms 33532 KB Output is correct
44 Correct 35 ms 94164 KB Output is correct
45 Correct 34 ms 94100 KB Output is correct
46 Correct 33 ms 94172 KB Output is correct
47 Correct 35 ms 94096 KB Output is correct
48 Correct 34 ms 94164 KB Output is correct
49 Correct 35 ms 94168 KB Output is correct
50 Correct 38 ms 94088 KB Output is correct
51 Correct 34 ms 94152 KB Output is correct
52 Correct 34 ms 94092 KB Output is correct
53 Correct 36 ms 94080 KB Output is correct
54 Correct 34 ms 94184 KB Output is correct
55 Correct 35 ms 94096 KB Output is correct
56 Correct 35 ms 94148 KB Output is correct
57 Correct 36 ms 94132 KB Output is correct
58 Correct 13 ms 33636 KB Output is correct
59 Correct 34 ms 94160 KB Output is correct
60 Correct 34 ms 94180 KB Output is correct
61 Correct 35 ms 94056 KB Output is correct
62 Correct 35 ms 94112 KB Output is correct
63 Correct 36 ms 94100 KB Output is correct
64 Correct 36 ms 94060 KB Output is correct
65 Correct 35 ms 94092 KB Output is correct
66 Correct 35 ms 94068 KB Output is correct
67 Correct 34 ms 94084 KB Output is correct
68 Correct 56 ms 154792 KB Output is correct
69 Correct 55 ms 154724 KB Output is correct
70 Correct 57 ms 154704 KB Output is correct
71 Correct 56 ms 154728 KB Output is correct
72 Correct 56 ms 154752 KB Output is correct
73 Correct 58 ms 154776 KB Output is correct
74 Correct 55 ms 154704 KB Output is correct
75 Correct 71 ms 154696 KB Output is correct
76 Correct 5 ms 9300 KB Output is correct
77 Correct 5 ms 12372 KB Output is correct
78 Correct 3 ms 6356 KB Output is correct
79 Correct 13 ms 33540 KB Output is correct
80 Correct 0 ms 212 KB Output is correct
81 Correct 56 ms 154728 KB Output is correct
82 Correct 56 ms 154700 KB Output is correct
83 Correct 56 ms 154732 KB Output is correct
84 Correct 59 ms 154648 KB Output is correct
85 Correct 64 ms 154872 KB Output is correct
86 Correct 70 ms 154724 KB Output is correct
87 Correct 37 ms 94156 KB Output is correct
88 Correct 35 ms 94156 KB Output is correct
89 Correct 35 ms 94100 KB Output is correct
90 Correct 34 ms 94108 KB Output is correct
91 Correct 35 ms 94116 KB Output is correct
92 Correct 34 ms 94156 KB Output is correct
93 Correct 34 ms 94096 KB Output is correct
94 Correct 35 ms 94104 KB Output is correct
95 Correct 35 ms 94176 KB Output is correct
96 Correct 35 ms 94188 KB Output is correct
97 Correct 34 ms 94104 KB Output is correct
98 Correct 36 ms 94096 KB Output is correct
99 Correct 37 ms 94192 KB Output is correct
100 Correct 35 ms 94156 KB Output is correct
101 Correct 56 ms 154696 KB Output is correct
102 Correct 55 ms 154700 KB Output is correct
103 Correct 56 ms 154708 KB Output is correct
104 Correct 56 ms 154716 KB Output is correct
105 Correct 57 ms 154716 KB Output is correct
106 Correct 54 ms 154636 KB Output is correct
107 Correct 56 ms 154644 KB Output is correct
108 Correct 57 ms 154704 KB Output is correct
109 Correct 60 ms 154636 KB Output is correct
110 Correct 58 ms 154720 KB Output is correct
111 Correct 13 ms 33620 KB Output is correct
112 Correct 35 ms 94068 KB Output is correct
113 Correct 37 ms 94148 KB Output is correct
114 Correct 34 ms 94164 KB Output is correct
115 Correct 35 ms 94096 KB Output is correct
116 Correct 39 ms 94096 KB Output is correct
117 Correct 35 ms 94148 KB Output is correct
118 Correct 36 ms 94136 KB Output is correct
119 Correct 35 ms 94144 KB Output is correct
120 Correct 34 ms 94112 KB Output is correct
121 Correct 54 ms 154672 KB Output is correct
122 Correct 59 ms 154756 KB Output is correct
123 Correct 55 ms 154744 KB Output is correct
124 Correct 54 ms 154700 KB Output is correct
125 Correct 56 ms 154740 KB Output is correct
126 Correct 56 ms 154708 KB Output is correct
127 Correct 57 ms 154644 KB Output is correct
128 Correct 56 ms 154740 KB Output is correct
129 Correct 112 ms 306072 KB Output is correct
130 Correct 106 ms 306132 KB Output is correct
131 Correct 122 ms 306136 KB Output is correct
132 Correct 113 ms 306120 KB Output is correct
133 Correct 125 ms 306096 KB Output is correct
134 Correct 133 ms 306144 KB Output is correct
135 Correct 122 ms 306156 KB Output is correct
136 Correct 115 ms 306156 KB Output is correct
137 Correct 4 ms 9300 KB Output is correct
138 Correct 5 ms 12372 KB Output is correct
139 Correct 3 ms 6356 KB Output is correct
140 Correct 13 ms 33632 KB Output is correct
141 Correct 0 ms 212 KB Output is correct
142 Correct 57 ms 154668 KB Output is correct
143 Correct 58 ms 154752 KB Output is correct
144 Correct 57 ms 154756 KB Output is correct
145 Correct 57 ms 154644 KB Output is correct
146 Correct 54 ms 154700 KB Output is correct
147 Correct 54 ms 154756 KB Output is correct
148 Correct 0 ms 212 KB Output is correct
149 Correct 136 ms 306176 KB Output is correct
150 Correct 117 ms 306164 KB Output is correct
151 Correct 153 ms 306144 KB Output is correct
152 Correct 179 ms 306064 KB Output is correct
153 Correct 105 ms 306164 KB Output is correct
154 Correct 106 ms 306140 KB Output is correct
155 Correct 35 ms 94132 KB Output is correct
156 Correct 35 ms 94096 KB Output is correct
157 Correct 37 ms 94116 KB Output is correct
158 Correct 36 ms 94120 KB Output is correct
159 Correct 36 ms 94164 KB Output is correct
160 Correct 35 ms 94188 KB Output is correct
161 Correct 35 ms 94188 KB Output is correct
162 Correct 34 ms 94164 KB Output is correct
163 Correct 37 ms 94164 KB Output is correct
164 Correct 57 ms 154704 KB Output is correct
165 Correct 55 ms 154700 KB Output is correct
166 Correct 57 ms 154716 KB Output is correct
167 Correct 58 ms 154652 KB Output is correct
168 Correct 58 ms 154720 KB Output is correct
169 Correct 55 ms 154744 KB Output is correct
170 Correct 35 ms 94104 KB Output is correct
171 Correct 38 ms 94176 KB Output is correct
172 Correct 35 ms 94164 KB Output is correct
173 Correct 36 ms 94108 KB Output is correct
174 Correct 34 ms 94136 KB Output is correct
175 Correct 56 ms 154720 KB Output is correct
176 Correct 58 ms 154756 KB Output is correct
177 Correct 56 ms 154648 KB Output is correct
178 Correct 57 ms 154728 KB Output is correct
179 Correct 125 ms 306252 KB Output is correct
180 Correct 112 ms 306080 KB Output is correct
181 Correct 125 ms 306124 KB Output is correct
182 Correct 128 ms 306064 KB Output is correct
183 Correct 123 ms 306152 KB Output is correct
184 Correct 114 ms 306176 KB Output is correct
185 Correct 138 ms 306088 KB Output is correct
186 Correct 168 ms 306064 KB Output is correct
187 Correct 139 ms 306144 KB Output is correct
188 Correct 139 ms 306112 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 14 ms 33620 KB Output is correct
2 Correct 34 ms 94120 KB Output is correct
3 Correct 34 ms 94160 KB Output is correct
4 Correct 35 ms 94088 KB Output is correct
5 Correct 34 ms 94164 KB Output is correct
6 Correct 35 ms 94196 KB Output is correct
7 Correct 35 ms 94180 KB Output is correct
8 Correct 38 ms 94100 KB Output is correct
9 Correct 34 ms 94128 KB Output is correct
10 Correct 35 ms 94172 KB Output is correct
11 Correct 13 ms 33636 KB Output is correct
12 Correct 34 ms 94160 KB Output is correct
13 Correct 34 ms 94180 KB Output is correct
14 Correct 35 ms 94056 KB Output is correct
15 Correct 35 ms 94112 KB Output is correct
16 Correct 36 ms 94100 KB Output is correct
17 Correct 36 ms 94060 KB Output is correct
18 Correct 35 ms 94092 KB Output is correct
19 Correct 35 ms 94068 KB Output is correct
20 Correct 34 ms 94084 KB Output is correct
21 Correct 56 ms 154792 KB Output is correct
22 Correct 55 ms 154724 KB Output is correct
23 Correct 57 ms 154704 KB Output is correct
24 Correct 56 ms 154728 KB Output is correct
25 Correct 56 ms 154752 KB Output is correct
26 Correct 58 ms 154776 KB Output is correct
27 Correct 55 ms 154704 KB Output is correct
28 Correct 71 ms 154696 KB Output is correct
29 Correct 13 ms 33620 KB Output is correct
30 Correct 35 ms 94068 KB Output is correct
31 Correct 37 ms 94148 KB Output is correct
32 Correct 34 ms 94164 KB Output is correct
33 Correct 35 ms 94096 KB Output is correct
34 Correct 39 ms 94096 KB Output is correct
35 Correct 35 ms 94148 KB Output is correct
36 Correct 36 ms 94136 KB Output is correct
37 Correct 35 ms 94144 KB Output is correct
38 Correct 34 ms 94112 KB Output is correct
39 Correct 54 ms 154672 KB Output is correct
40 Correct 59 ms 154756 KB Output is correct
41 Correct 55 ms 154744 KB Output is correct
42 Correct 54 ms 154700 KB Output is correct
43 Correct 56 ms 154740 KB Output is correct
44 Correct 56 ms 154708 KB Output is correct
45 Correct 57 ms 154644 KB Output is correct
46 Correct 56 ms 154740 KB Output is correct
47 Correct 112 ms 306072 KB Output is correct
48 Correct 106 ms 306132 KB Output is correct
49 Correct 122 ms 306136 KB Output is correct
50 Correct 113 ms 306120 KB Output is correct
51 Correct 125 ms 306096 KB Output is correct
52 Correct 133 ms 306144 KB Output is correct
53 Correct 122 ms 306156 KB Output is correct
54 Correct 115 ms 306156 KB Output is correct
55 Correct 14 ms 33624 KB Output is correct
56 Correct 35 ms 94100 KB Output is correct
57 Correct 41 ms 94100 KB Output is correct
58 Correct 35 ms 94172 KB Output is correct
59 Correct 39 ms 94128 KB Output is correct
60 Correct 35 ms 94116 KB Output is correct
61 Correct 34 ms 94156 KB Output is correct
62 Correct 34 ms 94156 KB Output is correct
63 Correct 35 ms 94068 KB Output is correct
64 Correct 34 ms 94164 KB Output is correct
65 Correct 64 ms 154672 KB Output is correct
66 Correct 54 ms 154672 KB Output is correct
67 Correct 55 ms 154684 KB Output is correct
68 Correct 54 ms 154640 KB Output is correct
69 Correct 54 ms 154656 KB Output is correct
70 Correct 56 ms 154664 KB Output is correct
71 Correct 63 ms 154724 KB Output is correct
72 Correct 56 ms 154724 KB Output is correct
73 Correct 105 ms 306072 KB Output is correct
74 Correct 104 ms 306072 KB Output is correct
75 Correct 125 ms 306164 KB Output is correct
76 Correct 117 ms 306076 KB Output is correct
77 Correct 126 ms 306156 KB Output is correct
78 Correct 132 ms 306112 KB Output is correct
79 Correct 122 ms 306156 KB Output is correct
80 Correct 116 ms 306056 KB Output is correct
81 Runtime error 1711 ms 524288 KB Execution killed with signal 9
82 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 9300 KB Output is correct
2 Correct 6 ms 12372 KB Output is correct
3 Correct 2 ms 6356 KB Output is correct
4 Correct 14 ms 33532 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 57 ms 154700 KB Output is correct
7 Correct 61 ms 154636 KB Output is correct
8 Correct 57 ms 154720 KB Output is correct
9 Correct 67 ms 154664 KB Output is correct
10 Correct 55 ms 154724 KB Output is correct
11 Correct 55 ms 154748 KB Output is correct
12 Correct 4 ms 9300 KB Output is correct
13 Correct 5 ms 12372 KB Output is correct
14 Correct 3 ms 6356 KB Output is correct
15 Correct 13 ms 33572 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 55 ms 154752 KB Output is correct
18 Correct 63 ms 154748 KB Output is correct
19 Correct 56 ms 154684 KB Output is correct
20 Correct 57 ms 154692 KB Output is correct
21 Correct 54 ms 154756 KB Output is correct
22 Correct 56 ms 154640 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 132 ms 306124 KB Output is correct
25 Correct 117 ms 306164 KB Output is correct
26 Correct 151 ms 306124 KB Output is correct
27 Correct 162 ms 306168 KB Output is correct
28 Correct 106 ms 306080 KB Output is correct
29 Correct 104 ms 306172 KB Output is correct
30 Correct 14 ms 33620 KB Output is correct
31 Correct 34 ms 94120 KB Output is correct
32 Correct 34 ms 94160 KB Output is correct
33 Correct 35 ms 94088 KB Output is correct
34 Correct 34 ms 94164 KB Output is correct
35 Correct 35 ms 94196 KB Output is correct
36 Correct 35 ms 94180 KB Output is correct
37 Correct 38 ms 94100 KB Output is correct
38 Correct 34 ms 94128 KB Output is correct
39 Correct 35 ms 94172 KB Output is correct
40 Correct 4 ms 9412 KB Output is correct
41 Correct 5 ms 12372 KB Output is correct
42 Correct 2 ms 6356 KB Output is correct
43 Correct 16 ms 33532 KB Output is correct
44 Correct 35 ms 94164 KB Output is correct
45 Correct 34 ms 94100 KB Output is correct
46 Correct 33 ms 94172 KB Output is correct
47 Correct 35 ms 94096 KB Output is correct
48 Correct 34 ms 94164 KB Output is correct
49 Correct 35 ms 94168 KB Output is correct
50 Correct 38 ms 94088 KB Output is correct
51 Correct 34 ms 94152 KB Output is correct
52 Correct 34 ms 94092 KB Output is correct
53 Correct 36 ms 94080 KB Output is correct
54 Correct 34 ms 94184 KB Output is correct
55 Correct 35 ms 94096 KB Output is correct
56 Correct 35 ms 94148 KB Output is correct
57 Correct 36 ms 94132 KB Output is correct
58 Correct 13 ms 33636 KB Output is correct
59 Correct 34 ms 94160 KB Output is correct
60 Correct 34 ms 94180 KB Output is correct
61 Correct 35 ms 94056 KB Output is correct
62 Correct 35 ms 94112 KB Output is correct
63 Correct 36 ms 94100 KB Output is correct
64 Correct 36 ms 94060 KB Output is correct
65 Correct 35 ms 94092 KB Output is correct
66 Correct 35 ms 94068 KB Output is correct
67 Correct 34 ms 94084 KB Output is correct
68 Correct 56 ms 154792 KB Output is correct
69 Correct 55 ms 154724 KB Output is correct
70 Correct 57 ms 154704 KB Output is correct
71 Correct 56 ms 154728 KB Output is correct
72 Correct 56 ms 154752 KB Output is correct
73 Correct 58 ms 154776 KB Output is correct
74 Correct 55 ms 154704 KB Output is correct
75 Correct 71 ms 154696 KB Output is correct
76 Correct 5 ms 9300 KB Output is correct
77 Correct 5 ms 12372 KB Output is correct
78 Correct 3 ms 6356 KB Output is correct
79 Correct 13 ms 33540 KB Output is correct
80 Correct 0 ms 212 KB Output is correct
81 Correct 56 ms 154728 KB Output is correct
82 Correct 56 ms 154700 KB Output is correct
83 Correct 56 ms 154732 KB Output is correct
84 Correct 59 ms 154648 KB Output is correct
85 Correct 64 ms 154872 KB Output is correct
86 Correct 70 ms 154724 KB Output is correct
87 Correct 37 ms 94156 KB Output is correct
88 Correct 35 ms 94156 KB Output is correct
89 Correct 35 ms 94100 KB Output is correct
90 Correct 34 ms 94108 KB Output is correct
91 Correct 35 ms 94116 KB Output is correct
92 Correct 34 ms 94156 KB Output is correct
93 Correct 34 ms 94096 KB Output is correct
94 Correct 35 ms 94104 KB Output is correct
95 Correct 35 ms 94176 KB Output is correct
96 Correct 35 ms 94188 KB Output is correct
97 Correct 34 ms 94104 KB Output is correct
98 Correct 36 ms 94096 KB Output is correct
99 Correct 37 ms 94192 KB Output is correct
100 Correct 35 ms 94156 KB Output is correct
101 Correct 56 ms 154696 KB Output is correct
102 Correct 55 ms 154700 KB Output is correct
103 Correct 56 ms 154708 KB Output is correct
104 Correct 56 ms 154716 KB Output is correct
105 Correct 57 ms 154716 KB Output is correct
106 Correct 54 ms 154636 KB Output is correct
107 Correct 56 ms 154644 KB Output is correct
108 Correct 57 ms 154704 KB Output is correct
109 Correct 60 ms 154636 KB Output is correct
110 Correct 58 ms 154720 KB Output is correct
111 Correct 13 ms 33620 KB Output is correct
112 Correct 35 ms 94068 KB Output is correct
113 Correct 37 ms 94148 KB Output is correct
114 Correct 34 ms 94164 KB Output is correct
115 Correct 35 ms 94096 KB Output is correct
116 Correct 39 ms 94096 KB Output is correct
117 Correct 35 ms 94148 KB Output is correct
118 Correct 36 ms 94136 KB Output is correct
119 Correct 35 ms 94144 KB Output is correct
120 Correct 34 ms 94112 KB Output is correct
121 Correct 54 ms 154672 KB Output is correct
122 Correct 59 ms 154756 KB Output is correct
123 Correct 55 ms 154744 KB Output is correct
124 Correct 54 ms 154700 KB Output is correct
125 Correct 56 ms 154740 KB Output is correct
126 Correct 56 ms 154708 KB Output is correct
127 Correct 57 ms 154644 KB Output is correct
128 Correct 56 ms 154740 KB Output is correct
129 Correct 112 ms 306072 KB Output is correct
130 Correct 106 ms 306132 KB Output is correct
131 Correct 122 ms 306136 KB Output is correct
132 Correct 113 ms 306120 KB Output is correct
133 Correct 125 ms 306096 KB Output is correct
134 Correct 133 ms 306144 KB Output is correct
135 Correct 122 ms 306156 KB Output is correct
136 Correct 115 ms 306156 KB Output is correct
137 Correct 4 ms 9300 KB Output is correct
138 Correct 5 ms 12372 KB Output is correct
139 Correct 3 ms 6356 KB Output is correct
140 Correct 13 ms 33632 KB Output is correct
141 Correct 0 ms 212 KB Output is correct
142 Correct 57 ms 154668 KB Output is correct
143 Correct 58 ms 154752 KB Output is correct
144 Correct 57 ms 154756 KB Output is correct
145 Correct 57 ms 154644 KB Output is correct
146 Correct 54 ms 154700 KB Output is correct
147 Correct 54 ms 154756 KB Output is correct
148 Correct 0 ms 212 KB Output is correct
149 Correct 136 ms 306176 KB Output is correct
150 Correct 117 ms 306164 KB Output is correct
151 Correct 153 ms 306144 KB Output is correct
152 Correct 179 ms 306064 KB Output is correct
153 Correct 105 ms 306164 KB Output is correct
154 Correct 106 ms 306140 KB Output is correct
155 Correct 35 ms 94132 KB Output is correct
156 Correct 35 ms 94096 KB Output is correct
157 Correct 37 ms 94116 KB Output is correct
158 Correct 36 ms 94120 KB Output is correct
159 Correct 36 ms 94164 KB Output is correct
160 Correct 35 ms 94188 KB Output is correct
161 Correct 35 ms 94188 KB Output is correct
162 Correct 34 ms 94164 KB Output is correct
163 Correct 37 ms 94164 KB Output is correct
164 Correct 57 ms 154704 KB Output is correct
165 Correct 55 ms 154700 KB Output is correct
166 Correct 57 ms 154716 KB Output is correct
167 Correct 58 ms 154652 KB Output is correct
168 Correct 58 ms 154720 KB Output is correct
169 Correct 55 ms 154744 KB Output is correct
170 Correct 35 ms 94104 KB Output is correct
171 Correct 38 ms 94176 KB Output is correct
172 Correct 35 ms 94164 KB Output is correct
173 Correct 36 ms 94108 KB Output is correct
174 Correct 34 ms 94136 KB Output is correct
175 Correct 56 ms 154720 KB Output is correct
176 Correct 58 ms 154756 KB Output is correct
177 Correct 56 ms 154648 KB Output is correct
178 Correct 57 ms 154728 KB Output is correct
179 Correct 125 ms 306252 KB Output is correct
180 Correct 112 ms 306080 KB Output is correct
181 Correct 125 ms 306124 KB Output is correct
182 Correct 128 ms 306064 KB Output is correct
183 Correct 123 ms 306152 KB Output is correct
184 Correct 114 ms 306176 KB Output is correct
185 Correct 138 ms 306088 KB Output is correct
186 Correct 168 ms 306064 KB Output is correct
187 Correct 139 ms 306144 KB Output is correct
188 Correct 139 ms 306112 KB Output is correct
189 Correct 14 ms 33624 KB Output is correct
190 Correct 35 ms 94100 KB Output is correct
191 Correct 41 ms 94100 KB Output is correct
192 Correct 35 ms 94172 KB Output is correct
193 Correct 39 ms 94128 KB Output is correct
194 Correct 35 ms 94116 KB Output is correct
195 Correct 34 ms 94156 KB Output is correct
196 Correct 34 ms 94156 KB Output is correct
197 Correct 35 ms 94068 KB Output is correct
198 Correct 34 ms 94164 KB Output is correct
199 Correct 64 ms 154672 KB Output is correct
200 Correct 54 ms 154672 KB Output is correct
201 Correct 55 ms 154684 KB Output is correct
202 Correct 54 ms 154640 KB Output is correct
203 Correct 54 ms 154656 KB Output is correct
204 Correct 56 ms 154664 KB Output is correct
205 Correct 63 ms 154724 KB Output is correct
206 Correct 56 ms 154724 KB Output is correct
207 Correct 105 ms 306072 KB Output is correct
208 Correct 104 ms 306072 KB Output is correct
209 Correct 125 ms 306164 KB Output is correct
210 Correct 117 ms 306076 KB Output is correct
211 Correct 126 ms 306156 KB Output is correct
212 Correct 132 ms 306112 KB Output is correct
213 Correct 122 ms 306156 KB Output is correct
214 Correct 116 ms 306056 KB Output is correct
215 Runtime error 1711 ms 524288 KB Execution killed with signal 9
216 Halted 0 ms 0 KB -