답안 #1070892

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1070892 2024-08-22T20:29:46 Z AdamGS Uplifting Excursion (BOI22_vault) C++17
80 / 100
4916 ms 26812 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=7e5+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;
	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]-40, 0ll));
			A[i]-=p;
			dp[0]+=p;
			m-=p*i;	
		}
	}
	if(m>=LIM) {
		cout << "impossible\n";
		return 0;
	}
	rep(xd, 2) {
		for(ll i=1; i<=n; ++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:48: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]
   48 |     while(l[p]<V[p].size() && (j-V[p][l[p]])/i>A[i]) ++l[p];
vault.cpp:54: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]
   54 |     if(l[p]<V[p].size()) {
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 13916 KB Output is correct
2 Correct 43 ms 13916 KB Output is correct
3 Correct 15 ms 13912 KB Output is correct
4 Correct 135 ms 13916 KB Output is correct
5 Correct 2 ms 9820 KB Output is correct
6 Correct 666 ms 14164 KB Output is correct
7 Correct 645 ms 13916 KB Output is correct
8 Correct 661 ms 14192 KB Output is correct
9 Correct 662 ms 14284 KB Output is correct
10 Correct 618 ms 13960 KB Output is correct
11 Correct 575 ms 13912 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 13916 KB Output is correct
2 Correct 43 ms 13916 KB Output is correct
3 Correct 15 ms 13912 KB Output is correct
4 Correct 135 ms 13916 KB Output is correct
5 Correct 2 ms 9820 KB Output is correct
6 Correct 666 ms 14164 KB Output is correct
7 Correct 645 ms 13916 KB Output is correct
8 Correct 661 ms 14192 KB Output is correct
9 Correct 662 ms 14284 KB Output is correct
10 Correct 618 ms 13960 KB Output is correct
11 Correct 575 ms 13912 KB Output is correct
12 Correct 29 ms 13916 KB Output is correct
13 Correct 39 ms 13916 KB Output is correct
14 Correct 15 ms 13916 KB Output is correct
15 Correct 131 ms 13792 KB Output is correct
16 Correct 1 ms 9820 KB Output is correct
17 Correct 660 ms 14160 KB Output is correct
18 Correct 652 ms 13912 KB Output is correct
19 Correct 654 ms 14200 KB Output is correct
20 Correct 653 ms 14432 KB Output is correct
21 Correct 569 ms 13912 KB Output is correct
22 Correct 567 ms 13912 KB Output is correct
23 Correct 2 ms 9820 KB Output is correct
24 Correct 1348 ms 15664 KB Output is correct
25 Correct 1334 ms 14436 KB Output is correct
26 Correct 1398 ms 16876 KB Output is correct
27 Correct 1397 ms 16872 KB Output is correct
28 Correct 1121 ms 13912 KB Output is correct
29 Correct 1132 ms 13980 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 134 ms 13912 KB Output is correct
2 Correct 448 ms 17284 KB Output is correct
3 Correct 394 ms 17812 KB Output is correct
4 Correct 470 ms 23088 KB Output is correct
5 Correct 460 ms 20800 KB Output is correct
6 Correct 503 ms 23208 KB Output is correct
7 Correct 347 ms 14160 KB Output is correct
8 Correct 354 ms 13916 KB Output is correct
9 Correct 439 ms 24240 KB Output is correct
10 Correct 432 ms 17992 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 134 ms 13912 KB Output is correct
2 Correct 448 ms 17284 KB Output is correct
3 Correct 394 ms 17812 KB Output is correct
4 Correct 470 ms 23088 KB Output is correct
5 Correct 460 ms 20800 KB Output is correct
6 Correct 503 ms 23208 KB Output is correct
7 Correct 347 ms 14160 KB Output is correct
8 Correct 354 ms 13916 KB Output is correct
9 Correct 439 ms 24240 KB Output is correct
10 Correct 432 ms 17992 KB Output is correct
11 Correct 27 ms 13916 KB Output is correct
12 Correct 39 ms 13916 KB Output is correct
13 Correct 15 ms 13912 KB Output is correct
14 Correct 132 ms 13916 KB Output is correct
15 Correct 454 ms 17512 KB Output is correct
16 Correct 388 ms 17752 KB Output is correct
17 Correct 460 ms 23116 KB Output is correct
18 Correct 452 ms 20800 KB Output is correct
19 Correct 489 ms 23484 KB Output is correct
20 Correct 342 ms 14420 KB Output is correct
21 Correct 339 ms 13960 KB Output is correct
22 Correct 441 ms 24144 KB Output is correct
23 Correct 424 ms 18064 KB Output is correct
24 Correct 446 ms 19244 KB Output is correct
25 Correct 390 ms 17604 KB Output is correct
26 Correct 482 ms 23420 KB Output is correct
27 Correct 458 ms 23300 KB Output is correct
28 Correct 480 ms 23204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 134 ms 13912 KB Output is correct
2 Correct 448 ms 17284 KB Output is correct
3 Correct 394 ms 17812 KB Output is correct
4 Correct 470 ms 23088 KB Output is correct
5 Correct 460 ms 20800 KB Output is correct
6 Correct 503 ms 23208 KB Output is correct
7 Correct 347 ms 14160 KB Output is correct
8 Correct 354 ms 13916 KB Output is correct
9 Correct 439 ms 24240 KB Output is correct
10 Correct 432 ms 17992 KB Output is correct
11 Correct 136 ms 13980 KB Output is correct
12 Correct 436 ms 17264 KB Output is correct
13 Correct 387 ms 17720 KB Output is correct
14 Correct 457 ms 23052 KB Output is correct
15 Correct 451 ms 20812 KB Output is correct
16 Correct 494 ms 23252 KB Output is correct
17 Correct 339 ms 14160 KB Output is correct
18 Correct 342 ms 13916 KB Output is correct
19 Correct 428 ms 24388 KB Output is correct
20 Correct 430 ms 17984 KB Output is correct
21 Correct 556 ms 13916 KB Output is correct
22 Correct 557 ms 13964 KB Output is correct
23 Correct 750 ms 22396 KB Output is correct
24 Correct 690 ms 20952 KB Output is correct
25 Correct 754 ms 26812 KB Output is correct
26 Correct 768 ms 24028 KB Output is correct
27 Correct 823 ms 24120 KB Output is correct
28 Correct 732 ms 19164 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 13916 KB Output is correct
2 Correct 43 ms 13916 KB Output is correct
3 Correct 15 ms 13912 KB Output is correct
4 Correct 135 ms 13916 KB Output is correct
5 Correct 2 ms 9820 KB Output is correct
6 Correct 666 ms 14164 KB Output is correct
7 Correct 645 ms 13916 KB Output is correct
8 Correct 661 ms 14192 KB Output is correct
9 Correct 662 ms 14284 KB Output is correct
10 Correct 618 ms 13960 KB Output is correct
11 Correct 575 ms 13912 KB Output is correct
12 Correct 134 ms 13912 KB Output is correct
13 Correct 448 ms 17284 KB Output is correct
14 Correct 394 ms 17812 KB Output is correct
15 Correct 470 ms 23088 KB Output is correct
16 Correct 460 ms 20800 KB Output is correct
17 Correct 503 ms 23208 KB Output is correct
18 Correct 347 ms 14160 KB Output is correct
19 Correct 354 ms 13916 KB Output is correct
20 Correct 439 ms 24240 KB Output is correct
21 Correct 432 ms 17992 KB Output is correct
22 Correct 27 ms 13916 KB Output is correct
23 Correct 39 ms 13916 KB Output is correct
24 Correct 15 ms 13912 KB Output is correct
25 Correct 132 ms 13916 KB Output is correct
26 Correct 454 ms 17512 KB Output is correct
27 Correct 388 ms 17752 KB Output is correct
28 Correct 460 ms 23116 KB Output is correct
29 Correct 452 ms 20800 KB Output is correct
30 Correct 489 ms 23484 KB Output is correct
31 Correct 342 ms 14420 KB Output is correct
32 Correct 339 ms 13960 KB Output is correct
33 Correct 441 ms 24144 KB Output is correct
34 Correct 424 ms 18064 KB Output is correct
35 Correct 446 ms 19244 KB Output is correct
36 Correct 390 ms 17604 KB Output is correct
37 Correct 482 ms 23420 KB Output is correct
38 Correct 458 ms 23300 KB Output is correct
39 Correct 480 ms 23204 KB Output is correct
40 Correct 136 ms 13980 KB Output is correct
41 Correct 436 ms 17264 KB Output is correct
42 Correct 387 ms 17720 KB Output is correct
43 Correct 457 ms 23052 KB Output is correct
44 Correct 451 ms 20812 KB Output is correct
45 Correct 494 ms 23252 KB Output is correct
46 Correct 339 ms 14160 KB Output is correct
47 Correct 342 ms 13916 KB Output is correct
48 Correct 428 ms 24388 KB Output is correct
49 Correct 430 ms 17984 KB Output is correct
50 Correct 556 ms 13916 KB Output is correct
51 Correct 557 ms 13964 KB Output is correct
52 Correct 750 ms 22396 KB Output is correct
53 Correct 690 ms 20952 KB Output is correct
54 Correct 754 ms 26812 KB Output is correct
55 Correct 768 ms 24028 KB Output is correct
56 Correct 823 ms 24120 KB Output is correct
57 Correct 732 ms 19164 KB Output is correct
58 Correct 27 ms 13912 KB Output is correct
59 Correct 38 ms 13912 KB Output is correct
60 Correct 15 ms 13912 KB Output is correct
61 Correct 131 ms 13984 KB Output is correct
62 Correct 2 ms 9816 KB Output is correct
63 Correct 652 ms 14404 KB Output is correct
64 Correct 639 ms 13980 KB Output is correct
65 Correct 643 ms 14184 KB Output is correct
66 Correct 646 ms 14284 KB Output is correct
67 Correct 554 ms 13916 KB Output is correct
68 Correct 568 ms 13912 KB Output is correct
69 Correct 450 ms 17280 KB Output is correct
70 Correct 395 ms 17736 KB Output is correct
71 Correct 460 ms 23048 KB Output is correct
72 Correct 456 ms 20820 KB Output is correct
73 Correct 486 ms 23188 KB Output is correct
74 Correct 343 ms 14296 KB Output is correct
75 Correct 340 ms 13916 KB Output is correct
76 Correct 435 ms 24260 KB Output is correct
77 Correct 424 ms 18064 KB Output is correct
78 Correct 439 ms 19276 KB Output is correct
79 Correct 393 ms 17496 KB Output is correct
80 Correct 492 ms 23504 KB Output is correct
81 Correct 462 ms 23312 KB Output is correct
82 Correct 506 ms 23484 KB Output is correct
83 Correct 772 ms 22304 KB Output is correct
84 Correct 714 ms 20988 KB Output is correct
85 Correct 811 ms 26196 KB Output is correct
86 Correct 829 ms 23916 KB Output is correct
87 Correct 894 ms 24092 KB Output is correct
88 Correct 792 ms 19036 KB Output is correct
89 Correct 809 ms 19668 KB Output is correct
90 Correct 824 ms 19100 KB Output is correct
91 Correct 804 ms 24012 KB Output is correct
92 Correct 853 ms 23288 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 134 ms 13912 KB Output is correct
2 Correct 448 ms 17284 KB Output is correct
3 Correct 394 ms 17812 KB Output is correct
4 Correct 470 ms 23088 KB Output is correct
5 Correct 460 ms 20800 KB Output is correct
6 Correct 503 ms 23208 KB Output is correct
7 Correct 347 ms 14160 KB Output is correct
8 Correct 354 ms 13916 KB Output is correct
9 Correct 439 ms 24240 KB Output is correct
10 Correct 432 ms 17992 KB Output is correct
11 Correct 136 ms 13980 KB Output is correct
12 Correct 436 ms 17264 KB Output is correct
13 Correct 387 ms 17720 KB Output is correct
14 Correct 457 ms 23052 KB Output is correct
15 Correct 451 ms 20812 KB Output is correct
16 Correct 494 ms 23252 KB Output is correct
17 Correct 339 ms 14160 KB Output is correct
18 Correct 342 ms 13916 KB Output is correct
19 Correct 428 ms 24388 KB Output is correct
20 Correct 430 ms 17984 KB Output is correct
21 Correct 556 ms 13916 KB Output is correct
22 Correct 557 ms 13964 KB Output is correct
23 Correct 750 ms 22396 KB Output is correct
24 Correct 690 ms 20952 KB Output is correct
25 Correct 754 ms 26812 KB Output is correct
26 Correct 768 ms 24028 KB Output is correct
27 Correct 823 ms 24120 KB Output is correct
28 Correct 732 ms 19164 KB Output is correct
29 Correct 134 ms 13912 KB Output is correct
30 Correct 461 ms 17272 KB Output is correct
31 Correct 402 ms 17832 KB Output is correct
32 Correct 490 ms 23052 KB Output is correct
33 Correct 462 ms 20796 KB Output is correct
34 Correct 514 ms 23472 KB Output is correct
35 Correct 352 ms 14216 KB Output is correct
36 Correct 361 ms 13916 KB Output is correct
37 Correct 457 ms 26672 KB Output is correct
38 Correct 437 ms 17980 KB Output is correct
39 Correct 568 ms 14164 KB Output is correct
40 Correct 579 ms 13916 KB Output is correct
41 Correct 767 ms 22296 KB Output is correct
42 Correct 708 ms 20988 KB Output is correct
43 Correct 778 ms 24100 KB Output is correct
44 Correct 799 ms 26760 KB Output is correct
45 Correct 847 ms 24064 KB Output is correct
46 Correct 758 ms 19236 KB Output is correct
47 Correct 1139 ms 13972 KB Output is correct
48 Correct 1125 ms 13960 KB Output is correct
49 Correct 1537 ms 24028 KB Output is correct
50 Correct 1413 ms 17956 KB Output is correct
51 Correct 1568 ms 22972 KB Output is correct
52 Correct 1593 ms 23756 KB Output is correct
53 Correct 1699 ms 24044 KB Output is correct
54 Correct 1552 ms 20104 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 13916 KB Output is correct
2 Correct 43 ms 13916 KB Output is correct
3 Correct 15 ms 13912 KB Output is correct
4 Correct 135 ms 13916 KB Output is correct
5 Correct 2 ms 9820 KB Output is correct
6 Correct 666 ms 14164 KB Output is correct
7 Correct 645 ms 13916 KB Output is correct
8 Correct 661 ms 14192 KB Output is correct
9 Correct 662 ms 14284 KB Output is correct
10 Correct 618 ms 13960 KB Output is correct
11 Correct 575 ms 13912 KB Output is correct
12 Correct 29 ms 13916 KB Output is correct
13 Correct 39 ms 13916 KB Output is correct
14 Correct 15 ms 13916 KB Output is correct
15 Correct 131 ms 13792 KB Output is correct
16 Correct 1 ms 9820 KB Output is correct
17 Correct 660 ms 14160 KB Output is correct
18 Correct 652 ms 13912 KB Output is correct
19 Correct 654 ms 14200 KB Output is correct
20 Correct 653 ms 14432 KB Output is correct
21 Correct 569 ms 13912 KB Output is correct
22 Correct 567 ms 13912 KB Output is correct
23 Correct 2 ms 9820 KB Output is correct
24 Correct 1348 ms 15664 KB Output is correct
25 Correct 1334 ms 14436 KB Output is correct
26 Correct 1398 ms 16876 KB Output is correct
27 Correct 1397 ms 16872 KB Output is correct
28 Correct 1121 ms 13912 KB Output is correct
29 Correct 1132 ms 13980 KB Output is correct
30 Correct 134 ms 13912 KB Output is correct
31 Correct 448 ms 17284 KB Output is correct
32 Correct 394 ms 17812 KB Output is correct
33 Correct 470 ms 23088 KB Output is correct
34 Correct 460 ms 20800 KB Output is correct
35 Correct 503 ms 23208 KB Output is correct
36 Correct 347 ms 14160 KB Output is correct
37 Correct 354 ms 13916 KB Output is correct
38 Correct 439 ms 24240 KB Output is correct
39 Correct 432 ms 17992 KB Output is correct
40 Correct 27 ms 13916 KB Output is correct
41 Correct 39 ms 13916 KB Output is correct
42 Correct 15 ms 13912 KB Output is correct
43 Correct 132 ms 13916 KB Output is correct
44 Correct 454 ms 17512 KB Output is correct
45 Correct 388 ms 17752 KB Output is correct
46 Correct 460 ms 23116 KB Output is correct
47 Correct 452 ms 20800 KB Output is correct
48 Correct 489 ms 23484 KB Output is correct
49 Correct 342 ms 14420 KB Output is correct
50 Correct 339 ms 13960 KB Output is correct
51 Correct 441 ms 24144 KB Output is correct
52 Correct 424 ms 18064 KB Output is correct
53 Correct 446 ms 19244 KB Output is correct
54 Correct 390 ms 17604 KB Output is correct
55 Correct 482 ms 23420 KB Output is correct
56 Correct 458 ms 23300 KB Output is correct
57 Correct 480 ms 23204 KB Output is correct
58 Correct 136 ms 13980 KB Output is correct
59 Correct 436 ms 17264 KB Output is correct
60 Correct 387 ms 17720 KB Output is correct
61 Correct 457 ms 23052 KB Output is correct
62 Correct 451 ms 20812 KB Output is correct
63 Correct 494 ms 23252 KB Output is correct
64 Correct 339 ms 14160 KB Output is correct
65 Correct 342 ms 13916 KB Output is correct
66 Correct 428 ms 24388 KB Output is correct
67 Correct 430 ms 17984 KB Output is correct
68 Correct 556 ms 13916 KB Output is correct
69 Correct 557 ms 13964 KB Output is correct
70 Correct 750 ms 22396 KB Output is correct
71 Correct 690 ms 20952 KB Output is correct
72 Correct 754 ms 26812 KB Output is correct
73 Correct 768 ms 24028 KB Output is correct
74 Correct 823 ms 24120 KB Output is correct
75 Correct 732 ms 19164 KB Output is correct
76 Correct 27 ms 13912 KB Output is correct
77 Correct 38 ms 13912 KB Output is correct
78 Correct 15 ms 13912 KB Output is correct
79 Correct 131 ms 13984 KB Output is correct
80 Correct 2 ms 9816 KB Output is correct
81 Correct 652 ms 14404 KB Output is correct
82 Correct 639 ms 13980 KB Output is correct
83 Correct 643 ms 14184 KB Output is correct
84 Correct 646 ms 14284 KB Output is correct
85 Correct 554 ms 13916 KB Output is correct
86 Correct 568 ms 13912 KB Output is correct
87 Correct 450 ms 17280 KB Output is correct
88 Correct 395 ms 17736 KB Output is correct
89 Correct 460 ms 23048 KB Output is correct
90 Correct 456 ms 20820 KB Output is correct
91 Correct 486 ms 23188 KB Output is correct
92 Correct 343 ms 14296 KB Output is correct
93 Correct 340 ms 13916 KB Output is correct
94 Correct 435 ms 24260 KB Output is correct
95 Correct 424 ms 18064 KB Output is correct
96 Correct 439 ms 19276 KB Output is correct
97 Correct 393 ms 17496 KB Output is correct
98 Correct 492 ms 23504 KB Output is correct
99 Correct 462 ms 23312 KB Output is correct
100 Correct 506 ms 23484 KB Output is correct
101 Correct 772 ms 22304 KB Output is correct
102 Correct 714 ms 20988 KB Output is correct
103 Correct 811 ms 26196 KB Output is correct
104 Correct 829 ms 23916 KB Output is correct
105 Correct 894 ms 24092 KB Output is correct
106 Correct 792 ms 19036 KB Output is correct
107 Correct 809 ms 19668 KB Output is correct
108 Correct 824 ms 19100 KB Output is correct
109 Correct 804 ms 24012 KB Output is correct
110 Correct 853 ms 23288 KB Output is correct
111 Correct 134 ms 13912 KB Output is correct
112 Correct 461 ms 17272 KB Output is correct
113 Correct 402 ms 17832 KB Output is correct
114 Correct 490 ms 23052 KB Output is correct
115 Correct 462 ms 20796 KB Output is correct
116 Correct 514 ms 23472 KB Output is correct
117 Correct 352 ms 14216 KB Output is correct
118 Correct 361 ms 13916 KB Output is correct
119 Correct 457 ms 26672 KB Output is correct
120 Correct 437 ms 17980 KB Output is correct
121 Correct 568 ms 14164 KB Output is correct
122 Correct 579 ms 13916 KB Output is correct
123 Correct 767 ms 22296 KB Output is correct
124 Correct 708 ms 20988 KB Output is correct
125 Correct 778 ms 24100 KB Output is correct
126 Correct 799 ms 26760 KB Output is correct
127 Correct 847 ms 24064 KB Output is correct
128 Correct 758 ms 19236 KB Output is correct
129 Correct 1139 ms 13972 KB Output is correct
130 Correct 1125 ms 13960 KB Output is correct
131 Correct 1537 ms 24028 KB Output is correct
132 Correct 1413 ms 17956 KB Output is correct
133 Correct 1568 ms 22972 KB Output is correct
134 Correct 1593 ms 23756 KB Output is correct
135 Correct 1699 ms 24044 KB Output is correct
136 Correct 1552 ms 20104 KB Output is correct
137 Correct 31 ms 13916 KB Output is correct
138 Correct 41 ms 13916 KB Output is correct
139 Correct 15 ms 13916 KB Output is correct
140 Correct 137 ms 14164 KB Output is correct
141 Correct 2 ms 9820 KB Output is correct
142 Correct 686 ms 14168 KB Output is correct
143 Correct 651 ms 13916 KB Output is correct
144 Correct 671 ms 14284 KB Output is correct
145 Correct 685 ms 14428 KB Output is correct
146 Correct 593 ms 13912 KB Output is correct
147 Correct 600 ms 13968 KB Output is correct
148 Correct 2 ms 9820 KB Output is correct
149 Correct 1441 ms 15596 KB Output is correct
150 Correct 1421 ms 14616 KB Output is correct
151 Correct 1512 ms 16948 KB Output is correct
152 Correct 1501 ms 16956 KB Output is correct
153 Correct 1150 ms 13956 KB Output is correct
154 Correct 1116 ms 13960 KB Output is correct
155 Correct 446 ms 17296 KB Output is correct
156 Correct 408 ms 17652 KB Output is correct
157 Correct 471 ms 23120 KB Output is correct
158 Correct 461 ms 20808 KB Output is correct
159 Correct 497 ms 23304 KB Output is correct
160 Correct 354 ms 14116 KB Output is correct
161 Correct 345 ms 13912 KB Output is correct
162 Correct 444 ms 24240 KB Output is correct
163 Correct 430 ms 18012 KB Output is correct
164 Correct 760 ms 22380 KB Output is correct
165 Correct 710 ms 20992 KB Output is correct
166 Correct 775 ms 24240 KB Output is correct
167 Correct 790 ms 23924 KB Output is correct
168 Correct 832 ms 24060 KB Output is correct
169 Correct 742 ms 19120 KB Output is correct
170 Correct 449 ms 19148 KB Output is correct
171 Correct 394 ms 17824 KB Output is correct
172 Correct 505 ms 23428 KB Output is correct
173 Correct 453 ms 23284 KB Output is correct
174 Correct 490 ms 23124 KB Output is correct
175 Correct 746 ms 19676 KB Output is correct
176 Correct 745 ms 19096 KB Output is correct
177 Correct 760 ms 26208 KB Output is correct
178 Correct 836 ms 23740 KB Output is correct
179 Correct 1518 ms 24044 KB Output is correct
180 Correct 1408 ms 17944 KB Output is correct
181 Correct 1542 ms 23476 KB Output is correct
182 Correct 1574 ms 23988 KB Output is correct
183 Correct 1661 ms 24124 KB Output is correct
184 Correct 1525 ms 20116 KB Output is correct
185 Correct 1501 ms 22892 KB Output is correct
186 Correct 1512 ms 23052 KB Output is correct
187 Correct 1667 ms 23244 KB Output is correct
188 Correct 1664 ms 24048 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 134 ms 13912 KB Output is correct
2 Correct 448 ms 17284 KB Output is correct
3 Correct 394 ms 17812 KB Output is correct
4 Correct 470 ms 23088 KB Output is correct
5 Correct 460 ms 20800 KB Output is correct
6 Correct 503 ms 23208 KB Output is correct
7 Correct 347 ms 14160 KB Output is correct
8 Correct 354 ms 13916 KB Output is correct
9 Correct 439 ms 24240 KB Output is correct
10 Correct 432 ms 17992 KB Output is correct
11 Correct 136 ms 13980 KB Output is correct
12 Correct 436 ms 17264 KB Output is correct
13 Correct 387 ms 17720 KB Output is correct
14 Correct 457 ms 23052 KB Output is correct
15 Correct 451 ms 20812 KB Output is correct
16 Correct 494 ms 23252 KB Output is correct
17 Correct 339 ms 14160 KB Output is correct
18 Correct 342 ms 13916 KB Output is correct
19 Correct 428 ms 24388 KB Output is correct
20 Correct 430 ms 17984 KB Output is correct
21 Correct 556 ms 13916 KB Output is correct
22 Correct 557 ms 13964 KB Output is correct
23 Correct 750 ms 22396 KB Output is correct
24 Correct 690 ms 20952 KB Output is correct
25 Correct 754 ms 26812 KB Output is correct
26 Correct 768 ms 24028 KB Output is correct
27 Correct 823 ms 24120 KB Output is correct
28 Correct 732 ms 19164 KB Output is correct
29 Correct 134 ms 13912 KB Output is correct
30 Correct 461 ms 17272 KB Output is correct
31 Correct 402 ms 17832 KB Output is correct
32 Correct 490 ms 23052 KB Output is correct
33 Correct 462 ms 20796 KB Output is correct
34 Correct 514 ms 23472 KB Output is correct
35 Correct 352 ms 14216 KB Output is correct
36 Correct 361 ms 13916 KB Output is correct
37 Correct 457 ms 26672 KB Output is correct
38 Correct 437 ms 17980 KB Output is correct
39 Correct 568 ms 14164 KB Output is correct
40 Correct 579 ms 13916 KB Output is correct
41 Correct 767 ms 22296 KB Output is correct
42 Correct 708 ms 20988 KB Output is correct
43 Correct 778 ms 24100 KB Output is correct
44 Correct 799 ms 26760 KB Output is correct
45 Correct 847 ms 24064 KB Output is correct
46 Correct 758 ms 19236 KB Output is correct
47 Correct 1139 ms 13972 KB Output is correct
48 Correct 1125 ms 13960 KB Output is correct
49 Correct 1537 ms 24028 KB Output is correct
50 Correct 1413 ms 17956 KB Output is correct
51 Correct 1568 ms 22972 KB Output is correct
52 Correct 1593 ms 23756 KB Output is correct
53 Correct 1699 ms 24044 KB Output is correct
54 Correct 1552 ms 20104 KB Output is correct
55 Correct 133 ms 13912 KB Output is correct
56 Correct 445 ms 17292 KB Output is correct
57 Correct 391 ms 17672 KB Output is correct
58 Correct 474 ms 23048 KB Output is correct
59 Correct 460 ms 20812 KB Output is correct
60 Correct 502 ms 23280 KB Output is correct
61 Correct 345 ms 14216 KB Output is correct
62 Correct 344 ms 13976 KB Output is correct
63 Correct 444 ms 24176 KB Output is correct
64 Correct 427 ms 18028 KB Output is correct
65 Correct 576 ms 13964 KB Output is correct
66 Correct 569 ms 13916 KB Output is correct
67 Correct 753 ms 22292 KB Output is correct
68 Correct 700 ms 20952 KB Output is correct
69 Correct 791 ms 24124 KB Output is correct
70 Correct 808 ms 23932 KB Output is correct
71 Correct 828 ms 24020 KB Output is correct
72 Correct 752 ms 19236 KB Output is correct
73 Correct 1124 ms 13912 KB Output is correct
74 Correct 1135 ms 13980 KB Output is correct
75 Correct 1519 ms 26176 KB Output is correct
76 Correct 1408 ms 17752 KB Output is correct
77 Correct 1553 ms 21684 KB Output is correct
78 Correct 1618 ms 23756 KB Output is correct
79 Correct 1662 ms 24224 KB Output is correct
80 Correct 1501 ms 20104 KB Output is correct
81 Correct 4521 ms 20068 KB Output is correct
82 Correct 4447 ms 16820 KB Output is correct
83 Correct 4795 ms 23916 KB Output is correct
84 Incorrect 4916 ms 24048 KB Output isn't correct
85 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 13916 KB Output is correct
2 Correct 43 ms 13916 KB Output is correct
3 Correct 15 ms 13912 KB Output is correct
4 Correct 135 ms 13916 KB Output is correct
5 Correct 2 ms 9820 KB Output is correct
6 Correct 666 ms 14164 KB Output is correct
7 Correct 645 ms 13916 KB Output is correct
8 Correct 661 ms 14192 KB Output is correct
9 Correct 662 ms 14284 KB Output is correct
10 Correct 618 ms 13960 KB Output is correct
11 Correct 575 ms 13912 KB Output is correct
12 Correct 29 ms 13916 KB Output is correct
13 Correct 39 ms 13916 KB Output is correct
14 Correct 15 ms 13916 KB Output is correct
15 Correct 131 ms 13792 KB Output is correct
16 Correct 1 ms 9820 KB Output is correct
17 Correct 660 ms 14160 KB Output is correct
18 Correct 652 ms 13912 KB Output is correct
19 Correct 654 ms 14200 KB Output is correct
20 Correct 653 ms 14432 KB Output is correct
21 Correct 569 ms 13912 KB Output is correct
22 Correct 567 ms 13912 KB Output is correct
23 Correct 2 ms 9820 KB Output is correct
24 Correct 1348 ms 15664 KB Output is correct
25 Correct 1334 ms 14436 KB Output is correct
26 Correct 1398 ms 16876 KB Output is correct
27 Correct 1397 ms 16872 KB Output is correct
28 Correct 1121 ms 13912 KB Output is correct
29 Correct 1132 ms 13980 KB Output is correct
30 Correct 134 ms 13912 KB Output is correct
31 Correct 448 ms 17284 KB Output is correct
32 Correct 394 ms 17812 KB Output is correct
33 Correct 470 ms 23088 KB Output is correct
34 Correct 460 ms 20800 KB Output is correct
35 Correct 503 ms 23208 KB Output is correct
36 Correct 347 ms 14160 KB Output is correct
37 Correct 354 ms 13916 KB Output is correct
38 Correct 439 ms 24240 KB Output is correct
39 Correct 432 ms 17992 KB Output is correct
40 Correct 27 ms 13916 KB Output is correct
41 Correct 39 ms 13916 KB Output is correct
42 Correct 15 ms 13912 KB Output is correct
43 Correct 132 ms 13916 KB Output is correct
44 Correct 454 ms 17512 KB Output is correct
45 Correct 388 ms 17752 KB Output is correct
46 Correct 460 ms 23116 KB Output is correct
47 Correct 452 ms 20800 KB Output is correct
48 Correct 489 ms 23484 KB Output is correct
49 Correct 342 ms 14420 KB Output is correct
50 Correct 339 ms 13960 KB Output is correct
51 Correct 441 ms 24144 KB Output is correct
52 Correct 424 ms 18064 KB Output is correct
53 Correct 446 ms 19244 KB Output is correct
54 Correct 390 ms 17604 KB Output is correct
55 Correct 482 ms 23420 KB Output is correct
56 Correct 458 ms 23300 KB Output is correct
57 Correct 480 ms 23204 KB Output is correct
58 Correct 136 ms 13980 KB Output is correct
59 Correct 436 ms 17264 KB Output is correct
60 Correct 387 ms 17720 KB Output is correct
61 Correct 457 ms 23052 KB Output is correct
62 Correct 451 ms 20812 KB Output is correct
63 Correct 494 ms 23252 KB Output is correct
64 Correct 339 ms 14160 KB Output is correct
65 Correct 342 ms 13916 KB Output is correct
66 Correct 428 ms 24388 KB Output is correct
67 Correct 430 ms 17984 KB Output is correct
68 Correct 556 ms 13916 KB Output is correct
69 Correct 557 ms 13964 KB Output is correct
70 Correct 750 ms 22396 KB Output is correct
71 Correct 690 ms 20952 KB Output is correct
72 Correct 754 ms 26812 KB Output is correct
73 Correct 768 ms 24028 KB Output is correct
74 Correct 823 ms 24120 KB Output is correct
75 Correct 732 ms 19164 KB Output is correct
76 Correct 27 ms 13912 KB Output is correct
77 Correct 38 ms 13912 KB Output is correct
78 Correct 15 ms 13912 KB Output is correct
79 Correct 131 ms 13984 KB Output is correct
80 Correct 2 ms 9816 KB Output is correct
81 Correct 652 ms 14404 KB Output is correct
82 Correct 639 ms 13980 KB Output is correct
83 Correct 643 ms 14184 KB Output is correct
84 Correct 646 ms 14284 KB Output is correct
85 Correct 554 ms 13916 KB Output is correct
86 Correct 568 ms 13912 KB Output is correct
87 Correct 450 ms 17280 KB Output is correct
88 Correct 395 ms 17736 KB Output is correct
89 Correct 460 ms 23048 KB Output is correct
90 Correct 456 ms 20820 KB Output is correct
91 Correct 486 ms 23188 KB Output is correct
92 Correct 343 ms 14296 KB Output is correct
93 Correct 340 ms 13916 KB Output is correct
94 Correct 435 ms 24260 KB Output is correct
95 Correct 424 ms 18064 KB Output is correct
96 Correct 439 ms 19276 KB Output is correct
97 Correct 393 ms 17496 KB Output is correct
98 Correct 492 ms 23504 KB Output is correct
99 Correct 462 ms 23312 KB Output is correct
100 Correct 506 ms 23484 KB Output is correct
101 Correct 772 ms 22304 KB Output is correct
102 Correct 714 ms 20988 KB Output is correct
103 Correct 811 ms 26196 KB Output is correct
104 Correct 829 ms 23916 KB Output is correct
105 Correct 894 ms 24092 KB Output is correct
106 Correct 792 ms 19036 KB Output is correct
107 Correct 809 ms 19668 KB Output is correct
108 Correct 824 ms 19100 KB Output is correct
109 Correct 804 ms 24012 KB Output is correct
110 Correct 853 ms 23288 KB Output is correct
111 Correct 134 ms 13912 KB Output is correct
112 Correct 461 ms 17272 KB Output is correct
113 Correct 402 ms 17832 KB Output is correct
114 Correct 490 ms 23052 KB Output is correct
115 Correct 462 ms 20796 KB Output is correct
116 Correct 514 ms 23472 KB Output is correct
117 Correct 352 ms 14216 KB Output is correct
118 Correct 361 ms 13916 KB Output is correct
119 Correct 457 ms 26672 KB Output is correct
120 Correct 437 ms 17980 KB Output is correct
121 Correct 568 ms 14164 KB Output is correct
122 Correct 579 ms 13916 KB Output is correct
123 Correct 767 ms 22296 KB Output is correct
124 Correct 708 ms 20988 KB Output is correct
125 Correct 778 ms 24100 KB Output is correct
126 Correct 799 ms 26760 KB Output is correct
127 Correct 847 ms 24064 KB Output is correct
128 Correct 758 ms 19236 KB Output is correct
129 Correct 1139 ms 13972 KB Output is correct
130 Correct 1125 ms 13960 KB Output is correct
131 Correct 1537 ms 24028 KB Output is correct
132 Correct 1413 ms 17956 KB Output is correct
133 Correct 1568 ms 22972 KB Output is correct
134 Correct 1593 ms 23756 KB Output is correct
135 Correct 1699 ms 24044 KB Output is correct
136 Correct 1552 ms 20104 KB Output is correct
137 Correct 31 ms 13916 KB Output is correct
138 Correct 41 ms 13916 KB Output is correct
139 Correct 15 ms 13916 KB Output is correct
140 Correct 137 ms 14164 KB Output is correct
141 Correct 2 ms 9820 KB Output is correct
142 Correct 686 ms 14168 KB Output is correct
143 Correct 651 ms 13916 KB Output is correct
144 Correct 671 ms 14284 KB Output is correct
145 Correct 685 ms 14428 KB Output is correct
146 Correct 593 ms 13912 KB Output is correct
147 Correct 600 ms 13968 KB Output is correct
148 Correct 2 ms 9820 KB Output is correct
149 Correct 1441 ms 15596 KB Output is correct
150 Correct 1421 ms 14616 KB Output is correct
151 Correct 1512 ms 16948 KB Output is correct
152 Correct 1501 ms 16956 KB Output is correct
153 Correct 1150 ms 13956 KB Output is correct
154 Correct 1116 ms 13960 KB Output is correct
155 Correct 446 ms 17296 KB Output is correct
156 Correct 408 ms 17652 KB Output is correct
157 Correct 471 ms 23120 KB Output is correct
158 Correct 461 ms 20808 KB Output is correct
159 Correct 497 ms 23304 KB Output is correct
160 Correct 354 ms 14116 KB Output is correct
161 Correct 345 ms 13912 KB Output is correct
162 Correct 444 ms 24240 KB Output is correct
163 Correct 430 ms 18012 KB Output is correct
164 Correct 760 ms 22380 KB Output is correct
165 Correct 710 ms 20992 KB Output is correct
166 Correct 775 ms 24240 KB Output is correct
167 Correct 790 ms 23924 KB Output is correct
168 Correct 832 ms 24060 KB Output is correct
169 Correct 742 ms 19120 KB Output is correct
170 Correct 449 ms 19148 KB Output is correct
171 Correct 394 ms 17824 KB Output is correct
172 Correct 505 ms 23428 KB Output is correct
173 Correct 453 ms 23284 KB Output is correct
174 Correct 490 ms 23124 KB Output is correct
175 Correct 746 ms 19676 KB Output is correct
176 Correct 745 ms 19096 KB Output is correct
177 Correct 760 ms 26208 KB Output is correct
178 Correct 836 ms 23740 KB Output is correct
179 Correct 1518 ms 24044 KB Output is correct
180 Correct 1408 ms 17944 KB Output is correct
181 Correct 1542 ms 23476 KB Output is correct
182 Correct 1574 ms 23988 KB Output is correct
183 Correct 1661 ms 24124 KB Output is correct
184 Correct 1525 ms 20116 KB Output is correct
185 Correct 1501 ms 22892 KB Output is correct
186 Correct 1512 ms 23052 KB Output is correct
187 Correct 1667 ms 23244 KB Output is correct
188 Correct 1664 ms 24048 KB Output is correct
189 Correct 133 ms 13912 KB Output is correct
190 Correct 445 ms 17292 KB Output is correct
191 Correct 391 ms 17672 KB Output is correct
192 Correct 474 ms 23048 KB Output is correct
193 Correct 460 ms 20812 KB Output is correct
194 Correct 502 ms 23280 KB Output is correct
195 Correct 345 ms 14216 KB Output is correct
196 Correct 344 ms 13976 KB Output is correct
197 Correct 444 ms 24176 KB Output is correct
198 Correct 427 ms 18028 KB Output is correct
199 Correct 576 ms 13964 KB Output is correct
200 Correct 569 ms 13916 KB Output is correct
201 Correct 753 ms 22292 KB Output is correct
202 Correct 700 ms 20952 KB Output is correct
203 Correct 791 ms 24124 KB Output is correct
204 Correct 808 ms 23932 KB Output is correct
205 Correct 828 ms 24020 KB Output is correct
206 Correct 752 ms 19236 KB Output is correct
207 Correct 1124 ms 13912 KB Output is correct
208 Correct 1135 ms 13980 KB Output is correct
209 Correct 1519 ms 26176 KB Output is correct
210 Correct 1408 ms 17752 KB Output is correct
211 Correct 1553 ms 21684 KB Output is correct
212 Correct 1618 ms 23756 KB Output is correct
213 Correct 1662 ms 24224 KB Output is correct
214 Correct 1501 ms 20104 KB Output is correct
215 Correct 4521 ms 20068 KB Output is correct
216 Correct 4447 ms 16820 KB Output is correct
217 Correct 4795 ms 23916 KB Output is correct
218 Incorrect 4916 ms 24048 KB Output isn't correct
219 Halted 0 ms 0 KB -