Submission #745228

# Submission time Handle Problem Language Result Execution time Memory
745228 2023-05-19T15:11:47 Z 박상훈(#9964) Uplifting Excursion (BOI22_vault) C++17
55 / 100
5000 ms 13780 KB
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
constexpr int SFT = 90090;
int n;
ll L, a[1010], b[1010];
bitset<180180> dp[2][606];

ll getmin(ll v, bool flag = 0){
	ll ret = 0;
	for (int i=-n;i<=n;i++){
		ret += (ll)i * min(v, a[i+n]);
		if (flag) b[i+n] = min(v, a[i+n]);
		v -= min(v, a[i+n]);
	}
	return ret;
}

ll getmax(ll v, bool flag = 0){
	ll ret = 0;
	for (int i=n;i>=-n;i--){
		ret += (ll)i * min(v, a[i+n]);
		if (flag) b[i+n] = min(v, a[i+n]);
		v -= min(v, a[i+n]);
	}
	return ret;
}

void NO(){
	printf("impossible\n");
	exit(0);
}

void solve(ll v){
	ll mn = getmin(v), mx = getmax(v);
	if (abs(mn-L) > n && abs(mx-L) > n) assert(0);
	if (abs(mn-L) <= n){
		reverse(a, a+n*2+1);
		L = -L;
		mn = getmin(v), mx = getmax(v);
		if (abs(mn-L) > n && abs(mx-L) > n) assert(0);
	}
	getmax(v, 1);

	int z = 0;
	ll r = n+2;
	
	//init
	dp[0][0][0+SFT] = 1;

	for (int i=n;i>=-n;i--){
		if (b[i+n] > 0){
			for (int j=1;j<=min(b[i+n], r);j++){
				z ^= 1;
				for (int p=-1;p<r;p++){
					
					if (p+1 < j) dp[z][p+1] = dp[z^1][p+1];
					else if (i>=0) dp[z][p+1] = dp[z^1][p+1] | (dp[z^1][p] << i);
					else dp[z][p+1] = dp[z^1][p+1] | (dp[z^1][p] >> (-i));
					
				}
			}
		}

		if (b[i+n] < a[i+n]){
			for (int j=1;j<=min(a[i+n]-b[i+n], r);j++){
				z ^= 1;
				for (int p=1;p<=r+1;p++){
					
					if (r-p+1 < j) dp[z][p-1] = dp[z^1][p-1];
					else if (i>=0) dp[z][p-1] = dp[z^1][p-1] | (dp[z^1][p] >> i);
					else dp[z][p-1] = dp[z^1][p-1] | (dp[z^1][p] << (-i));
					
				}
			}
		}
	}

	ll need = mx - L;
	for (int i=0;i<=r;i++) if (dp[z][i][need+SFT]){
		printf("%lld\n", v-i);
		return;
	}
	NO();
}

int main(){
	scanf("%d %lld", &n, &L);

	ll mS = 0, pS = 0, S = 0;
	for (int i=0;i<=n*2;i++){
		scanf("%lld", a+i);
		S += a[i];
		if (i-n < 0) mS += a[i];
		else if (i-n > 0) pS += a[i];
	} 

	// printf("%lld %lld %lld %lld\n", mS, pS, getmin(mS), getmax(pS));
	if (L < getmin(mS)) NO();
	if (L > getmax(pS)) NO();

	ll l = mS, r = S, vmn = mS;
	while(l<=r){
		ll mid = (l+r)/2;
		if (getmin(mid) <= L) vmn = mid, l = mid+1;
		else r = mid-1;
	}

	l = pS, r = S;
	ll vmx = pS;
	while(l<=r){
		ll mid = (l+r)/2;
		if (getmax(mid) >= L) vmx = mid, l = mid+1;
		else r = mid-1;
	}

	ll v = min(vmn, vmx); // [v+1, S]는 불가능
	// printf("%lld(%lld, %lld) -> %lld %lld\n", v, vmn, vmx, getmin(v), getmax(v));
	if (!(getmin(v) <= L) || !(getmax(v) >= L)) NO();
	solve(v);
}

Compilation message

vault.cpp: In function 'int main()':
vault.cpp:89:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   89 |  scanf("%d %lld", &n, &L);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~
vault.cpp:93:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   93 |   scanf("%lld", a+i);
      |   ~~~~~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 596 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 1 ms 596 KB Output is correct
4 Correct 4 ms 980 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 677 ms 2732 KB Output is correct
7 Correct 284 ms 2732 KB Output is correct
8 Correct 701 ms 2736 KB Output is correct
9 Correct 1144 ms 2732 KB Output is correct
10 Correct 36 ms 2760 KB Output is correct
11 Correct 24 ms 2736 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 596 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 1 ms 596 KB Output is correct
4 Correct 4 ms 980 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 677 ms 2732 KB Output is correct
7 Correct 284 ms 2732 KB Output is correct
8 Correct 701 ms 2736 KB Output is correct
9 Correct 1144 ms 2732 KB Output is correct
10 Correct 36 ms 2760 KB Output is correct
11 Correct 24 ms 2736 KB Output is correct
12 Correct 1 ms 596 KB Output is correct
13 Correct 1 ms 596 KB Output is correct
14 Correct 1 ms 596 KB Output is correct
15 Correct 5 ms 980 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 726 ms 2740 KB Output is correct
18 Correct 282 ms 2692 KB Output is correct
19 Correct 691 ms 2736 KB Output is correct
20 Correct 1008 ms 2736 KB Output is correct
21 Correct 26 ms 2752 KB Output is correct
22 Correct 24 ms 2760 KB Output is correct
23 Correct 1 ms 212 KB Output is correct
24 Execution timed out 5093 ms 4948 KB Time limit exceeded
25 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 13 ms 980 KB Output is correct
2 Correct 90 ms 1876 KB Output is correct
3 Correct 26 ms 1876 KB Output is correct
4 Correct 107 ms 1856 KB Output is correct
5 Correct 118 ms 1748 KB Output is correct
6 Correct 87 ms 1876 KB Output is correct
7 Correct 42 ms 1748 KB Output is correct
8 Correct 13 ms 1876 KB Output is correct
9 Correct 45 ms 1748 KB Output is correct
10 Correct 65 ms 1876 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 13 ms 980 KB Output is correct
2 Correct 90 ms 1876 KB Output is correct
3 Correct 26 ms 1876 KB Output is correct
4 Correct 107 ms 1856 KB Output is correct
5 Correct 118 ms 1748 KB Output is correct
6 Correct 87 ms 1876 KB Output is correct
7 Correct 42 ms 1748 KB Output is correct
8 Correct 13 ms 1876 KB Output is correct
9 Correct 45 ms 1748 KB Output is correct
10 Correct 65 ms 1876 KB Output is correct
11 Correct 1 ms 596 KB Output is correct
12 Correct 2 ms 596 KB Output is correct
13 Correct 1 ms 596 KB Output is correct
14 Correct 5 ms 980 KB Output is correct
15 Correct 89 ms 1852 KB Output is correct
16 Correct 30 ms 1748 KB Output is correct
17 Correct 101 ms 1856 KB Output is correct
18 Correct 119 ms 1876 KB Output is correct
19 Correct 92 ms 1876 KB Output is correct
20 Correct 15 ms 1876 KB Output is correct
21 Correct 13 ms 1876 KB Output is correct
22 Correct 54 ms 1856 KB Output is correct
23 Correct 66 ms 1748 KB Output is correct
24 Correct 172 ms 1876 KB Output is correct
25 Correct 99 ms 1876 KB Output is correct
26 Correct 270 ms 1856 KB Output is correct
27 Correct 179 ms 1856 KB Output is correct
28 Correct 222 ms 1876 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 13 ms 980 KB Output is correct
2 Correct 90 ms 1876 KB Output is correct
3 Correct 26 ms 1876 KB Output is correct
4 Correct 107 ms 1856 KB Output is correct
5 Correct 118 ms 1748 KB Output is correct
6 Correct 87 ms 1876 KB Output is correct
7 Correct 42 ms 1748 KB Output is correct
8 Correct 13 ms 1876 KB Output is correct
9 Correct 45 ms 1748 KB Output is correct
10 Correct 65 ms 1876 KB Output is correct
11 Correct 5 ms 980 KB Output is correct
12 Correct 132 ms 1868 KB Output is correct
13 Correct 28 ms 1876 KB Output is correct
14 Correct 121 ms 1856 KB Output is correct
15 Correct 129 ms 1876 KB Output is correct
16 Correct 90 ms 1748 KB Output is correct
17 Correct 20 ms 1880 KB Output is correct
18 Correct 32 ms 1856 KB Output is correct
19 Correct 43 ms 1748 KB Output is correct
20 Correct 71 ms 1856 KB Output is correct
21 Correct 23 ms 2756 KB Output is correct
22 Correct 23 ms 2644 KB Output is correct
23 Correct 370 ms 2800 KB Output is correct
24 Correct 171 ms 2644 KB Output is correct
25 Correct 362 ms 2736 KB Output is correct
26 Correct 515 ms 2740 KB Output is correct
27 Correct 406 ms 2732 KB Output is correct
28 Correct 449 ms 2740 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 596 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 1 ms 596 KB Output is correct
4 Correct 4 ms 980 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 677 ms 2732 KB Output is correct
7 Correct 284 ms 2732 KB Output is correct
8 Correct 701 ms 2736 KB Output is correct
9 Correct 1144 ms 2732 KB Output is correct
10 Correct 36 ms 2760 KB Output is correct
11 Correct 24 ms 2736 KB Output is correct
12 Correct 13 ms 980 KB Output is correct
13 Correct 90 ms 1876 KB Output is correct
14 Correct 26 ms 1876 KB Output is correct
15 Correct 107 ms 1856 KB Output is correct
16 Correct 118 ms 1748 KB Output is correct
17 Correct 87 ms 1876 KB Output is correct
18 Correct 42 ms 1748 KB Output is correct
19 Correct 13 ms 1876 KB Output is correct
20 Correct 45 ms 1748 KB Output is correct
21 Correct 65 ms 1876 KB Output is correct
22 Correct 1 ms 596 KB Output is correct
23 Correct 2 ms 596 KB Output is correct
24 Correct 1 ms 596 KB Output is correct
25 Correct 5 ms 980 KB Output is correct
26 Correct 89 ms 1852 KB Output is correct
27 Correct 30 ms 1748 KB Output is correct
28 Correct 101 ms 1856 KB Output is correct
29 Correct 119 ms 1876 KB Output is correct
30 Correct 92 ms 1876 KB Output is correct
31 Correct 15 ms 1876 KB Output is correct
32 Correct 13 ms 1876 KB Output is correct
33 Correct 54 ms 1856 KB Output is correct
34 Correct 66 ms 1748 KB Output is correct
35 Correct 172 ms 1876 KB Output is correct
36 Correct 99 ms 1876 KB Output is correct
37 Correct 270 ms 1856 KB Output is correct
38 Correct 179 ms 1856 KB Output is correct
39 Correct 222 ms 1876 KB Output is correct
40 Correct 5 ms 980 KB Output is correct
41 Correct 132 ms 1868 KB Output is correct
42 Correct 28 ms 1876 KB Output is correct
43 Correct 121 ms 1856 KB Output is correct
44 Correct 129 ms 1876 KB Output is correct
45 Correct 90 ms 1748 KB Output is correct
46 Correct 20 ms 1880 KB Output is correct
47 Correct 32 ms 1856 KB Output is correct
48 Correct 43 ms 1748 KB Output is correct
49 Correct 71 ms 1856 KB Output is correct
50 Correct 23 ms 2756 KB Output is correct
51 Correct 23 ms 2644 KB Output is correct
52 Correct 370 ms 2800 KB Output is correct
53 Correct 171 ms 2644 KB Output is correct
54 Correct 362 ms 2736 KB Output is correct
55 Correct 515 ms 2740 KB Output is correct
56 Correct 406 ms 2732 KB Output is correct
57 Correct 449 ms 2740 KB Output is correct
58 Correct 1 ms 596 KB Output is correct
59 Correct 1 ms 596 KB Output is correct
60 Correct 1 ms 596 KB Output is correct
61 Correct 5 ms 980 KB Output is correct
62 Correct 0 ms 212 KB Output is correct
63 Correct 663 ms 2740 KB Output is correct
64 Correct 300 ms 2740 KB Output is correct
65 Correct 700 ms 2740 KB Output is correct
66 Correct 1102 ms 2736 KB Output is correct
67 Correct 33 ms 2644 KB Output is correct
68 Correct 23 ms 2664 KB Output is correct
69 Correct 105 ms 1876 KB Output is correct
70 Correct 25 ms 1876 KB Output is correct
71 Correct 101 ms 1856 KB Output is correct
72 Correct 184 ms 1876 KB Output is correct
73 Correct 85 ms 1856 KB Output is correct
74 Correct 15 ms 1880 KB Output is correct
75 Correct 14 ms 1876 KB Output is correct
76 Correct 64 ms 1876 KB Output is correct
77 Correct 63 ms 1856 KB Output is correct
78 Correct 186 ms 1856 KB Output is correct
79 Correct 80 ms 1748 KB Output is correct
80 Correct 218 ms 1852 KB Output is correct
81 Correct 177 ms 1876 KB Output is correct
82 Correct 301 ms 1856 KB Output is correct
83 Correct 405 ms 2764 KB Output is correct
84 Correct 180 ms 2752 KB Output is correct
85 Correct 363 ms 2736 KB Output is correct
86 Correct 535 ms 2736 KB Output is correct
87 Correct 446 ms 2740 KB Output is correct
88 Correct 596 ms 2740 KB Output is correct
89 Correct 757 ms 2740 KB Output is correct
90 Correct 982 ms 2736 KB Output is correct
91 Correct 702 ms 2748 KB Output is correct
92 Correct 777 ms 2740 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 13 ms 980 KB Output is correct
2 Correct 90 ms 1876 KB Output is correct
3 Correct 26 ms 1876 KB Output is correct
4 Correct 107 ms 1856 KB Output is correct
5 Correct 118 ms 1748 KB Output is correct
6 Correct 87 ms 1876 KB Output is correct
7 Correct 42 ms 1748 KB Output is correct
8 Correct 13 ms 1876 KB Output is correct
9 Correct 45 ms 1748 KB Output is correct
10 Correct 65 ms 1876 KB Output is correct
11 Correct 5 ms 980 KB Output is correct
12 Correct 132 ms 1868 KB Output is correct
13 Correct 28 ms 1876 KB Output is correct
14 Correct 121 ms 1856 KB Output is correct
15 Correct 129 ms 1876 KB Output is correct
16 Correct 90 ms 1748 KB Output is correct
17 Correct 20 ms 1880 KB Output is correct
18 Correct 32 ms 1856 KB Output is correct
19 Correct 43 ms 1748 KB Output is correct
20 Correct 71 ms 1856 KB Output is correct
21 Correct 23 ms 2756 KB Output is correct
22 Correct 23 ms 2644 KB Output is correct
23 Correct 370 ms 2800 KB Output is correct
24 Correct 171 ms 2644 KB Output is correct
25 Correct 362 ms 2736 KB Output is correct
26 Correct 515 ms 2740 KB Output is correct
27 Correct 406 ms 2732 KB Output is correct
28 Correct 449 ms 2740 KB Output is correct
29 Correct 4 ms 980 KB Output is correct
30 Correct 89 ms 1852 KB Output is correct
31 Correct 24 ms 1880 KB Output is correct
32 Correct 97 ms 1876 KB Output is correct
33 Correct 138 ms 1876 KB Output is correct
34 Correct 93 ms 1876 KB Output is correct
35 Correct 23 ms 1876 KB Output is correct
36 Correct 12 ms 1880 KB Output is correct
37 Correct 42 ms 1748 KB Output is correct
38 Correct 61 ms 1748 KB Output is correct
39 Correct 24 ms 2760 KB Output is correct
40 Correct 23 ms 2756 KB Output is correct
41 Correct 390 ms 2736 KB Output is correct
42 Correct 169 ms 2736 KB Output is correct
43 Correct 365 ms 2736 KB Output is correct
44 Correct 508 ms 2644 KB Output is correct
45 Correct 413 ms 2764 KB Output is correct
46 Correct 319 ms 2644 KB Output is correct
47 Correct 117 ms 4948 KB Output is correct
48 Correct 105 ms 4948 KB Output is correct
49 Correct 2866 ms 4948 KB Output is correct
50 Correct 1271 ms 4948 KB Output is correct
51 Correct 3150 ms 4952 KB Output is correct
52 Correct 3951 ms 4948 KB Output is correct
53 Correct 3229 ms 4948 KB Output is correct
54 Correct 2339 ms 4952 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 596 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 1 ms 596 KB Output is correct
4 Correct 4 ms 980 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 677 ms 2732 KB Output is correct
7 Correct 284 ms 2732 KB Output is correct
8 Correct 701 ms 2736 KB Output is correct
9 Correct 1144 ms 2732 KB Output is correct
10 Correct 36 ms 2760 KB Output is correct
11 Correct 24 ms 2736 KB Output is correct
12 Correct 1 ms 596 KB Output is correct
13 Correct 1 ms 596 KB Output is correct
14 Correct 1 ms 596 KB Output is correct
15 Correct 5 ms 980 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 726 ms 2740 KB Output is correct
18 Correct 282 ms 2692 KB Output is correct
19 Correct 691 ms 2736 KB Output is correct
20 Correct 1008 ms 2736 KB Output is correct
21 Correct 26 ms 2752 KB Output is correct
22 Correct 24 ms 2760 KB Output is correct
23 Correct 1 ms 212 KB Output is correct
24 Execution timed out 5093 ms 4948 KB Time limit exceeded
25 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 13 ms 980 KB Output is correct
2 Correct 90 ms 1876 KB Output is correct
3 Correct 26 ms 1876 KB Output is correct
4 Correct 107 ms 1856 KB Output is correct
5 Correct 118 ms 1748 KB Output is correct
6 Correct 87 ms 1876 KB Output is correct
7 Correct 42 ms 1748 KB Output is correct
8 Correct 13 ms 1876 KB Output is correct
9 Correct 45 ms 1748 KB Output is correct
10 Correct 65 ms 1876 KB Output is correct
11 Correct 5 ms 980 KB Output is correct
12 Correct 132 ms 1868 KB Output is correct
13 Correct 28 ms 1876 KB Output is correct
14 Correct 121 ms 1856 KB Output is correct
15 Correct 129 ms 1876 KB Output is correct
16 Correct 90 ms 1748 KB Output is correct
17 Correct 20 ms 1880 KB Output is correct
18 Correct 32 ms 1856 KB Output is correct
19 Correct 43 ms 1748 KB Output is correct
20 Correct 71 ms 1856 KB Output is correct
21 Correct 23 ms 2756 KB Output is correct
22 Correct 23 ms 2644 KB Output is correct
23 Correct 370 ms 2800 KB Output is correct
24 Correct 171 ms 2644 KB Output is correct
25 Correct 362 ms 2736 KB Output is correct
26 Correct 515 ms 2740 KB Output is correct
27 Correct 406 ms 2732 KB Output is correct
28 Correct 449 ms 2740 KB Output is correct
29 Correct 4 ms 980 KB Output is correct
30 Correct 89 ms 1852 KB Output is correct
31 Correct 24 ms 1880 KB Output is correct
32 Correct 97 ms 1876 KB Output is correct
33 Correct 138 ms 1876 KB Output is correct
34 Correct 93 ms 1876 KB Output is correct
35 Correct 23 ms 1876 KB Output is correct
36 Correct 12 ms 1880 KB Output is correct
37 Correct 42 ms 1748 KB Output is correct
38 Correct 61 ms 1748 KB Output is correct
39 Correct 24 ms 2760 KB Output is correct
40 Correct 23 ms 2756 KB Output is correct
41 Correct 390 ms 2736 KB Output is correct
42 Correct 169 ms 2736 KB Output is correct
43 Correct 365 ms 2736 KB Output is correct
44 Correct 508 ms 2644 KB Output is correct
45 Correct 413 ms 2764 KB Output is correct
46 Correct 319 ms 2644 KB Output is correct
47 Correct 117 ms 4948 KB Output is correct
48 Correct 105 ms 4948 KB Output is correct
49 Correct 2866 ms 4948 KB Output is correct
50 Correct 1271 ms 4948 KB Output is correct
51 Correct 3150 ms 4952 KB Output is correct
52 Correct 3951 ms 4948 KB Output is correct
53 Correct 3229 ms 4948 KB Output is correct
54 Correct 2339 ms 4952 KB Output is correct
55 Correct 4 ms 980 KB Output is correct
56 Correct 85 ms 1876 KB Output is correct
57 Correct 26 ms 1876 KB Output is correct
58 Correct 97 ms 1876 KB Output is correct
59 Correct 112 ms 1876 KB Output is correct
60 Correct 89 ms 1876 KB Output is correct
61 Correct 14 ms 1876 KB Output is correct
62 Correct 14 ms 1896 KB Output is correct
63 Correct 47 ms 1748 KB Output is correct
64 Correct 64 ms 1840 KB Output is correct
65 Correct 24 ms 2644 KB Output is correct
66 Correct 23 ms 2644 KB Output is correct
67 Correct 352 ms 2740 KB Output is correct
68 Correct 188 ms 2764 KB Output is correct
69 Correct 355 ms 2740 KB Output is correct
70 Correct 504 ms 2740 KB Output is correct
71 Correct 393 ms 2764 KB Output is correct
72 Correct 296 ms 2748 KB Output is correct
73 Correct 100 ms 4948 KB Output is correct
74 Correct 104 ms 4948 KB Output is correct
75 Correct 2724 ms 4952 KB Output is correct
76 Correct 1378 ms 4948 KB Output is correct
77 Correct 3251 ms 4952 KB Output is correct
78 Correct 3794 ms 4952 KB Output is correct
79 Correct 2729 ms 4944 KB Output is correct
80 Correct 2232 ms 4952 KB Output is correct
81 Execution timed out 5051 ms 13780 KB Time limit exceeded
82 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 596 KB Output is correct
2 Correct 1 ms 596 KB Output is correct
3 Correct 1 ms 596 KB Output is correct
4 Correct 4 ms 980 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 677 ms 2732 KB Output is correct
7 Correct 284 ms 2732 KB Output is correct
8 Correct 701 ms 2736 KB Output is correct
9 Correct 1144 ms 2732 KB Output is correct
10 Correct 36 ms 2760 KB Output is correct
11 Correct 24 ms 2736 KB Output is correct
12 Correct 1 ms 596 KB Output is correct
13 Correct 1 ms 596 KB Output is correct
14 Correct 1 ms 596 KB Output is correct
15 Correct 5 ms 980 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 726 ms 2740 KB Output is correct
18 Correct 282 ms 2692 KB Output is correct
19 Correct 691 ms 2736 KB Output is correct
20 Correct 1008 ms 2736 KB Output is correct
21 Correct 26 ms 2752 KB Output is correct
22 Correct 24 ms 2760 KB Output is correct
23 Correct 1 ms 212 KB Output is correct
24 Execution timed out 5093 ms 4948 KB Time limit exceeded
25 Halted 0 ms 0 KB -