Submission #1074779

# Submission time Handle Problem Language Result Execution time Memory
1074779 2024-08-25T13:55:45 Z socpite Uplifting Excursion (BOI22_vault) C++17
80 / 100
5000 ms 7488 KB
#include<bits/stdc++.h>
using namespace std;

const long long INF = 1e18;
const int maxn = 305;

long long A[2*maxn], inp[2*maxn];

int bs_A[2*maxn][65];

vector<pair<int, long long>> g[65][maxn];

long long dp[4*maxn*maxn];
long long tmp[4*maxn*maxn];

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int m;
	long long L;
	cin >> m >> L;
	for(int i = 0; i <= 2*m; i++)cin >> A[i];
	if(L < 0){
		L*=-1;
		for(int i = 1; i <= m; i++)swap(A[m-i], A[m+i]);
	}
	for(int i = 0; i <= 2*m; i++){
		if(i == m)continue;
		for(int j = 0; j <= 60; j++){
			if(A[i] == 0)break;
			bs_A[i][j] = A[i]&1 ? 1 : 2;
			A[i] = (A[i]-1)/2;
		}
	}
	for(int b = 0; b <= 60; b++){
		for(int i = 1; i <= m; i++){
			map<int, long long> mp;
			for(int p_val = 0; p_val <= bs_A[m+i][b]; p_val++){
				for(int n_val = 0; n_val <= bs_A[m-i][b]; n_val++){
					mp[(p_val - n_val)*i] = max<long long>(mp[(p_val - n_val)*i], p_val + n_val);
				}
			}	
			for(auto v: mp)g[b][i].push_back({v.first, v.second<<b});
		}
	}
	int sum = m*(m+1)*2;
	memset(dp, -1, sizeof(dp));
	dp[sum] = 0;
	for(int b = 0; b <= 60; b++){
		for(int i = 1; i <= m; i++){
			memset(tmp, -1, sizeof(tmp));
			for(auto v: g[b][i]){
				for(int j = 0; j <= 2*sum; j++){
					if(dp[j] == -1)continue;
					tmp[j + v.first] = max(tmp[j + v.first], dp[j] + v.second);
				}
			}
			memcpy(dp, tmp, sizeof(dp));
		}
		for(int j = 0; j <= 2*sum; j++)tmp[j] = -1; 
		for(int i = 0; i <= 2*sum; i++){
			if(((i&1)^(sum&1)) != ((L>>b)&1))continue;
			int ri = i - sum, pos;
			if(ri < 0)pos = (ri-1)/2 + sum;
			else pos = ri/2 + sum;
			assert(pos >= 0 && pos <= 2*sum);
			tmp[pos] = max(tmp[pos], dp[i]);
		}
		for(int i = 0; i <= 2*sum; i++)dp[i] = tmp[i];
	}
	if(dp[sum] == -1)cout << "impossible";
	else cout << dp[sum] + A[m];
}
# Verdict Execution time Memory Grader output
1 Correct 26 ms 6748 KB Output is correct
2 Correct 36 ms 6744 KB Output is correct
3 Correct 13 ms 6748 KB Output is correct
4 Correct 105 ms 6748 KB Output is correct
5 Correct 565 ms 6868 KB Output is correct
6 Correct 553 ms 6876 KB Output is correct
7 Correct 545 ms 6748 KB Output is correct
8 Correct 570 ms 6872 KB Output is correct
9 Correct 562 ms 6744 KB Output is correct
10 Correct 563 ms 6744 KB Output is correct
11 Correct 574 ms 6748 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 6748 KB Output is correct
2 Correct 36 ms 6744 KB Output is correct
3 Correct 13 ms 6748 KB Output is correct
4 Correct 105 ms 6748 KB Output is correct
5 Correct 565 ms 6868 KB Output is correct
6 Correct 553 ms 6876 KB Output is correct
7 Correct 545 ms 6748 KB Output is correct
8 Correct 570 ms 6872 KB Output is correct
9 Correct 562 ms 6744 KB Output is correct
10 Correct 563 ms 6744 KB Output is correct
11 Correct 574 ms 6748 KB Output is correct
12 Correct 23 ms 6744 KB Output is correct
13 Correct 37 ms 6748 KB Output is correct
14 Correct 13 ms 6748 KB Output is correct
15 Correct 111 ms 6748 KB Output is correct
16 Correct 555 ms 6748 KB Output is correct
17 Correct 563 ms 6748 KB Output is correct
18 Correct 543 ms 6860 KB Output is correct
19 Correct 581 ms 6872 KB Output is correct
20 Correct 568 ms 6748 KB Output is correct
21 Correct 541 ms 6748 KB Output is correct
22 Correct 546 ms 7000 KB Output is correct
23 Correct 1246 ms 7000 KB Output is correct
24 Correct 1330 ms 7016 KB Output is correct
25 Correct 1239 ms 7004 KB Output is correct
26 Correct 1334 ms 7004 KB Output is correct
27 Correct 1305 ms 7012 KB Output is correct
28 Correct 1232 ms 6936 KB Output is correct
29 Correct 1277 ms 6936 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 113 ms 6748 KB Output is correct
2 Correct 348 ms 6744 KB Output is correct
3 Correct 326 ms 6744 KB Output is correct
4 Correct 326 ms 6748 KB Output is correct
5 Correct 327 ms 6824 KB Output is correct
6 Correct 327 ms 6748 KB Output is correct
7 Correct 341 ms 6744 KB Output is correct
8 Correct 319 ms 6744 KB Output is correct
9 Correct 333 ms 6996 KB Output is correct
10 Correct 321 ms 6748 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 113 ms 6748 KB Output is correct
2 Correct 348 ms 6744 KB Output is correct
3 Correct 326 ms 6744 KB Output is correct
4 Correct 326 ms 6748 KB Output is correct
5 Correct 327 ms 6824 KB Output is correct
6 Correct 327 ms 6748 KB Output is correct
7 Correct 341 ms 6744 KB Output is correct
8 Correct 319 ms 6744 KB Output is correct
9 Correct 333 ms 6996 KB Output is correct
10 Correct 321 ms 6748 KB Output is correct
11 Correct 26 ms 6748 KB Output is correct
12 Correct 37 ms 6748 KB Output is correct
13 Correct 13 ms 6748 KB Output is correct
14 Correct 113 ms 6760 KB Output is correct
15 Correct 334 ms 6748 KB Output is correct
16 Correct 325 ms 6812 KB Output is correct
17 Correct 328 ms 6748 KB Output is correct
18 Correct 330 ms 6992 KB Output is correct
19 Correct 346 ms 6748 KB Output is correct
20 Correct 346 ms 6748 KB Output is correct
21 Correct 324 ms 6744 KB Output is correct
22 Correct 338 ms 6748 KB Output is correct
23 Correct 339 ms 6744 KB Output is correct
24 Correct 358 ms 6748 KB Output is correct
25 Correct 346 ms 6820 KB Output is correct
26 Correct 360 ms 6840 KB Output is correct
27 Correct 364 ms 7004 KB Output is correct
28 Correct 353 ms 7000 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 113 ms 6748 KB Output is correct
2 Correct 348 ms 6744 KB Output is correct
3 Correct 326 ms 6744 KB Output is correct
4 Correct 326 ms 6748 KB Output is correct
5 Correct 327 ms 6824 KB Output is correct
6 Correct 327 ms 6748 KB Output is correct
7 Correct 341 ms 6744 KB Output is correct
8 Correct 319 ms 6744 KB Output is correct
9 Correct 333 ms 6996 KB Output is correct
10 Correct 321 ms 6748 KB Output is correct
11 Correct 108 ms 6744 KB Output is correct
12 Correct 329 ms 6744 KB Output is correct
13 Correct 321 ms 6772 KB Output is correct
14 Correct 334 ms 6744 KB Output is correct
15 Correct 315 ms 6748 KB Output is correct
16 Correct 326 ms 6748 KB Output is correct
17 Correct 318 ms 6744 KB Output is correct
18 Correct 313 ms 6748 KB Output is correct
19 Correct 337 ms 6748 KB Output is correct
20 Correct 337 ms 6744 KB Output is correct
21 Correct 561 ms 6748 KB Output is correct
22 Correct 541 ms 6748 KB Output is correct
23 Correct 575 ms 6872 KB Output is correct
24 Correct 568 ms 6860 KB Output is correct
25 Correct 550 ms 6748 KB Output is correct
26 Correct 558 ms 6748 KB Output is correct
27 Correct 613 ms 6876 KB Output is correct
28 Correct 565 ms 6876 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 6748 KB Output is correct
2 Correct 36 ms 6744 KB Output is correct
3 Correct 13 ms 6748 KB Output is correct
4 Correct 105 ms 6748 KB Output is correct
5 Correct 565 ms 6868 KB Output is correct
6 Correct 553 ms 6876 KB Output is correct
7 Correct 545 ms 6748 KB Output is correct
8 Correct 570 ms 6872 KB Output is correct
9 Correct 562 ms 6744 KB Output is correct
10 Correct 563 ms 6744 KB Output is correct
11 Correct 574 ms 6748 KB Output is correct
12 Correct 113 ms 6748 KB Output is correct
13 Correct 348 ms 6744 KB Output is correct
14 Correct 326 ms 6744 KB Output is correct
15 Correct 326 ms 6748 KB Output is correct
16 Correct 327 ms 6824 KB Output is correct
17 Correct 327 ms 6748 KB Output is correct
18 Correct 341 ms 6744 KB Output is correct
19 Correct 319 ms 6744 KB Output is correct
20 Correct 333 ms 6996 KB Output is correct
21 Correct 321 ms 6748 KB Output is correct
22 Correct 26 ms 6748 KB Output is correct
23 Correct 37 ms 6748 KB Output is correct
24 Correct 13 ms 6748 KB Output is correct
25 Correct 113 ms 6760 KB Output is correct
26 Correct 334 ms 6748 KB Output is correct
27 Correct 325 ms 6812 KB Output is correct
28 Correct 328 ms 6748 KB Output is correct
29 Correct 330 ms 6992 KB Output is correct
30 Correct 346 ms 6748 KB Output is correct
31 Correct 346 ms 6748 KB Output is correct
32 Correct 324 ms 6744 KB Output is correct
33 Correct 338 ms 6748 KB Output is correct
34 Correct 339 ms 6744 KB Output is correct
35 Correct 358 ms 6748 KB Output is correct
36 Correct 346 ms 6820 KB Output is correct
37 Correct 360 ms 6840 KB Output is correct
38 Correct 364 ms 7004 KB Output is correct
39 Correct 353 ms 7000 KB Output is correct
40 Correct 108 ms 6744 KB Output is correct
41 Correct 329 ms 6744 KB Output is correct
42 Correct 321 ms 6772 KB Output is correct
43 Correct 334 ms 6744 KB Output is correct
44 Correct 315 ms 6748 KB Output is correct
45 Correct 326 ms 6748 KB Output is correct
46 Correct 318 ms 6744 KB Output is correct
47 Correct 313 ms 6748 KB Output is correct
48 Correct 337 ms 6748 KB Output is correct
49 Correct 337 ms 6744 KB Output is correct
50 Correct 561 ms 6748 KB Output is correct
51 Correct 541 ms 6748 KB Output is correct
52 Correct 575 ms 6872 KB Output is correct
53 Correct 568 ms 6860 KB Output is correct
54 Correct 550 ms 6748 KB Output is correct
55 Correct 558 ms 6748 KB Output is correct
56 Correct 613 ms 6876 KB Output is correct
57 Correct 565 ms 6876 KB Output is correct
58 Correct 27 ms 6748 KB Output is correct
59 Correct 39 ms 6748 KB Output is correct
60 Correct 15 ms 6744 KB Output is correct
61 Correct 109 ms 6760 KB Output is correct
62 Correct 562 ms 6748 KB Output is correct
63 Correct 570 ms 6748 KB Output is correct
64 Correct 575 ms 6788 KB Output is correct
65 Correct 580 ms 6868 KB Output is correct
66 Correct 580 ms 6748 KB Output is correct
67 Correct 510 ms 6872 KB Output is correct
68 Correct 530 ms 6876 KB Output is correct
69 Correct 306 ms 6744 KB Output is correct
70 Correct 339 ms 6840 KB Output is correct
71 Correct 304 ms 6744 KB Output is correct
72 Correct 305 ms 6996 KB Output is correct
73 Correct 326 ms 6840 KB Output is correct
74 Correct 312 ms 6848 KB Output is correct
75 Correct 304 ms 6836 KB Output is correct
76 Correct 303 ms 6748 KB Output is correct
77 Correct 300 ms 7000 KB Output is correct
78 Correct 330 ms 6748 KB Output is correct
79 Correct 328 ms 6748 KB Output is correct
80 Correct 320 ms 6744 KB Output is correct
81 Correct 303 ms 6748 KB Output is correct
82 Correct 319 ms 6748 KB Output is correct
83 Correct 622 ms 6888 KB Output is correct
84 Correct 552 ms 6748 KB Output is correct
85 Correct 507 ms 6748 KB Output is correct
86 Correct 523 ms 6748 KB Output is correct
87 Correct 527 ms 6748 KB Output is correct
88 Correct 509 ms 6744 KB Output is correct
89 Correct 545 ms 6748 KB Output is correct
90 Correct 551 ms 6744 KB Output is correct
91 Correct 527 ms 6748 KB Output is correct
92 Correct 564 ms 6748 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 113 ms 6748 KB Output is correct
2 Correct 348 ms 6744 KB Output is correct
3 Correct 326 ms 6744 KB Output is correct
4 Correct 326 ms 6748 KB Output is correct
5 Correct 327 ms 6824 KB Output is correct
6 Correct 327 ms 6748 KB Output is correct
7 Correct 341 ms 6744 KB Output is correct
8 Correct 319 ms 6744 KB Output is correct
9 Correct 333 ms 6996 KB Output is correct
10 Correct 321 ms 6748 KB Output is correct
11 Correct 108 ms 6744 KB Output is correct
12 Correct 329 ms 6744 KB Output is correct
13 Correct 321 ms 6772 KB Output is correct
14 Correct 334 ms 6744 KB Output is correct
15 Correct 315 ms 6748 KB Output is correct
16 Correct 326 ms 6748 KB Output is correct
17 Correct 318 ms 6744 KB Output is correct
18 Correct 313 ms 6748 KB Output is correct
19 Correct 337 ms 6748 KB Output is correct
20 Correct 337 ms 6744 KB Output is correct
21 Correct 561 ms 6748 KB Output is correct
22 Correct 541 ms 6748 KB Output is correct
23 Correct 575 ms 6872 KB Output is correct
24 Correct 568 ms 6860 KB Output is correct
25 Correct 550 ms 6748 KB Output is correct
26 Correct 558 ms 6748 KB Output is correct
27 Correct 613 ms 6876 KB Output is correct
28 Correct 565 ms 6876 KB Output is correct
29 Correct 101 ms 6744 KB Output is correct
30 Correct 306 ms 6744 KB Output is correct
31 Correct 308 ms 6748 KB Output is correct
32 Correct 298 ms 6744 KB Output is correct
33 Correct 295 ms 6748 KB Output is correct
34 Correct 304 ms 6992 KB Output is correct
35 Correct 297 ms 6748 KB Output is correct
36 Correct 301 ms 6744 KB Output is correct
37 Correct 303 ms 6748 KB Output is correct
38 Correct 298 ms 6744 KB Output is correct
39 Correct 512 ms 6748 KB Output is correct
40 Correct 506 ms 6872 KB Output is correct
41 Correct 517 ms 6892 KB Output is correct
42 Correct 523 ms 6744 KB Output is correct
43 Correct 526 ms 6888 KB Output is correct
44 Correct 525 ms 6916 KB Output is correct
45 Correct 517 ms 6896 KB Output is correct
46 Correct 547 ms 6996 KB Output is correct
47 Correct 1143 ms 6744 KB Output is correct
48 Correct 1206 ms 6972 KB Output is correct
49 Correct 1262 ms 7028 KB Output is correct
50 Correct 1175 ms 7004 KB Output is correct
51 Correct 1248 ms 7004 KB Output is correct
52 Correct 1262 ms 7036 KB Output is correct
53 Correct 1233 ms 7028 KB Output is correct
54 Correct 1244 ms 7016 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 6748 KB Output is correct
2 Correct 36 ms 6744 KB Output is correct
3 Correct 13 ms 6748 KB Output is correct
4 Correct 105 ms 6748 KB Output is correct
5 Correct 565 ms 6868 KB Output is correct
6 Correct 553 ms 6876 KB Output is correct
7 Correct 545 ms 6748 KB Output is correct
8 Correct 570 ms 6872 KB Output is correct
9 Correct 562 ms 6744 KB Output is correct
10 Correct 563 ms 6744 KB Output is correct
11 Correct 574 ms 6748 KB Output is correct
12 Correct 23 ms 6744 KB Output is correct
13 Correct 37 ms 6748 KB Output is correct
14 Correct 13 ms 6748 KB Output is correct
15 Correct 111 ms 6748 KB Output is correct
16 Correct 555 ms 6748 KB Output is correct
17 Correct 563 ms 6748 KB Output is correct
18 Correct 543 ms 6860 KB Output is correct
19 Correct 581 ms 6872 KB Output is correct
20 Correct 568 ms 6748 KB Output is correct
21 Correct 541 ms 6748 KB Output is correct
22 Correct 546 ms 7000 KB Output is correct
23 Correct 1246 ms 7000 KB Output is correct
24 Correct 1330 ms 7016 KB Output is correct
25 Correct 1239 ms 7004 KB Output is correct
26 Correct 1334 ms 7004 KB Output is correct
27 Correct 1305 ms 7012 KB Output is correct
28 Correct 1232 ms 6936 KB Output is correct
29 Correct 1277 ms 6936 KB Output is correct
30 Correct 113 ms 6748 KB Output is correct
31 Correct 348 ms 6744 KB Output is correct
32 Correct 326 ms 6744 KB Output is correct
33 Correct 326 ms 6748 KB Output is correct
34 Correct 327 ms 6824 KB Output is correct
35 Correct 327 ms 6748 KB Output is correct
36 Correct 341 ms 6744 KB Output is correct
37 Correct 319 ms 6744 KB Output is correct
38 Correct 333 ms 6996 KB Output is correct
39 Correct 321 ms 6748 KB Output is correct
40 Correct 26 ms 6748 KB Output is correct
41 Correct 37 ms 6748 KB Output is correct
42 Correct 13 ms 6748 KB Output is correct
43 Correct 113 ms 6760 KB Output is correct
44 Correct 334 ms 6748 KB Output is correct
45 Correct 325 ms 6812 KB Output is correct
46 Correct 328 ms 6748 KB Output is correct
47 Correct 330 ms 6992 KB Output is correct
48 Correct 346 ms 6748 KB Output is correct
49 Correct 346 ms 6748 KB Output is correct
50 Correct 324 ms 6744 KB Output is correct
51 Correct 338 ms 6748 KB Output is correct
52 Correct 339 ms 6744 KB Output is correct
53 Correct 358 ms 6748 KB Output is correct
54 Correct 346 ms 6820 KB Output is correct
55 Correct 360 ms 6840 KB Output is correct
56 Correct 364 ms 7004 KB Output is correct
57 Correct 353 ms 7000 KB Output is correct
58 Correct 108 ms 6744 KB Output is correct
59 Correct 329 ms 6744 KB Output is correct
60 Correct 321 ms 6772 KB Output is correct
61 Correct 334 ms 6744 KB Output is correct
62 Correct 315 ms 6748 KB Output is correct
63 Correct 326 ms 6748 KB Output is correct
64 Correct 318 ms 6744 KB Output is correct
65 Correct 313 ms 6748 KB Output is correct
66 Correct 337 ms 6748 KB Output is correct
67 Correct 337 ms 6744 KB Output is correct
68 Correct 561 ms 6748 KB Output is correct
69 Correct 541 ms 6748 KB Output is correct
70 Correct 575 ms 6872 KB Output is correct
71 Correct 568 ms 6860 KB Output is correct
72 Correct 550 ms 6748 KB Output is correct
73 Correct 558 ms 6748 KB Output is correct
74 Correct 613 ms 6876 KB Output is correct
75 Correct 565 ms 6876 KB Output is correct
76 Correct 27 ms 6748 KB Output is correct
77 Correct 39 ms 6748 KB Output is correct
78 Correct 15 ms 6744 KB Output is correct
79 Correct 109 ms 6760 KB Output is correct
80 Correct 562 ms 6748 KB Output is correct
81 Correct 570 ms 6748 KB Output is correct
82 Correct 575 ms 6788 KB Output is correct
83 Correct 580 ms 6868 KB Output is correct
84 Correct 580 ms 6748 KB Output is correct
85 Correct 510 ms 6872 KB Output is correct
86 Correct 530 ms 6876 KB Output is correct
87 Correct 306 ms 6744 KB Output is correct
88 Correct 339 ms 6840 KB Output is correct
89 Correct 304 ms 6744 KB Output is correct
90 Correct 305 ms 6996 KB Output is correct
91 Correct 326 ms 6840 KB Output is correct
92 Correct 312 ms 6848 KB Output is correct
93 Correct 304 ms 6836 KB Output is correct
94 Correct 303 ms 6748 KB Output is correct
95 Correct 300 ms 7000 KB Output is correct
96 Correct 330 ms 6748 KB Output is correct
97 Correct 328 ms 6748 KB Output is correct
98 Correct 320 ms 6744 KB Output is correct
99 Correct 303 ms 6748 KB Output is correct
100 Correct 319 ms 6748 KB Output is correct
101 Correct 622 ms 6888 KB Output is correct
102 Correct 552 ms 6748 KB Output is correct
103 Correct 507 ms 6748 KB Output is correct
104 Correct 523 ms 6748 KB Output is correct
105 Correct 527 ms 6748 KB Output is correct
106 Correct 509 ms 6744 KB Output is correct
107 Correct 545 ms 6748 KB Output is correct
108 Correct 551 ms 6744 KB Output is correct
109 Correct 527 ms 6748 KB Output is correct
110 Correct 564 ms 6748 KB Output is correct
111 Correct 101 ms 6744 KB Output is correct
112 Correct 306 ms 6744 KB Output is correct
113 Correct 308 ms 6748 KB Output is correct
114 Correct 298 ms 6744 KB Output is correct
115 Correct 295 ms 6748 KB Output is correct
116 Correct 304 ms 6992 KB Output is correct
117 Correct 297 ms 6748 KB Output is correct
118 Correct 301 ms 6744 KB Output is correct
119 Correct 303 ms 6748 KB Output is correct
120 Correct 298 ms 6744 KB Output is correct
121 Correct 512 ms 6748 KB Output is correct
122 Correct 506 ms 6872 KB Output is correct
123 Correct 517 ms 6892 KB Output is correct
124 Correct 523 ms 6744 KB Output is correct
125 Correct 526 ms 6888 KB Output is correct
126 Correct 525 ms 6916 KB Output is correct
127 Correct 517 ms 6896 KB Output is correct
128 Correct 547 ms 6996 KB Output is correct
129 Correct 1143 ms 6744 KB Output is correct
130 Correct 1206 ms 6972 KB Output is correct
131 Correct 1262 ms 7028 KB Output is correct
132 Correct 1175 ms 7004 KB Output is correct
133 Correct 1248 ms 7004 KB Output is correct
134 Correct 1262 ms 7036 KB Output is correct
135 Correct 1233 ms 7028 KB Output is correct
136 Correct 1244 ms 7016 KB Output is correct
137 Correct 22 ms 6744 KB Output is correct
138 Correct 31 ms 6748 KB Output is correct
139 Correct 11 ms 6796 KB Output is correct
140 Correct 99 ms 6748 KB Output is correct
141 Correct 507 ms 6748 KB Output is correct
142 Correct 536 ms 6748 KB Output is correct
143 Correct 550 ms 7000 KB Output is correct
144 Correct 520 ms 6748 KB Output is correct
145 Correct 514 ms 6888 KB Output is correct
146 Correct 541 ms 6744 KB Output is correct
147 Correct 528 ms 6996 KB Output is correct
148 Correct 1258 ms 7008 KB Output is correct
149 Correct 1321 ms 7016 KB Output is correct
150 Correct 1241 ms 7000 KB Output is correct
151 Correct 1254 ms 7000 KB Output is correct
152 Correct 1205 ms 7000 KB Output is correct
153 Correct 1131 ms 6968 KB Output is correct
154 Correct 1202 ms 6976 KB Output is correct
155 Correct 330 ms 7000 KB Output is correct
156 Correct 324 ms 6748 KB Output is correct
157 Correct 309 ms 6748 KB Output is correct
158 Correct 322 ms 6852 KB Output is correct
159 Correct 313 ms 6744 KB Output is correct
160 Correct 310 ms 6840 KB Output is correct
161 Correct 324 ms 6744 KB Output is correct
162 Correct 301 ms 6840 KB Output is correct
163 Correct 303 ms 6748 KB Output is correct
164 Correct 551 ms 6744 KB Output is correct
165 Correct 527 ms 6748 KB Output is correct
166 Correct 515 ms 6996 KB Output is correct
167 Correct 536 ms 6900 KB Output is correct
168 Correct 545 ms 6900 KB Output is correct
169 Correct 550 ms 6892 KB Output is correct
170 Correct 304 ms 6744 KB Output is correct
171 Correct 307 ms 6744 KB Output is correct
172 Correct 301 ms 6748 KB Output is correct
173 Correct 318 ms 6748 KB Output is correct
174 Correct 313 ms 6864 KB Output is correct
175 Correct 511 ms 6908 KB Output is correct
176 Correct 551 ms 6920 KB Output is correct
177 Correct 527 ms 6744 KB Output is correct
178 Correct 533 ms 6744 KB Output is correct
179 Correct 1213 ms 7024 KB Output is correct
180 Correct 1210 ms 7004 KB Output is correct
181 Correct 1226 ms 7028 KB Output is correct
182 Correct 1251 ms 7032 KB Output is correct
183 Correct 1220 ms 7028 KB Output is correct
184 Correct 1479 ms 7012 KB Output is correct
185 Correct 1400 ms 7000 KB Output is correct
186 Correct 1357 ms 7004 KB Output is correct
187 Correct 1282 ms 7068 KB Output is correct
188 Correct 1260 ms 7068 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 113 ms 6748 KB Output is correct
2 Correct 348 ms 6744 KB Output is correct
3 Correct 326 ms 6744 KB Output is correct
4 Correct 326 ms 6748 KB Output is correct
5 Correct 327 ms 6824 KB Output is correct
6 Correct 327 ms 6748 KB Output is correct
7 Correct 341 ms 6744 KB Output is correct
8 Correct 319 ms 6744 KB Output is correct
9 Correct 333 ms 6996 KB Output is correct
10 Correct 321 ms 6748 KB Output is correct
11 Correct 108 ms 6744 KB Output is correct
12 Correct 329 ms 6744 KB Output is correct
13 Correct 321 ms 6772 KB Output is correct
14 Correct 334 ms 6744 KB Output is correct
15 Correct 315 ms 6748 KB Output is correct
16 Correct 326 ms 6748 KB Output is correct
17 Correct 318 ms 6744 KB Output is correct
18 Correct 313 ms 6748 KB Output is correct
19 Correct 337 ms 6748 KB Output is correct
20 Correct 337 ms 6744 KB Output is correct
21 Correct 561 ms 6748 KB Output is correct
22 Correct 541 ms 6748 KB Output is correct
23 Correct 575 ms 6872 KB Output is correct
24 Correct 568 ms 6860 KB Output is correct
25 Correct 550 ms 6748 KB Output is correct
26 Correct 558 ms 6748 KB Output is correct
27 Correct 613 ms 6876 KB Output is correct
28 Correct 565 ms 6876 KB Output is correct
29 Correct 101 ms 6744 KB Output is correct
30 Correct 306 ms 6744 KB Output is correct
31 Correct 308 ms 6748 KB Output is correct
32 Correct 298 ms 6744 KB Output is correct
33 Correct 295 ms 6748 KB Output is correct
34 Correct 304 ms 6992 KB Output is correct
35 Correct 297 ms 6748 KB Output is correct
36 Correct 301 ms 6744 KB Output is correct
37 Correct 303 ms 6748 KB Output is correct
38 Correct 298 ms 6744 KB Output is correct
39 Correct 512 ms 6748 KB Output is correct
40 Correct 506 ms 6872 KB Output is correct
41 Correct 517 ms 6892 KB Output is correct
42 Correct 523 ms 6744 KB Output is correct
43 Correct 526 ms 6888 KB Output is correct
44 Correct 525 ms 6916 KB Output is correct
45 Correct 517 ms 6896 KB Output is correct
46 Correct 547 ms 6996 KB Output is correct
47 Correct 1143 ms 6744 KB Output is correct
48 Correct 1206 ms 6972 KB Output is correct
49 Correct 1262 ms 7028 KB Output is correct
50 Correct 1175 ms 7004 KB Output is correct
51 Correct 1248 ms 7004 KB Output is correct
52 Correct 1262 ms 7036 KB Output is correct
53 Correct 1233 ms 7028 KB Output is correct
54 Correct 1244 ms 7016 KB Output is correct
55 Correct 105 ms 6748 KB Output is correct
56 Correct 294 ms 6744 KB Output is correct
57 Correct 292 ms 6844 KB Output is correct
58 Correct 291 ms 6748 KB Output is correct
59 Correct 312 ms 6748 KB Output is correct
60 Correct 290 ms 6836 KB Output is correct
61 Correct 302 ms 6744 KB Output is correct
62 Correct 297 ms 6840 KB Output is correct
63 Correct 297 ms 6844 KB Output is correct
64 Correct 292 ms 6748 KB Output is correct
65 Correct 519 ms 6744 KB Output is correct
66 Correct 523 ms 6744 KB Output is correct
67 Correct 543 ms 6748 KB Output is correct
68 Correct 529 ms 6880 KB Output is correct
69 Correct 553 ms 6744 KB Output is correct
70 Correct 544 ms 6744 KB Output is correct
71 Correct 547 ms 6900 KB Output is correct
72 Correct 545 ms 6900 KB Output is correct
73 Correct 1203 ms 7004 KB Output is correct
74 Correct 1124 ms 6748 KB Output is correct
75 Correct 1269 ms 7252 KB Output is correct
76 Correct 1228 ms 7000 KB Output is correct
77 Correct 1261 ms 7028 KB Output is correct
78 Correct 1272 ms 7004 KB Output is correct
79 Correct 1246 ms 7028 KB Output is correct
80 Correct 1192 ms 7000 KB Output is correct
81 Execution timed out 5055 ms 7488 KB Time limit exceeded
82 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 26 ms 6748 KB Output is correct
2 Correct 36 ms 6744 KB Output is correct
3 Correct 13 ms 6748 KB Output is correct
4 Correct 105 ms 6748 KB Output is correct
5 Correct 565 ms 6868 KB Output is correct
6 Correct 553 ms 6876 KB Output is correct
7 Correct 545 ms 6748 KB Output is correct
8 Correct 570 ms 6872 KB Output is correct
9 Correct 562 ms 6744 KB Output is correct
10 Correct 563 ms 6744 KB Output is correct
11 Correct 574 ms 6748 KB Output is correct
12 Correct 23 ms 6744 KB Output is correct
13 Correct 37 ms 6748 KB Output is correct
14 Correct 13 ms 6748 KB Output is correct
15 Correct 111 ms 6748 KB Output is correct
16 Correct 555 ms 6748 KB Output is correct
17 Correct 563 ms 6748 KB Output is correct
18 Correct 543 ms 6860 KB Output is correct
19 Correct 581 ms 6872 KB Output is correct
20 Correct 568 ms 6748 KB Output is correct
21 Correct 541 ms 6748 KB Output is correct
22 Correct 546 ms 7000 KB Output is correct
23 Correct 1246 ms 7000 KB Output is correct
24 Correct 1330 ms 7016 KB Output is correct
25 Correct 1239 ms 7004 KB Output is correct
26 Correct 1334 ms 7004 KB Output is correct
27 Correct 1305 ms 7012 KB Output is correct
28 Correct 1232 ms 6936 KB Output is correct
29 Correct 1277 ms 6936 KB Output is correct
30 Correct 113 ms 6748 KB Output is correct
31 Correct 348 ms 6744 KB Output is correct
32 Correct 326 ms 6744 KB Output is correct
33 Correct 326 ms 6748 KB Output is correct
34 Correct 327 ms 6824 KB Output is correct
35 Correct 327 ms 6748 KB Output is correct
36 Correct 341 ms 6744 KB Output is correct
37 Correct 319 ms 6744 KB Output is correct
38 Correct 333 ms 6996 KB Output is correct
39 Correct 321 ms 6748 KB Output is correct
40 Correct 26 ms 6748 KB Output is correct
41 Correct 37 ms 6748 KB Output is correct
42 Correct 13 ms 6748 KB Output is correct
43 Correct 113 ms 6760 KB Output is correct
44 Correct 334 ms 6748 KB Output is correct
45 Correct 325 ms 6812 KB Output is correct
46 Correct 328 ms 6748 KB Output is correct
47 Correct 330 ms 6992 KB Output is correct
48 Correct 346 ms 6748 KB Output is correct
49 Correct 346 ms 6748 KB Output is correct
50 Correct 324 ms 6744 KB Output is correct
51 Correct 338 ms 6748 KB Output is correct
52 Correct 339 ms 6744 KB Output is correct
53 Correct 358 ms 6748 KB Output is correct
54 Correct 346 ms 6820 KB Output is correct
55 Correct 360 ms 6840 KB Output is correct
56 Correct 364 ms 7004 KB Output is correct
57 Correct 353 ms 7000 KB Output is correct
58 Correct 108 ms 6744 KB Output is correct
59 Correct 329 ms 6744 KB Output is correct
60 Correct 321 ms 6772 KB Output is correct
61 Correct 334 ms 6744 KB Output is correct
62 Correct 315 ms 6748 KB Output is correct
63 Correct 326 ms 6748 KB Output is correct
64 Correct 318 ms 6744 KB Output is correct
65 Correct 313 ms 6748 KB Output is correct
66 Correct 337 ms 6748 KB Output is correct
67 Correct 337 ms 6744 KB Output is correct
68 Correct 561 ms 6748 KB Output is correct
69 Correct 541 ms 6748 KB Output is correct
70 Correct 575 ms 6872 KB Output is correct
71 Correct 568 ms 6860 KB Output is correct
72 Correct 550 ms 6748 KB Output is correct
73 Correct 558 ms 6748 KB Output is correct
74 Correct 613 ms 6876 KB Output is correct
75 Correct 565 ms 6876 KB Output is correct
76 Correct 27 ms 6748 KB Output is correct
77 Correct 39 ms 6748 KB Output is correct
78 Correct 15 ms 6744 KB Output is correct
79 Correct 109 ms 6760 KB Output is correct
80 Correct 562 ms 6748 KB Output is correct
81 Correct 570 ms 6748 KB Output is correct
82 Correct 575 ms 6788 KB Output is correct
83 Correct 580 ms 6868 KB Output is correct
84 Correct 580 ms 6748 KB Output is correct
85 Correct 510 ms 6872 KB Output is correct
86 Correct 530 ms 6876 KB Output is correct
87 Correct 306 ms 6744 KB Output is correct
88 Correct 339 ms 6840 KB Output is correct
89 Correct 304 ms 6744 KB Output is correct
90 Correct 305 ms 6996 KB Output is correct
91 Correct 326 ms 6840 KB Output is correct
92 Correct 312 ms 6848 KB Output is correct
93 Correct 304 ms 6836 KB Output is correct
94 Correct 303 ms 6748 KB Output is correct
95 Correct 300 ms 7000 KB Output is correct
96 Correct 330 ms 6748 KB Output is correct
97 Correct 328 ms 6748 KB Output is correct
98 Correct 320 ms 6744 KB Output is correct
99 Correct 303 ms 6748 KB Output is correct
100 Correct 319 ms 6748 KB Output is correct
101 Correct 622 ms 6888 KB Output is correct
102 Correct 552 ms 6748 KB Output is correct
103 Correct 507 ms 6748 KB Output is correct
104 Correct 523 ms 6748 KB Output is correct
105 Correct 527 ms 6748 KB Output is correct
106 Correct 509 ms 6744 KB Output is correct
107 Correct 545 ms 6748 KB Output is correct
108 Correct 551 ms 6744 KB Output is correct
109 Correct 527 ms 6748 KB Output is correct
110 Correct 564 ms 6748 KB Output is correct
111 Correct 101 ms 6744 KB Output is correct
112 Correct 306 ms 6744 KB Output is correct
113 Correct 308 ms 6748 KB Output is correct
114 Correct 298 ms 6744 KB Output is correct
115 Correct 295 ms 6748 KB Output is correct
116 Correct 304 ms 6992 KB Output is correct
117 Correct 297 ms 6748 KB Output is correct
118 Correct 301 ms 6744 KB Output is correct
119 Correct 303 ms 6748 KB Output is correct
120 Correct 298 ms 6744 KB Output is correct
121 Correct 512 ms 6748 KB Output is correct
122 Correct 506 ms 6872 KB Output is correct
123 Correct 517 ms 6892 KB Output is correct
124 Correct 523 ms 6744 KB Output is correct
125 Correct 526 ms 6888 KB Output is correct
126 Correct 525 ms 6916 KB Output is correct
127 Correct 517 ms 6896 KB Output is correct
128 Correct 547 ms 6996 KB Output is correct
129 Correct 1143 ms 6744 KB Output is correct
130 Correct 1206 ms 6972 KB Output is correct
131 Correct 1262 ms 7028 KB Output is correct
132 Correct 1175 ms 7004 KB Output is correct
133 Correct 1248 ms 7004 KB Output is correct
134 Correct 1262 ms 7036 KB Output is correct
135 Correct 1233 ms 7028 KB Output is correct
136 Correct 1244 ms 7016 KB Output is correct
137 Correct 22 ms 6744 KB Output is correct
138 Correct 31 ms 6748 KB Output is correct
139 Correct 11 ms 6796 KB Output is correct
140 Correct 99 ms 6748 KB Output is correct
141 Correct 507 ms 6748 KB Output is correct
142 Correct 536 ms 6748 KB Output is correct
143 Correct 550 ms 7000 KB Output is correct
144 Correct 520 ms 6748 KB Output is correct
145 Correct 514 ms 6888 KB Output is correct
146 Correct 541 ms 6744 KB Output is correct
147 Correct 528 ms 6996 KB Output is correct
148 Correct 1258 ms 7008 KB Output is correct
149 Correct 1321 ms 7016 KB Output is correct
150 Correct 1241 ms 7000 KB Output is correct
151 Correct 1254 ms 7000 KB Output is correct
152 Correct 1205 ms 7000 KB Output is correct
153 Correct 1131 ms 6968 KB Output is correct
154 Correct 1202 ms 6976 KB Output is correct
155 Correct 330 ms 7000 KB Output is correct
156 Correct 324 ms 6748 KB Output is correct
157 Correct 309 ms 6748 KB Output is correct
158 Correct 322 ms 6852 KB Output is correct
159 Correct 313 ms 6744 KB Output is correct
160 Correct 310 ms 6840 KB Output is correct
161 Correct 324 ms 6744 KB Output is correct
162 Correct 301 ms 6840 KB Output is correct
163 Correct 303 ms 6748 KB Output is correct
164 Correct 551 ms 6744 KB Output is correct
165 Correct 527 ms 6748 KB Output is correct
166 Correct 515 ms 6996 KB Output is correct
167 Correct 536 ms 6900 KB Output is correct
168 Correct 545 ms 6900 KB Output is correct
169 Correct 550 ms 6892 KB Output is correct
170 Correct 304 ms 6744 KB Output is correct
171 Correct 307 ms 6744 KB Output is correct
172 Correct 301 ms 6748 KB Output is correct
173 Correct 318 ms 6748 KB Output is correct
174 Correct 313 ms 6864 KB Output is correct
175 Correct 511 ms 6908 KB Output is correct
176 Correct 551 ms 6920 KB Output is correct
177 Correct 527 ms 6744 KB Output is correct
178 Correct 533 ms 6744 KB Output is correct
179 Correct 1213 ms 7024 KB Output is correct
180 Correct 1210 ms 7004 KB Output is correct
181 Correct 1226 ms 7028 KB Output is correct
182 Correct 1251 ms 7032 KB Output is correct
183 Correct 1220 ms 7028 KB Output is correct
184 Correct 1479 ms 7012 KB Output is correct
185 Correct 1400 ms 7000 KB Output is correct
186 Correct 1357 ms 7004 KB Output is correct
187 Correct 1282 ms 7068 KB Output is correct
188 Correct 1260 ms 7068 KB Output is correct
189 Correct 105 ms 6748 KB Output is correct
190 Correct 294 ms 6744 KB Output is correct
191 Correct 292 ms 6844 KB Output is correct
192 Correct 291 ms 6748 KB Output is correct
193 Correct 312 ms 6748 KB Output is correct
194 Correct 290 ms 6836 KB Output is correct
195 Correct 302 ms 6744 KB Output is correct
196 Correct 297 ms 6840 KB Output is correct
197 Correct 297 ms 6844 KB Output is correct
198 Correct 292 ms 6748 KB Output is correct
199 Correct 519 ms 6744 KB Output is correct
200 Correct 523 ms 6744 KB Output is correct
201 Correct 543 ms 6748 KB Output is correct
202 Correct 529 ms 6880 KB Output is correct
203 Correct 553 ms 6744 KB Output is correct
204 Correct 544 ms 6744 KB Output is correct
205 Correct 547 ms 6900 KB Output is correct
206 Correct 545 ms 6900 KB Output is correct
207 Correct 1203 ms 7004 KB Output is correct
208 Correct 1124 ms 6748 KB Output is correct
209 Correct 1269 ms 7252 KB Output is correct
210 Correct 1228 ms 7000 KB Output is correct
211 Correct 1261 ms 7028 KB Output is correct
212 Correct 1272 ms 7004 KB Output is correct
213 Correct 1246 ms 7028 KB Output is correct
214 Correct 1192 ms 7000 KB Output is correct
215 Execution timed out 5055 ms 7488 KB Time limit exceeded
216 Halted 0 ms 0 KB -