Submission #1070917

# Submission time Handle Problem Language Result Execution time Memory
1070917 2024-08-22T20:47:50 Z AdamGS Uplifting Excursion (BOI22_vault) C++17
80 / 100
4157 ms 35784 KB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
const ll INF=1e18+7;
const ll LIM=1e6+7;
ll dp[LIM], dp2[LIM], A[LIM], B[LIM];
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
	ll n, m;
	cin >> n >> m;
	rep(i, n) cin >> A[n-i];
	rep(i, n+1) cin >> B[i];
	ll ans=0;
	rep(i, n+1) ans+=B[i];
	rep(i, n+1) ans+=A[i];
	rep(i, n+1) m+=A[i]*(ll)i;
	rep(i, n+1) m-=B[i]*(ll)i;
	if(m<0) {
		m*=-1;
		rep(i, n+1) swap(A[i], B[i]);
	}
	rep(i, LIM) dp[i]=INF;
	dp[0]=0;
  int ile=1;
	for(ll i=n; i; --i) {
		if(m>=LIM/2) {
			ll p=m-LIM/2;
			p=(p+i-1)/i;
			p=min(p, max(A[i]-100/ile, 0ll));
			A[i]-=p;
		if(A[i]) ++ile;
          
          dp[0]+=p;
			m-=p*i;	
		}
	}
	if(m>=LIM) {
		cout << "impossible\n";
		return 0;
	}
	rep(xd, 2) {
		for(ll i=1; i<=n; ++i) if(A[i]) {
			vector<ll>V[i], l(i);
			rep(j, LIM) {
				ll p=j%i;
				while(l[p]<V[p].size() && (j-V[p][l[p]])/i>A[i]) ++l[p];
				while(V[p].size()>0 && dp[j]<=dp[V[p].back()]+(j-V[p].back())/i) {
					V[p].pop_back();
					l[p]=min(l[p], (ll)V[p].size());
				}
				dp2[j]=dp[j];
				if(l[p]<V[p].size()) {
					dp2[j]=min(dp2[j], dp[V[p][l[p]]]+(j-V[p][l[p]])/i);
				}
				V[p].pb(j);
			}
			rep(j, LIM) dp[j]=dp2[j];
		}
		rep(i, LIM/2) swap(dp[i], dp[LIM-i-1]);
		rep(i, n+1) swap(A[i], B[i]);
	}
	if(dp[m]==INF) {
		cout << "impossible\n";
		return 0;
	}
	cout << ans-dp[m] << '\n';
}

Compilation message

vault.cpp: In function 'int main()':
vault.cpp:51:15: warning: comparison of integer expressions of different signedness: '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   51 |     while(l[p]<V[p].size() && (j-V[p][l[p]])/i>A[i]) ++l[p];
vault.cpp:57:12: warning: comparison of integer expressions of different signedness: '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   57 |     if(l[p]<V[p].size()) {
# Verdict Execution time Memory Grader output
1 Correct 40 ms 19036 KB Output is correct
2 Correct 29 ms 19036 KB Output is correct
3 Correct 13 ms 19172 KB Output is correct
4 Correct 91 ms 19036 KB Output is correct
5 Correct 3 ms 10840 KB Output is correct
6 Correct 978 ms 19500 KB Output is correct
7 Correct 431 ms 19272 KB Output is correct
8 Correct 942 ms 19492 KB Output is correct
9 Correct 975 ms 19576 KB Output is correct
10 Correct 23 ms 19036 KB Output is correct
11 Correct 46 ms 19268 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 40 ms 19036 KB Output is correct
2 Correct 29 ms 19036 KB Output is correct
3 Correct 13 ms 19172 KB Output is correct
4 Correct 91 ms 19036 KB Output is correct
5 Correct 3 ms 10840 KB Output is correct
6 Correct 978 ms 19500 KB Output is correct
7 Correct 431 ms 19272 KB Output is correct
8 Correct 942 ms 19492 KB Output is correct
9 Correct 975 ms 19576 KB Output is correct
10 Correct 23 ms 19036 KB Output is correct
11 Correct 46 ms 19268 KB Output is correct
12 Correct 44 ms 19036 KB Output is correct
13 Correct 31 ms 19036 KB Output is correct
14 Correct 13 ms 19032 KB Output is correct
15 Correct 92 ms 19036 KB Output is correct
16 Correct 2 ms 10844 KB Output is correct
17 Correct 957 ms 19512 KB Output is correct
18 Correct 438 ms 19268 KB Output is correct
19 Correct 964 ms 19496 KB Output is correct
20 Correct 980 ms 19580 KB Output is correct
21 Correct 23 ms 19032 KB Output is correct
22 Correct 51 ms 19036 KB Output is correct
23 Correct 3 ms 10844 KB Output is correct
24 Correct 2035 ms 20880 KB Output is correct
25 Correct 793 ms 19696 KB Output is correct
26 Correct 2065 ms 22212 KB Output is correct
27 Correct 2095 ms 22100 KB Output is correct
28 Correct 23 ms 19036 KB Output is correct
29 Correct 47 ms 19032 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 96 ms 19036 KB Output is correct
2 Correct 410 ms 23128 KB Output is correct
3 Correct 119 ms 26236 KB Output is correct
4 Correct 465 ms 31780 KB Output is correct
5 Correct 453 ms 31496 KB Output is correct
6 Correct 557 ms 32544 KB Output is correct
7 Correct 28 ms 19548 KB Output is correct
8 Correct 51 ms 19032 KB Output is correct
9 Correct 317 ms 32636 KB Output is correct
10 Correct 306 ms 26268 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 96 ms 19036 KB Output is correct
2 Correct 410 ms 23128 KB Output is correct
3 Correct 119 ms 26236 KB Output is correct
4 Correct 465 ms 31780 KB Output is correct
5 Correct 453 ms 31496 KB Output is correct
6 Correct 557 ms 32544 KB Output is correct
7 Correct 28 ms 19548 KB Output is correct
8 Correct 51 ms 19032 KB Output is correct
9 Correct 317 ms 32636 KB Output is correct
10 Correct 306 ms 26268 KB Output is correct
11 Correct 45 ms 19036 KB Output is correct
12 Correct 33 ms 19036 KB Output is correct
13 Correct 15 ms 19036 KB Output is correct
14 Correct 103 ms 19264 KB Output is correct
15 Correct 446 ms 23156 KB Output is correct
16 Correct 116 ms 26240 KB Output is correct
17 Correct 476 ms 31860 KB Output is correct
18 Correct 449 ms 31480 KB Output is correct
19 Correct 571 ms 32688 KB Output is correct
20 Correct 24 ms 19548 KB Output is correct
21 Correct 48 ms 19248 KB Output is correct
22 Correct 296 ms 32484 KB Output is correct
23 Correct 311 ms 26216 KB Output is correct
24 Correct 643 ms 25288 KB Output is correct
25 Correct 243 ms 25308 KB Output is correct
26 Correct 741 ms 31856 KB Output is correct
27 Correct 639 ms 31368 KB Output is correct
28 Correct 742 ms 32516 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 96 ms 19036 KB Output is correct
2 Correct 410 ms 23128 KB Output is correct
3 Correct 119 ms 26236 KB Output is correct
4 Correct 465 ms 31780 KB Output is correct
5 Correct 453 ms 31496 KB Output is correct
6 Correct 557 ms 32544 KB Output is correct
7 Correct 28 ms 19548 KB Output is correct
8 Correct 51 ms 19032 KB Output is correct
9 Correct 317 ms 32636 KB Output is correct
10 Correct 306 ms 26268 KB Output is correct
11 Correct 92 ms 19032 KB Output is correct
12 Correct 405 ms 23152 KB Output is correct
13 Correct 122 ms 26244 KB Output is correct
14 Correct 456 ms 31776 KB Output is correct
15 Correct 435 ms 31532 KB Output is correct
16 Correct 534 ms 32548 KB Output is correct
17 Correct 23 ms 19548 KB Output is correct
18 Correct 48 ms 19264 KB Output is correct
19 Correct 287 ms 33572 KB Output is correct
20 Correct 289 ms 26124 KB Output is correct
21 Correct 21 ms 19032 KB Output is correct
22 Correct 47 ms 19260 KB Output is correct
23 Correct 688 ms 28896 KB Output is correct
24 Correct 295 ms 31712 KB Output is correct
25 Correct 705 ms 33520 KB Output is correct
26 Correct 733 ms 31812 KB Output is correct
27 Correct 820 ms 32544 KB Output is correct
28 Correct 517 ms 25012 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 40 ms 19036 KB Output is correct
2 Correct 29 ms 19036 KB Output is correct
3 Correct 13 ms 19172 KB Output is correct
4 Correct 91 ms 19036 KB Output is correct
5 Correct 3 ms 10840 KB Output is correct
6 Correct 978 ms 19500 KB Output is correct
7 Correct 431 ms 19272 KB Output is correct
8 Correct 942 ms 19492 KB Output is correct
9 Correct 975 ms 19576 KB Output is correct
10 Correct 23 ms 19036 KB Output is correct
11 Correct 46 ms 19268 KB Output is correct
12 Correct 96 ms 19036 KB Output is correct
13 Correct 410 ms 23128 KB Output is correct
14 Correct 119 ms 26236 KB Output is correct
15 Correct 465 ms 31780 KB Output is correct
16 Correct 453 ms 31496 KB Output is correct
17 Correct 557 ms 32544 KB Output is correct
18 Correct 28 ms 19548 KB Output is correct
19 Correct 51 ms 19032 KB Output is correct
20 Correct 317 ms 32636 KB Output is correct
21 Correct 306 ms 26268 KB Output is correct
22 Correct 45 ms 19036 KB Output is correct
23 Correct 33 ms 19036 KB Output is correct
24 Correct 15 ms 19036 KB Output is correct
25 Correct 103 ms 19264 KB Output is correct
26 Correct 446 ms 23156 KB Output is correct
27 Correct 116 ms 26240 KB Output is correct
28 Correct 476 ms 31860 KB Output is correct
29 Correct 449 ms 31480 KB Output is correct
30 Correct 571 ms 32688 KB Output is correct
31 Correct 24 ms 19548 KB Output is correct
32 Correct 48 ms 19248 KB Output is correct
33 Correct 296 ms 32484 KB Output is correct
34 Correct 311 ms 26216 KB Output is correct
35 Correct 643 ms 25288 KB Output is correct
36 Correct 243 ms 25308 KB Output is correct
37 Correct 741 ms 31856 KB Output is correct
38 Correct 639 ms 31368 KB Output is correct
39 Correct 742 ms 32516 KB Output is correct
40 Correct 92 ms 19032 KB Output is correct
41 Correct 405 ms 23152 KB Output is correct
42 Correct 122 ms 26244 KB Output is correct
43 Correct 456 ms 31776 KB Output is correct
44 Correct 435 ms 31532 KB Output is correct
45 Correct 534 ms 32548 KB Output is correct
46 Correct 23 ms 19548 KB Output is correct
47 Correct 48 ms 19264 KB Output is correct
48 Correct 287 ms 33572 KB Output is correct
49 Correct 289 ms 26124 KB Output is correct
50 Correct 21 ms 19032 KB Output is correct
51 Correct 47 ms 19260 KB Output is correct
52 Correct 688 ms 28896 KB Output is correct
53 Correct 295 ms 31712 KB Output is correct
54 Correct 705 ms 33520 KB Output is correct
55 Correct 733 ms 31812 KB Output is correct
56 Correct 820 ms 32544 KB Output is correct
57 Correct 517 ms 25012 KB Output is correct
58 Correct 39 ms 19032 KB Output is correct
59 Correct 30 ms 19032 KB Output is correct
60 Correct 13 ms 19272 KB Output is correct
61 Correct 89 ms 19036 KB Output is correct
62 Correct 2 ms 10840 KB Output is correct
63 Correct 906 ms 19500 KB Output is correct
64 Correct 402 ms 19400 KB Output is correct
65 Correct 904 ms 19508 KB Output is correct
66 Correct 935 ms 19588 KB Output is correct
67 Correct 22 ms 19036 KB Output is correct
68 Correct 47 ms 19036 KB Output is correct
69 Correct 402 ms 23128 KB Output is correct
70 Correct 112 ms 26224 KB Output is correct
71 Correct 444 ms 31780 KB Output is correct
72 Correct 421 ms 31496 KB Output is correct
73 Correct 517 ms 35584 KB Output is correct
74 Correct 23 ms 19428 KB Output is correct
75 Correct 48 ms 19036 KB Output is correct
76 Correct 277 ms 32552 KB Output is correct
77 Correct 285 ms 26208 KB Output is correct
78 Correct 608 ms 25292 KB Output is correct
79 Correct 232 ms 25288 KB Output is correct
80 Correct 707 ms 31904 KB Output is correct
81 Correct 632 ms 31376 KB Output is correct
82 Correct 717 ms 33400 KB Output is correct
83 Correct 678 ms 28876 KB Output is correct
84 Correct 292 ms 31696 KB Output is correct
85 Correct 704 ms 34840 KB Output is correct
86 Correct 737 ms 31864 KB Output is correct
87 Correct 863 ms 32536 KB Output is correct
88 Correct 527 ms 25020 KB Output is correct
89 Correct 1047 ms 25964 KB Output is correct
90 Correct 1067 ms 29040 KB Output is correct
91 Correct 1035 ms 33828 KB Output is correct
92 Correct 1234 ms 35608 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 96 ms 19036 KB Output is correct
2 Correct 410 ms 23128 KB Output is correct
3 Correct 119 ms 26236 KB Output is correct
4 Correct 465 ms 31780 KB Output is correct
5 Correct 453 ms 31496 KB Output is correct
6 Correct 557 ms 32544 KB Output is correct
7 Correct 28 ms 19548 KB Output is correct
8 Correct 51 ms 19032 KB Output is correct
9 Correct 317 ms 32636 KB Output is correct
10 Correct 306 ms 26268 KB Output is correct
11 Correct 92 ms 19032 KB Output is correct
12 Correct 405 ms 23152 KB Output is correct
13 Correct 122 ms 26244 KB Output is correct
14 Correct 456 ms 31776 KB Output is correct
15 Correct 435 ms 31532 KB Output is correct
16 Correct 534 ms 32548 KB Output is correct
17 Correct 23 ms 19548 KB Output is correct
18 Correct 48 ms 19264 KB Output is correct
19 Correct 287 ms 33572 KB Output is correct
20 Correct 289 ms 26124 KB Output is correct
21 Correct 21 ms 19032 KB Output is correct
22 Correct 47 ms 19260 KB Output is correct
23 Correct 688 ms 28896 KB Output is correct
24 Correct 295 ms 31712 KB Output is correct
25 Correct 705 ms 33520 KB Output is correct
26 Correct 733 ms 31812 KB Output is correct
27 Correct 820 ms 32544 KB Output is correct
28 Correct 517 ms 25012 KB Output is correct
29 Correct 90 ms 19036 KB Output is correct
30 Correct 402 ms 23124 KB Output is correct
31 Correct 116 ms 26228 KB Output is correct
32 Correct 447 ms 31756 KB Output is correct
33 Correct 421 ms 31472 KB Output is correct
34 Correct 511 ms 32976 KB Output is correct
35 Correct 23 ms 19292 KB Output is correct
36 Correct 49 ms 19036 KB Output is correct
37 Correct 287 ms 32548 KB Output is correct
38 Correct 288 ms 26224 KB Output is correct
39 Correct 22 ms 19032 KB Output is correct
40 Correct 46 ms 19252 KB Output is correct
41 Correct 689 ms 28892 KB Output is correct
42 Correct 292 ms 31692 KB Output is correct
43 Correct 704 ms 32544 KB Output is correct
44 Correct 735 ms 31892 KB Output is correct
45 Correct 856 ms 33896 KB Output is correct
46 Correct 523 ms 25060 KB Output is correct
47 Correct 23 ms 19032 KB Output is correct
48 Correct 45 ms 19036 KB Output is correct
49 Correct 1384 ms 33572 KB Output is correct
50 Correct 572 ms 23632 KB Output is correct
51 Correct 1380 ms 33280 KB Output is correct
52 Correct 1427 ms 31972 KB Output is correct
53 Correct 1665 ms 35620 KB Output is correct
54 Correct 1181 ms 26292 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 40 ms 19036 KB Output is correct
2 Correct 29 ms 19036 KB Output is correct
3 Correct 13 ms 19172 KB Output is correct
4 Correct 91 ms 19036 KB Output is correct
5 Correct 3 ms 10840 KB Output is correct
6 Correct 978 ms 19500 KB Output is correct
7 Correct 431 ms 19272 KB Output is correct
8 Correct 942 ms 19492 KB Output is correct
9 Correct 975 ms 19576 KB Output is correct
10 Correct 23 ms 19036 KB Output is correct
11 Correct 46 ms 19268 KB Output is correct
12 Correct 44 ms 19036 KB Output is correct
13 Correct 31 ms 19036 KB Output is correct
14 Correct 13 ms 19032 KB Output is correct
15 Correct 92 ms 19036 KB Output is correct
16 Correct 2 ms 10844 KB Output is correct
17 Correct 957 ms 19512 KB Output is correct
18 Correct 438 ms 19268 KB Output is correct
19 Correct 964 ms 19496 KB Output is correct
20 Correct 980 ms 19580 KB Output is correct
21 Correct 23 ms 19032 KB Output is correct
22 Correct 51 ms 19036 KB Output is correct
23 Correct 3 ms 10844 KB Output is correct
24 Correct 2035 ms 20880 KB Output is correct
25 Correct 793 ms 19696 KB Output is correct
26 Correct 2065 ms 22212 KB Output is correct
27 Correct 2095 ms 22100 KB Output is correct
28 Correct 23 ms 19036 KB Output is correct
29 Correct 47 ms 19032 KB Output is correct
30 Correct 96 ms 19036 KB Output is correct
31 Correct 410 ms 23128 KB Output is correct
32 Correct 119 ms 26236 KB Output is correct
33 Correct 465 ms 31780 KB Output is correct
34 Correct 453 ms 31496 KB Output is correct
35 Correct 557 ms 32544 KB Output is correct
36 Correct 28 ms 19548 KB Output is correct
37 Correct 51 ms 19032 KB Output is correct
38 Correct 317 ms 32636 KB Output is correct
39 Correct 306 ms 26268 KB Output is correct
40 Correct 45 ms 19036 KB Output is correct
41 Correct 33 ms 19036 KB Output is correct
42 Correct 15 ms 19036 KB Output is correct
43 Correct 103 ms 19264 KB Output is correct
44 Correct 446 ms 23156 KB Output is correct
45 Correct 116 ms 26240 KB Output is correct
46 Correct 476 ms 31860 KB Output is correct
47 Correct 449 ms 31480 KB Output is correct
48 Correct 571 ms 32688 KB Output is correct
49 Correct 24 ms 19548 KB Output is correct
50 Correct 48 ms 19248 KB Output is correct
51 Correct 296 ms 32484 KB Output is correct
52 Correct 311 ms 26216 KB Output is correct
53 Correct 643 ms 25288 KB Output is correct
54 Correct 243 ms 25308 KB Output is correct
55 Correct 741 ms 31856 KB Output is correct
56 Correct 639 ms 31368 KB Output is correct
57 Correct 742 ms 32516 KB Output is correct
58 Correct 92 ms 19032 KB Output is correct
59 Correct 405 ms 23152 KB Output is correct
60 Correct 122 ms 26244 KB Output is correct
61 Correct 456 ms 31776 KB Output is correct
62 Correct 435 ms 31532 KB Output is correct
63 Correct 534 ms 32548 KB Output is correct
64 Correct 23 ms 19548 KB Output is correct
65 Correct 48 ms 19264 KB Output is correct
66 Correct 287 ms 33572 KB Output is correct
67 Correct 289 ms 26124 KB Output is correct
68 Correct 21 ms 19032 KB Output is correct
69 Correct 47 ms 19260 KB Output is correct
70 Correct 688 ms 28896 KB Output is correct
71 Correct 295 ms 31712 KB Output is correct
72 Correct 705 ms 33520 KB Output is correct
73 Correct 733 ms 31812 KB Output is correct
74 Correct 820 ms 32544 KB Output is correct
75 Correct 517 ms 25012 KB Output is correct
76 Correct 39 ms 19032 KB Output is correct
77 Correct 30 ms 19032 KB Output is correct
78 Correct 13 ms 19272 KB Output is correct
79 Correct 89 ms 19036 KB Output is correct
80 Correct 2 ms 10840 KB Output is correct
81 Correct 906 ms 19500 KB Output is correct
82 Correct 402 ms 19400 KB Output is correct
83 Correct 904 ms 19508 KB Output is correct
84 Correct 935 ms 19588 KB Output is correct
85 Correct 22 ms 19036 KB Output is correct
86 Correct 47 ms 19036 KB Output is correct
87 Correct 402 ms 23128 KB Output is correct
88 Correct 112 ms 26224 KB Output is correct
89 Correct 444 ms 31780 KB Output is correct
90 Correct 421 ms 31496 KB Output is correct
91 Correct 517 ms 35584 KB Output is correct
92 Correct 23 ms 19428 KB Output is correct
93 Correct 48 ms 19036 KB Output is correct
94 Correct 277 ms 32552 KB Output is correct
95 Correct 285 ms 26208 KB Output is correct
96 Correct 608 ms 25292 KB Output is correct
97 Correct 232 ms 25288 KB Output is correct
98 Correct 707 ms 31904 KB Output is correct
99 Correct 632 ms 31376 KB Output is correct
100 Correct 717 ms 33400 KB Output is correct
101 Correct 678 ms 28876 KB Output is correct
102 Correct 292 ms 31696 KB Output is correct
103 Correct 704 ms 34840 KB Output is correct
104 Correct 737 ms 31864 KB Output is correct
105 Correct 863 ms 32536 KB Output is correct
106 Correct 527 ms 25020 KB Output is correct
107 Correct 1047 ms 25964 KB Output is correct
108 Correct 1067 ms 29040 KB Output is correct
109 Correct 1035 ms 33828 KB Output is correct
110 Correct 1234 ms 35608 KB Output is correct
111 Correct 90 ms 19036 KB Output is correct
112 Correct 402 ms 23124 KB Output is correct
113 Correct 116 ms 26228 KB Output is correct
114 Correct 447 ms 31756 KB Output is correct
115 Correct 421 ms 31472 KB Output is correct
116 Correct 511 ms 32976 KB Output is correct
117 Correct 23 ms 19292 KB Output is correct
118 Correct 49 ms 19036 KB Output is correct
119 Correct 287 ms 32548 KB Output is correct
120 Correct 288 ms 26224 KB Output is correct
121 Correct 22 ms 19032 KB Output is correct
122 Correct 46 ms 19252 KB Output is correct
123 Correct 689 ms 28892 KB Output is correct
124 Correct 292 ms 31692 KB Output is correct
125 Correct 704 ms 32544 KB Output is correct
126 Correct 735 ms 31892 KB Output is correct
127 Correct 856 ms 33896 KB Output is correct
128 Correct 523 ms 25060 KB Output is correct
129 Correct 23 ms 19032 KB Output is correct
130 Correct 45 ms 19036 KB Output is correct
131 Correct 1384 ms 33572 KB Output is correct
132 Correct 572 ms 23632 KB Output is correct
133 Correct 1380 ms 33280 KB Output is correct
134 Correct 1427 ms 31972 KB Output is correct
135 Correct 1665 ms 35620 KB Output is correct
136 Correct 1181 ms 26292 KB Output is correct
137 Correct 39 ms 19036 KB Output is correct
138 Correct 32 ms 19276 KB Output is correct
139 Correct 13 ms 19272 KB Output is correct
140 Correct 89 ms 19036 KB Output is correct
141 Correct 2 ms 10844 KB Output is correct
142 Correct 909 ms 19504 KB Output is correct
143 Correct 410 ms 19276 KB Output is correct
144 Correct 905 ms 19480 KB Output is correct
145 Correct 923 ms 19592 KB Output is correct
146 Correct 24 ms 19032 KB Output is correct
147 Correct 45 ms 19032 KB Output is correct
148 Correct 2 ms 10840 KB Output is correct
149 Correct 1911 ms 20876 KB Output is correct
150 Correct 762 ms 19696 KB Output is correct
151 Correct 1968 ms 22248 KB Output is correct
152 Correct 1976 ms 22116 KB Output is correct
153 Correct 22 ms 19036 KB Output is correct
154 Correct 45 ms 19036 KB Output is correct
155 Correct 397 ms 23132 KB Output is correct
156 Correct 113 ms 26236 KB Output is correct
157 Correct 435 ms 31712 KB Output is correct
158 Correct 421 ms 31512 KB Output is correct
159 Correct 515 ms 34488 KB Output is correct
160 Correct 23 ms 19292 KB Output is correct
161 Correct 49 ms 19276 KB Output is correct
162 Correct 281 ms 34072 KB Output is correct
163 Correct 293 ms 26212 KB Output is correct
164 Correct 674 ms 28876 KB Output is correct
165 Correct 306 ms 31700 KB Output is correct
166 Correct 712 ms 33788 KB Output is correct
167 Correct 728 ms 31796 KB Output is correct
168 Correct 890 ms 33864 KB Output is correct
169 Correct 538 ms 25012 KB Output is correct
170 Correct 632 ms 25308 KB Output is correct
171 Correct 238 ms 25312 KB Output is correct
172 Correct 724 ms 32064 KB Output is correct
173 Correct 634 ms 31380 KB Output is correct
174 Correct 714 ms 32548 KB Output is correct
175 Correct 1060 ms 25952 KB Output is correct
176 Correct 1088 ms 29048 KB Output is correct
177 Correct 1064 ms 34592 KB Output is correct
178 Correct 1235 ms 32888 KB Output is correct
179 Correct 1370 ms 35360 KB Output is correct
180 Correct 579 ms 23664 KB Output is correct
181 Correct 1385 ms 32620 KB Output is correct
182 Correct 1430 ms 31280 KB Output is correct
183 Correct 1635 ms 32596 KB Output is correct
184 Correct 1150 ms 26312 KB Output is correct
185 Correct 2062 ms 31708 KB Output is correct
186 Correct 2133 ms 31216 KB Output is correct
187 Correct 2382 ms 31900 KB Output is correct
188 Correct 2408 ms 34576 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 96 ms 19036 KB Output is correct
2 Correct 410 ms 23128 KB Output is correct
3 Correct 119 ms 26236 KB Output is correct
4 Correct 465 ms 31780 KB Output is correct
5 Correct 453 ms 31496 KB Output is correct
6 Correct 557 ms 32544 KB Output is correct
7 Correct 28 ms 19548 KB Output is correct
8 Correct 51 ms 19032 KB Output is correct
9 Correct 317 ms 32636 KB Output is correct
10 Correct 306 ms 26268 KB Output is correct
11 Correct 92 ms 19032 KB Output is correct
12 Correct 405 ms 23152 KB Output is correct
13 Correct 122 ms 26244 KB Output is correct
14 Correct 456 ms 31776 KB Output is correct
15 Correct 435 ms 31532 KB Output is correct
16 Correct 534 ms 32548 KB Output is correct
17 Correct 23 ms 19548 KB Output is correct
18 Correct 48 ms 19264 KB Output is correct
19 Correct 287 ms 33572 KB Output is correct
20 Correct 289 ms 26124 KB Output is correct
21 Correct 21 ms 19032 KB Output is correct
22 Correct 47 ms 19260 KB Output is correct
23 Correct 688 ms 28896 KB Output is correct
24 Correct 295 ms 31712 KB Output is correct
25 Correct 705 ms 33520 KB Output is correct
26 Correct 733 ms 31812 KB Output is correct
27 Correct 820 ms 32544 KB Output is correct
28 Correct 517 ms 25012 KB Output is correct
29 Correct 90 ms 19036 KB Output is correct
30 Correct 402 ms 23124 KB Output is correct
31 Correct 116 ms 26228 KB Output is correct
32 Correct 447 ms 31756 KB Output is correct
33 Correct 421 ms 31472 KB Output is correct
34 Correct 511 ms 32976 KB Output is correct
35 Correct 23 ms 19292 KB Output is correct
36 Correct 49 ms 19036 KB Output is correct
37 Correct 287 ms 32548 KB Output is correct
38 Correct 288 ms 26224 KB Output is correct
39 Correct 22 ms 19032 KB Output is correct
40 Correct 46 ms 19252 KB Output is correct
41 Correct 689 ms 28892 KB Output is correct
42 Correct 292 ms 31692 KB Output is correct
43 Correct 704 ms 32544 KB Output is correct
44 Correct 735 ms 31892 KB Output is correct
45 Correct 856 ms 33896 KB Output is correct
46 Correct 523 ms 25060 KB Output is correct
47 Correct 23 ms 19032 KB Output is correct
48 Correct 45 ms 19036 KB Output is correct
49 Correct 1384 ms 33572 KB Output is correct
50 Correct 572 ms 23632 KB Output is correct
51 Correct 1380 ms 33280 KB Output is correct
52 Correct 1427 ms 31972 KB Output is correct
53 Correct 1665 ms 35620 KB Output is correct
54 Correct 1181 ms 26292 KB Output is correct
55 Correct 89 ms 19288 KB Output is correct
56 Correct 395 ms 23128 KB Output is correct
57 Correct 112 ms 25996 KB Output is correct
58 Correct 441 ms 31792 KB Output is correct
59 Correct 424 ms 31508 KB Output is correct
60 Correct 535 ms 32808 KB Output is correct
61 Correct 23 ms 19548 KB Output is correct
62 Correct 48 ms 19032 KB Output is correct
63 Correct 281 ms 34376 KB Output is correct
64 Correct 283 ms 26248 KB Output is correct
65 Correct 23 ms 19032 KB Output is correct
66 Correct 46 ms 19036 KB Output is correct
67 Correct 684 ms 28868 KB Output is correct
68 Correct 293 ms 31644 KB Output is correct
69 Correct 725 ms 32656 KB Output is correct
70 Correct 729 ms 35784 KB Output is correct
71 Correct 832 ms 33052 KB Output is correct
72 Correct 514 ms 25056 KB Output is correct
73 Correct 21 ms 19036 KB Output is correct
74 Correct 46 ms 19036 KB Output is correct
75 Correct 1346 ms 32640 KB Output is correct
76 Correct 569 ms 23576 KB Output is correct
77 Correct 1381 ms 34956 KB Output is correct
78 Correct 1438 ms 31080 KB Output is correct
79 Correct 1715 ms 34120 KB Output is correct
80 Correct 1164 ms 26296 KB Output is correct
81 Correct 4094 ms 30148 KB Output is correct
82 Correct 1896 ms 22952 KB Output is correct
83 Correct 4157 ms 33352 KB Output is correct
84 Correct 3839 ms 35448 KB Output is correct
85 Incorrect 23 ms 19292 KB Output isn't correct
86 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 40 ms 19036 KB Output is correct
2 Correct 29 ms 19036 KB Output is correct
3 Correct 13 ms 19172 KB Output is correct
4 Correct 91 ms 19036 KB Output is correct
5 Correct 3 ms 10840 KB Output is correct
6 Correct 978 ms 19500 KB Output is correct
7 Correct 431 ms 19272 KB Output is correct
8 Correct 942 ms 19492 KB Output is correct
9 Correct 975 ms 19576 KB Output is correct
10 Correct 23 ms 19036 KB Output is correct
11 Correct 46 ms 19268 KB Output is correct
12 Correct 44 ms 19036 KB Output is correct
13 Correct 31 ms 19036 KB Output is correct
14 Correct 13 ms 19032 KB Output is correct
15 Correct 92 ms 19036 KB Output is correct
16 Correct 2 ms 10844 KB Output is correct
17 Correct 957 ms 19512 KB Output is correct
18 Correct 438 ms 19268 KB Output is correct
19 Correct 964 ms 19496 KB Output is correct
20 Correct 980 ms 19580 KB Output is correct
21 Correct 23 ms 19032 KB Output is correct
22 Correct 51 ms 19036 KB Output is correct
23 Correct 3 ms 10844 KB Output is correct
24 Correct 2035 ms 20880 KB Output is correct
25 Correct 793 ms 19696 KB Output is correct
26 Correct 2065 ms 22212 KB Output is correct
27 Correct 2095 ms 22100 KB Output is correct
28 Correct 23 ms 19036 KB Output is correct
29 Correct 47 ms 19032 KB Output is correct
30 Correct 96 ms 19036 KB Output is correct
31 Correct 410 ms 23128 KB Output is correct
32 Correct 119 ms 26236 KB Output is correct
33 Correct 465 ms 31780 KB Output is correct
34 Correct 453 ms 31496 KB Output is correct
35 Correct 557 ms 32544 KB Output is correct
36 Correct 28 ms 19548 KB Output is correct
37 Correct 51 ms 19032 KB Output is correct
38 Correct 317 ms 32636 KB Output is correct
39 Correct 306 ms 26268 KB Output is correct
40 Correct 45 ms 19036 KB Output is correct
41 Correct 33 ms 19036 KB Output is correct
42 Correct 15 ms 19036 KB Output is correct
43 Correct 103 ms 19264 KB Output is correct
44 Correct 446 ms 23156 KB Output is correct
45 Correct 116 ms 26240 KB Output is correct
46 Correct 476 ms 31860 KB Output is correct
47 Correct 449 ms 31480 KB Output is correct
48 Correct 571 ms 32688 KB Output is correct
49 Correct 24 ms 19548 KB Output is correct
50 Correct 48 ms 19248 KB Output is correct
51 Correct 296 ms 32484 KB Output is correct
52 Correct 311 ms 26216 KB Output is correct
53 Correct 643 ms 25288 KB Output is correct
54 Correct 243 ms 25308 KB Output is correct
55 Correct 741 ms 31856 KB Output is correct
56 Correct 639 ms 31368 KB Output is correct
57 Correct 742 ms 32516 KB Output is correct
58 Correct 92 ms 19032 KB Output is correct
59 Correct 405 ms 23152 KB Output is correct
60 Correct 122 ms 26244 KB Output is correct
61 Correct 456 ms 31776 KB Output is correct
62 Correct 435 ms 31532 KB Output is correct
63 Correct 534 ms 32548 KB Output is correct
64 Correct 23 ms 19548 KB Output is correct
65 Correct 48 ms 19264 KB Output is correct
66 Correct 287 ms 33572 KB Output is correct
67 Correct 289 ms 26124 KB Output is correct
68 Correct 21 ms 19032 KB Output is correct
69 Correct 47 ms 19260 KB Output is correct
70 Correct 688 ms 28896 KB Output is correct
71 Correct 295 ms 31712 KB Output is correct
72 Correct 705 ms 33520 KB Output is correct
73 Correct 733 ms 31812 KB Output is correct
74 Correct 820 ms 32544 KB Output is correct
75 Correct 517 ms 25012 KB Output is correct
76 Correct 39 ms 19032 KB Output is correct
77 Correct 30 ms 19032 KB Output is correct
78 Correct 13 ms 19272 KB Output is correct
79 Correct 89 ms 19036 KB Output is correct
80 Correct 2 ms 10840 KB Output is correct
81 Correct 906 ms 19500 KB Output is correct
82 Correct 402 ms 19400 KB Output is correct
83 Correct 904 ms 19508 KB Output is correct
84 Correct 935 ms 19588 KB Output is correct
85 Correct 22 ms 19036 KB Output is correct
86 Correct 47 ms 19036 KB Output is correct
87 Correct 402 ms 23128 KB Output is correct
88 Correct 112 ms 26224 KB Output is correct
89 Correct 444 ms 31780 KB Output is correct
90 Correct 421 ms 31496 KB Output is correct
91 Correct 517 ms 35584 KB Output is correct
92 Correct 23 ms 19428 KB Output is correct
93 Correct 48 ms 19036 KB Output is correct
94 Correct 277 ms 32552 KB Output is correct
95 Correct 285 ms 26208 KB Output is correct
96 Correct 608 ms 25292 KB Output is correct
97 Correct 232 ms 25288 KB Output is correct
98 Correct 707 ms 31904 KB Output is correct
99 Correct 632 ms 31376 KB Output is correct
100 Correct 717 ms 33400 KB Output is correct
101 Correct 678 ms 28876 KB Output is correct
102 Correct 292 ms 31696 KB Output is correct
103 Correct 704 ms 34840 KB Output is correct
104 Correct 737 ms 31864 KB Output is correct
105 Correct 863 ms 32536 KB Output is correct
106 Correct 527 ms 25020 KB Output is correct
107 Correct 1047 ms 25964 KB Output is correct
108 Correct 1067 ms 29040 KB Output is correct
109 Correct 1035 ms 33828 KB Output is correct
110 Correct 1234 ms 35608 KB Output is correct
111 Correct 90 ms 19036 KB Output is correct
112 Correct 402 ms 23124 KB Output is correct
113 Correct 116 ms 26228 KB Output is correct
114 Correct 447 ms 31756 KB Output is correct
115 Correct 421 ms 31472 KB Output is correct
116 Correct 511 ms 32976 KB Output is correct
117 Correct 23 ms 19292 KB Output is correct
118 Correct 49 ms 19036 KB Output is correct
119 Correct 287 ms 32548 KB Output is correct
120 Correct 288 ms 26224 KB Output is correct
121 Correct 22 ms 19032 KB Output is correct
122 Correct 46 ms 19252 KB Output is correct
123 Correct 689 ms 28892 KB Output is correct
124 Correct 292 ms 31692 KB Output is correct
125 Correct 704 ms 32544 KB Output is correct
126 Correct 735 ms 31892 KB Output is correct
127 Correct 856 ms 33896 KB Output is correct
128 Correct 523 ms 25060 KB Output is correct
129 Correct 23 ms 19032 KB Output is correct
130 Correct 45 ms 19036 KB Output is correct
131 Correct 1384 ms 33572 KB Output is correct
132 Correct 572 ms 23632 KB Output is correct
133 Correct 1380 ms 33280 KB Output is correct
134 Correct 1427 ms 31972 KB Output is correct
135 Correct 1665 ms 35620 KB Output is correct
136 Correct 1181 ms 26292 KB Output is correct
137 Correct 39 ms 19036 KB Output is correct
138 Correct 32 ms 19276 KB Output is correct
139 Correct 13 ms 19272 KB Output is correct
140 Correct 89 ms 19036 KB Output is correct
141 Correct 2 ms 10844 KB Output is correct
142 Correct 909 ms 19504 KB Output is correct
143 Correct 410 ms 19276 KB Output is correct
144 Correct 905 ms 19480 KB Output is correct
145 Correct 923 ms 19592 KB Output is correct
146 Correct 24 ms 19032 KB Output is correct
147 Correct 45 ms 19032 KB Output is correct
148 Correct 2 ms 10840 KB Output is correct
149 Correct 1911 ms 20876 KB Output is correct
150 Correct 762 ms 19696 KB Output is correct
151 Correct 1968 ms 22248 KB Output is correct
152 Correct 1976 ms 22116 KB Output is correct
153 Correct 22 ms 19036 KB Output is correct
154 Correct 45 ms 19036 KB Output is correct
155 Correct 397 ms 23132 KB Output is correct
156 Correct 113 ms 26236 KB Output is correct
157 Correct 435 ms 31712 KB Output is correct
158 Correct 421 ms 31512 KB Output is correct
159 Correct 515 ms 34488 KB Output is correct
160 Correct 23 ms 19292 KB Output is correct
161 Correct 49 ms 19276 KB Output is correct
162 Correct 281 ms 34072 KB Output is correct
163 Correct 293 ms 26212 KB Output is correct
164 Correct 674 ms 28876 KB Output is correct
165 Correct 306 ms 31700 KB Output is correct
166 Correct 712 ms 33788 KB Output is correct
167 Correct 728 ms 31796 KB Output is correct
168 Correct 890 ms 33864 KB Output is correct
169 Correct 538 ms 25012 KB Output is correct
170 Correct 632 ms 25308 KB Output is correct
171 Correct 238 ms 25312 KB Output is correct
172 Correct 724 ms 32064 KB Output is correct
173 Correct 634 ms 31380 KB Output is correct
174 Correct 714 ms 32548 KB Output is correct
175 Correct 1060 ms 25952 KB Output is correct
176 Correct 1088 ms 29048 KB Output is correct
177 Correct 1064 ms 34592 KB Output is correct
178 Correct 1235 ms 32888 KB Output is correct
179 Correct 1370 ms 35360 KB Output is correct
180 Correct 579 ms 23664 KB Output is correct
181 Correct 1385 ms 32620 KB Output is correct
182 Correct 1430 ms 31280 KB Output is correct
183 Correct 1635 ms 32596 KB Output is correct
184 Correct 1150 ms 26312 KB Output is correct
185 Correct 2062 ms 31708 KB Output is correct
186 Correct 2133 ms 31216 KB Output is correct
187 Correct 2382 ms 31900 KB Output is correct
188 Correct 2408 ms 34576 KB Output is correct
189 Correct 89 ms 19288 KB Output is correct
190 Correct 395 ms 23128 KB Output is correct
191 Correct 112 ms 25996 KB Output is correct
192 Correct 441 ms 31792 KB Output is correct
193 Correct 424 ms 31508 KB Output is correct
194 Correct 535 ms 32808 KB Output is correct
195 Correct 23 ms 19548 KB Output is correct
196 Correct 48 ms 19032 KB Output is correct
197 Correct 281 ms 34376 KB Output is correct
198 Correct 283 ms 26248 KB Output is correct
199 Correct 23 ms 19032 KB Output is correct
200 Correct 46 ms 19036 KB Output is correct
201 Correct 684 ms 28868 KB Output is correct
202 Correct 293 ms 31644 KB Output is correct
203 Correct 725 ms 32656 KB Output is correct
204 Correct 729 ms 35784 KB Output is correct
205 Correct 832 ms 33052 KB Output is correct
206 Correct 514 ms 25056 KB Output is correct
207 Correct 21 ms 19036 KB Output is correct
208 Correct 46 ms 19036 KB Output is correct
209 Correct 1346 ms 32640 KB Output is correct
210 Correct 569 ms 23576 KB Output is correct
211 Correct 1381 ms 34956 KB Output is correct
212 Correct 1438 ms 31080 KB Output is correct
213 Correct 1715 ms 34120 KB Output is correct
214 Correct 1164 ms 26296 KB Output is correct
215 Correct 4094 ms 30148 KB Output is correct
216 Correct 1896 ms 22952 KB Output is correct
217 Correct 4157 ms 33352 KB Output is correct
218 Correct 3839 ms 35448 KB Output is correct
219 Incorrect 23 ms 19292 KB Output isn't correct
220 Halted 0 ms 0 KB -