답안 #1070980

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1070980 2024-08-22T22:16:14 Z AdamGS Uplifting Excursion (BOI22_vault) C++17
90 / 100
5000 ms 37956 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]-300/ile, 0ll));
    			A[i]-=p;
    			if(A[i]) ile+=2;
    			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:50:19: 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]
   50 |         while(l[p]<V[p].size() && (j-V[p][l[p]])/i>A[i]) ++l[p];
vault.cpp:56:16: 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]
   56 |         if(l[p]<V[p].size()) {
# 결과 실행 시간 메모리 Grader output
1 Correct 43 ms 19032 KB Output is correct
2 Correct 29 ms 19036 KB Output is correct
3 Correct 20 ms 19276 KB Output is correct
4 Correct 95 ms 19036 KB Output is correct
5 Correct 3 ms 11096 KB Output is correct
6 Correct 997 ms 19468 KB Output is correct
7 Correct 452 ms 19284 KB Output is correct
8 Correct 973 ms 19504 KB Output is correct
9 Correct 1016 ms 19828 KB Output is correct
10 Correct 23 ms 19036 KB Output is correct
11 Correct 50 ms 19268 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 43 ms 19032 KB Output is correct
2 Correct 29 ms 19036 KB Output is correct
3 Correct 20 ms 19276 KB Output is correct
4 Correct 95 ms 19036 KB Output is correct
5 Correct 3 ms 11096 KB Output is correct
6 Correct 997 ms 19468 KB Output is correct
7 Correct 452 ms 19284 KB Output is correct
8 Correct 973 ms 19504 KB Output is correct
9 Correct 1016 ms 19828 KB Output is correct
10 Correct 23 ms 19036 KB Output is correct
11 Correct 50 ms 19268 KB Output is correct
12 Correct 66 ms 19032 KB Output is correct
13 Correct 32 ms 19036 KB Output is correct
14 Correct 15 ms 19272 KB Output is correct
15 Correct 93 ms 19036 KB Output is correct
16 Correct 3 ms 10840 KB Output is correct
17 Correct 1002 ms 19512 KB Output is correct
18 Correct 463 ms 19256 KB Output is correct
19 Correct 982 ms 19504 KB Output is correct
20 Correct 996 ms 19588 KB Output is correct
21 Correct 24 ms 19036 KB Output is correct
22 Correct 79 ms 19036 KB Output is correct
23 Correct 2 ms 10840 KB Output is correct
24 Correct 2143 ms 20888 KB Output is correct
25 Correct 845 ms 19684 KB Output is correct
26 Correct 2245 ms 22204 KB Output is correct
27 Correct 2163 ms 22144 KB Output is correct
28 Correct 22 ms 19264 KB Output is correct
29 Correct 85 ms 19256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 97 ms 19036 KB Output is correct
2 Correct 418 ms 23156 KB Output is correct
3 Correct 122 ms 26156 KB Output is correct
4 Correct 464 ms 31824 KB Output is correct
5 Correct 454 ms 31568 KB Output is correct
6 Correct 597 ms 34836 KB Output is correct
7 Correct 43 ms 19288 KB Output is correct
8 Correct 52 ms 19032 KB Output is correct
9 Correct 304 ms 32544 KB Output is correct
10 Correct 324 ms 26208 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 97 ms 19036 KB Output is correct
2 Correct 418 ms 23156 KB Output is correct
3 Correct 122 ms 26156 KB Output is correct
4 Correct 464 ms 31824 KB Output is correct
5 Correct 454 ms 31568 KB Output is correct
6 Correct 597 ms 34836 KB Output is correct
7 Correct 43 ms 19288 KB Output is correct
8 Correct 52 ms 19032 KB Output is correct
9 Correct 304 ms 32544 KB Output is correct
10 Correct 324 ms 26208 KB Output is correct
11 Correct 42 ms 19036 KB Output is correct
12 Correct 30 ms 19036 KB Output is correct
13 Correct 23 ms 19260 KB Output is correct
14 Correct 91 ms 19036 KB Output is correct
15 Correct 432 ms 23176 KB Output is correct
16 Correct 122 ms 26244 KB Output is correct
17 Correct 533 ms 31836 KB Output is correct
18 Correct 445 ms 31496 KB Output is correct
19 Correct 609 ms 32896 KB Output is correct
20 Correct 29 ms 19524 KB Output is correct
21 Correct 54 ms 19036 KB Output is correct
22 Correct 324 ms 34564 KB Output is correct
23 Correct 320 ms 26308 KB Output is correct
24 Correct 715 ms 25320 KB Output is correct
25 Correct 238 ms 25260 KB Output is correct
26 Correct 760 ms 32472 KB Output is correct
27 Correct 686 ms 31656 KB Output is correct
28 Correct 794 ms 35032 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 97 ms 19036 KB Output is correct
2 Correct 418 ms 23156 KB Output is correct
3 Correct 122 ms 26156 KB Output is correct
4 Correct 464 ms 31824 KB Output is correct
5 Correct 454 ms 31568 KB Output is correct
6 Correct 597 ms 34836 KB Output is correct
7 Correct 43 ms 19288 KB Output is correct
8 Correct 52 ms 19032 KB Output is correct
9 Correct 304 ms 32544 KB Output is correct
10 Correct 324 ms 26208 KB Output is correct
11 Correct 94 ms 19036 KB Output is correct
12 Correct 441 ms 23136 KB Output is correct
13 Correct 123 ms 26244 KB Output is correct
14 Correct 531 ms 31656 KB Output is correct
15 Correct 476 ms 31496 KB Output is correct
16 Correct 583 ms 33312 KB Output is correct
17 Correct 27 ms 19316 KB Output is correct
18 Correct 49 ms 19036 KB Output is correct
19 Correct 338 ms 33820 KB Output is correct
20 Correct 315 ms 26224 KB Output is correct
21 Correct 24 ms 19032 KB Output is correct
22 Correct 54 ms 19264 KB Output is correct
23 Correct 755 ms 28868 KB Output is correct
24 Correct 347 ms 31724 KB Output is correct
25 Correct 771 ms 34636 KB Output is correct
26 Correct 829 ms 31812 KB Output is correct
27 Correct 953 ms 32548 KB Output is correct
28 Correct 552 ms 24996 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 43 ms 19032 KB Output is correct
2 Correct 29 ms 19036 KB Output is correct
3 Correct 20 ms 19276 KB Output is correct
4 Correct 95 ms 19036 KB Output is correct
5 Correct 3 ms 11096 KB Output is correct
6 Correct 997 ms 19468 KB Output is correct
7 Correct 452 ms 19284 KB Output is correct
8 Correct 973 ms 19504 KB Output is correct
9 Correct 1016 ms 19828 KB Output is correct
10 Correct 23 ms 19036 KB Output is correct
11 Correct 50 ms 19268 KB Output is correct
12 Correct 97 ms 19036 KB Output is correct
13 Correct 418 ms 23156 KB Output is correct
14 Correct 122 ms 26156 KB Output is correct
15 Correct 464 ms 31824 KB Output is correct
16 Correct 454 ms 31568 KB Output is correct
17 Correct 597 ms 34836 KB Output is correct
18 Correct 43 ms 19288 KB Output is correct
19 Correct 52 ms 19032 KB Output is correct
20 Correct 304 ms 32544 KB Output is correct
21 Correct 324 ms 26208 KB Output is correct
22 Correct 42 ms 19036 KB Output is correct
23 Correct 30 ms 19036 KB Output is correct
24 Correct 23 ms 19260 KB Output is correct
25 Correct 91 ms 19036 KB Output is correct
26 Correct 432 ms 23176 KB Output is correct
27 Correct 122 ms 26244 KB Output is correct
28 Correct 533 ms 31836 KB Output is correct
29 Correct 445 ms 31496 KB Output is correct
30 Correct 609 ms 32896 KB Output is correct
31 Correct 29 ms 19524 KB Output is correct
32 Correct 54 ms 19036 KB Output is correct
33 Correct 324 ms 34564 KB Output is correct
34 Correct 320 ms 26308 KB Output is correct
35 Correct 715 ms 25320 KB Output is correct
36 Correct 238 ms 25260 KB Output is correct
37 Correct 760 ms 32472 KB Output is correct
38 Correct 686 ms 31656 KB Output is correct
39 Correct 794 ms 35032 KB Output is correct
40 Correct 94 ms 19036 KB Output is correct
41 Correct 441 ms 23136 KB Output is correct
42 Correct 123 ms 26244 KB Output is correct
43 Correct 531 ms 31656 KB Output is correct
44 Correct 476 ms 31496 KB Output is correct
45 Correct 583 ms 33312 KB Output is correct
46 Correct 27 ms 19316 KB Output is correct
47 Correct 49 ms 19036 KB Output is correct
48 Correct 338 ms 33820 KB Output is correct
49 Correct 315 ms 26224 KB Output is correct
50 Correct 24 ms 19032 KB Output is correct
51 Correct 54 ms 19264 KB Output is correct
52 Correct 755 ms 28868 KB Output is correct
53 Correct 347 ms 31724 KB Output is correct
54 Correct 771 ms 34636 KB Output is correct
55 Correct 829 ms 31812 KB Output is correct
56 Correct 953 ms 32548 KB Output is correct
57 Correct 552 ms 24996 KB Output is correct
58 Correct 43 ms 19036 KB Output is correct
59 Correct 31 ms 19248 KB Output is correct
60 Correct 15 ms 19272 KB Output is correct
61 Correct 95 ms 19256 KB Output is correct
62 Correct 2 ms 10844 KB Output is correct
63 Correct 963 ms 19508 KB Output is correct
64 Correct 484 ms 19388 KB Output is correct
65 Correct 985 ms 19480 KB Output is correct
66 Correct 1031 ms 19572 KB Output is correct
67 Correct 23 ms 19264 KB Output is correct
68 Correct 51 ms 19288 KB Output is correct
69 Correct 424 ms 23148 KB Output is correct
70 Correct 124 ms 26236 KB Output is correct
71 Correct 518 ms 31884 KB Output is correct
72 Correct 440 ms 31804 KB Output is correct
73 Correct 632 ms 32532 KB Output is correct
74 Correct 25 ms 19548 KB Output is correct
75 Correct 82 ms 19248 KB Output is correct
76 Correct 310 ms 34344 KB Output is correct
77 Correct 302 ms 26212 KB Output is correct
78 Correct 688 ms 25356 KB Output is correct
79 Correct 281 ms 25372 KB Output is correct
80 Correct 770 ms 32352 KB Output is correct
81 Correct 680 ms 31348 KB Output is correct
82 Correct 770 ms 32556 KB Output is correct
83 Correct 727 ms 28880 KB Output is correct
84 Correct 304 ms 31680 KB Output is correct
85 Correct 749 ms 33680 KB Output is correct
86 Correct 770 ms 31796 KB Output is correct
87 Correct 871 ms 34552 KB Output is correct
88 Correct 535 ms 25020 KB Output is correct
89 Correct 1093 ms 26012 KB Output is correct
90 Correct 1097 ms 29052 KB Output is correct
91 Correct 1141 ms 33572 KB Output is correct
92 Correct 1333 ms 33824 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 97 ms 19036 KB Output is correct
2 Correct 418 ms 23156 KB Output is correct
3 Correct 122 ms 26156 KB Output is correct
4 Correct 464 ms 31824 KB Output is correct
5 Correct 454 ms 31568 KB Output is correct
6 Correct 597 ms 34836 KB Output is correct
7 Correct 43 ms 19288 KB Output is correct
8 Correct 52 ms 19032 KB Output is correct
9 Correct 304 ms 32544 KB Output is correct
10 Correct 324 ms 26208 KB Output is correct
11 Correct 94 ms 19036 KB Output is correct
12 Correct 441 ms 23136 KB Output is correct
13 Correct 123 ms 26244 KB Output is correct
14 Correct 531 ms 31656 KB Output is correct
15 Correct 476 ms 31496 KB Output is correct
16 Correct 583 ms 33312 KB Output is correct
17 Correct 27 ms 19316 KB Output is correct
18 Correct 49 ms 19036 KB Output is correct
19 Correct 338 ms 33820 KB Output is correct
20 Correct 315 ms 26224 KB Output is correct
21 Correct 24 ms 19032 KB Output is correct
22 Correct 54 ms 19264 KB Output is correct
23 Correct 755 ms 28868 KB Output is correct
24 Correct 347 ms 31724 KB Output is correct
25 Correct 771 ms 34636 KB Output is correct
26 Correct 829 ms 31812 KB Output is correct
27 Correct 953 ms 32548 KB Output is correct
28 Correct 552 ms 24996 KB Output is correct
29 Correct 124 ms 19032 KB Output is correct
30 Correct 413 ms 23156 KB Output is correct
31 Correct 124 ms 26244 KB Output is correct
32 Correct 482 ms 31868 KB Output is correct
33 Correct 443 ms 31496 KB Output is correct
34 Correct 600 ms 34124 KB Output is correct
35 Correct 23 ms 19544 KB Output is correct
36 Correct 50 ms 19036 KB Output is correct
37 Correct 298 ms 33060 KB Output is correct
38 Correct 342 ms 26212 KB Output is correct
39 Correct 24 ms 19276 KB Output is correct
40 Correct 84 ms 19256 KB Output is correct
41 Correct 717 ms 28924 KB Output is correct
42 Correct 317 ms 31676 KB Output is correct
43 Correct 768 ms 32860 KB Output is correct
44 Correct 822 ms 31804 KB Output is correct
45 Correct 924 ms 35080 KB Output is correct
46 Correct 559 ms 25076 KB Output is correct
47 Correct 23 ms 19032 KB Output is correct
48 Correct 50 ms 19036 KB Output is correct
49 Correct 1485 ms 35112 KB Output is correct
50 Correct 610 ms 23648 KB Output is correct
51 Correct 1490 ms 32656 KB Output is correct
52 Correct 1561 ms 31080 KB Output is correct
53 Correct 1839 ms 34340 KB Output is correct
54 Correct 1262 ms 26360 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 43 ms 19032 KB Output is correct
2 Correct 29 ms 19036 KB Output is correct
3 Correct 20 ms 19276 KB Output is correct
4 Correct 95 ms 19036 KB Output is correct
5 Correct 3 ms 11096 KB Output is correct
6 Correct 997 ms 19468 KB Output is correct
7 Correct 452 ms 19284 KB Output is correct
8 Correct 973 ms 19504 KB Output is correct
9 Correct 1016 ms 19828 KB Output is correct
10 Correct 23 ms 19036 KB Output is correct
11 Correct 50 ms 19268 KB Output is correct
12 Correct 66 ms 19032 KB Output is correct
13 Correct 32 ms 19036 KB Output is correct
14 Correct 15 ms 19272 KB Output is correct
15 Correct 93 ms 19036 KB Output is correct
16 Correct 3 ms 10840 KB Output is correct
17 Correct 1002 ms 19512 KB Output is correct
18 Correct 463 ms 19256 KB Output is correct
19 Correct 982 ms 19504 KB Output is correct
20 Correct 996 ms 19588 KB Output is correct
21 Correct 24 ms 19036 KB Output is correct
22 Correct 79 ms 19036 KB Output is correct
23 Correct 2 ms 10840 KB Output is correct
24 Correct 2143 ms 20888 KB Output is correct
25 Correct 845 ms 19684 KB Output is correct
26 Correct 2245 ms 22204 KB Output is correct
27 Correct 2163 ms 22144 KB Output is correct
28 Correct 22 ms 19264 KB Output is correct
29 Correct 85 ms 19256 KB Output is correct
30 Correct 97 ms 19036 KB Output is correct
31 Correct 418 ms 23156 KB Output is correct
32 Correct 122 ms 26156 KB Output is correct
33 Correct 464 ms 31824 KB Output is correct
34 Correct 454 ms 31568 KB Output is correct
35 Correct 597 ms 34836 KB Output is correct
36 Correct 43 ms 19288 KB Output is correct
37 Correct 52 ms 19032 KB Output is correct
38 Correct 304 ms 32544 KB Output is correct
39 Correct 324 ms 26208 KB Output is correct
40 Correct 42 ms 19036 KB Output is correct
41 Correct 30 ms 19036 KB Output is correct
42 Correct 23 ms 19260 KB Output is correct
43 Correct 91 ms 19036 KB Output is correct
44 Correct 432 ms 23176 KB Output is correct
45 Correct 122 ms 26244 KB Output is correct
46 Correct 533 ms 31836 KB Output is correct
47 Correct 445 ms 31496 KB Output is correct
48 Correct 609 ms 32896 KB Output is correct
49 Correct 29 ms 19524 KB Output is correct
50 Correct 54 ms 19036 KB Output is correct
51 Correct 324 ms 34564 KB Output is correct
52 Correct 320 ms 26308 KB Output is correct
53 Correct 715 ms 25320 KB Output is correct
54 Correct 238 ms 25260 KB Output is correct
55 Correct 760 ms 32472 KB Output is correct
56 Correct 686 ms 31656 KB Output is correct
57 Correct 794 ms 35032 KB Output is correct
58 Correct 94 ms 19036 KB Output is correct
59 Correct 441 ms 23136 KB Output is correct
60 Correct 123 ms 26244 KB Output is correct
61 Correct 531 ms 31656 KB Output is correct
62 Correct 476 ms 31496 KB Output is correct
63 Correct 583 ms 33312 KB Output is correct
64 Correct 27 ms 19316 KB Output is correct
65 Correct 49 ms 19036 KB Output is correct
66 Correct 338 ms 33820 KB Output is correct
67 Correct 315 ms 26224 KB Output is correct
68 Correct 24 ms 19032 KB Output is correct
69 Correct 54 ms 19264 KB Output is correct
70 Correct 755 ms 28868 KB Output is correct
71 Correct 347 ms 31724 KB Output is correct
72 Correct 771 ms 34636 KB Output is correct
73 Correct 829 ms 31812 KB Output is correct
74 Correct 953 ms 32548 KB Output is correct
75 Correct 552 ms 24996 KB Output is correct
76 Correct 43 ms 19036 KB Output is correct
77 Correct 31 ms 19248 KB Output is correct
78 Correct 15 ms 19272 KB Output is correct
79 Correct 95 ms 19256 KB Output is correct
80 Correct 2 ms 10844 KB Output is correct
81 Correct 963 ms 19508 KB Output is correct
82 Correct 484 ms 19388 KB Output is correct
83 Correct 985 ms 19480 KB Output is correct
84 Correct 1031 ms 19572 KB Output is correct
85 Correct 23 ms 19264 KB Output is correct
86 Correct 51 ms 19288 KB Output is correct
87 Correct 424 ms 23148 KB Output is correct
88 Correct 124 ms 26236 KB Output is correct
89 Correct 518 ms 31884 KB Output is correct
90 Correct 440 ms 31804 KB Output is correct
91 Correct 632 ms 32532 KB Output is correct
92 Correct 25 ms 19548 KB Output is correct
93 Correct 82 ms 19248 KB Output is correct
94 Correct 310 ms 34344 KB Output is correct
95 Correct 302 ms 26212 KB Output is correct
96 Correct 688 ms 25356 KB Output is correct
97 Correct 281 ms 25372 KB Output is correct
98 Correct 770 ms 32352 KB Output is correct
99 Correct 680 ms 31348 KB Output is correct
100 Correct 770 ms 32556 KB Output is correct
101 Correct 727 ms 28880 KB Output is correct
102 Correct 304 ms 31680 KB Output is correct
103 Correct 749 ms 33680 KB Output is correct
104 Correct 770 ms 31796 KB Output is correct
105 Correct 871 ms 34552 KB Output is correct
106 Correct 535 ms 25020 KB Output is correct
107 Correct 1093 ms 26012 KB Output is correct
108 Correct 1097 ms 29052 KB Output is correct
109 Correct 1141 ms 33572 KB Output is correct
110 Correct 1333 ms 33824 KB Output is correct
111 Correct 124 ms 19032 KB Output is correct
112 Correct 413 ms 23156 KB Output is correct
113 Correct 124 ms 26244 KB Output is correct
114 Correct 482 ms 31868 KB Output is correct
115 Correct 443 ms 31496 KB Output is correct
116 Correct 600 ms 34124 KB Output is correct
117 Correct 23 ms 19544 KB Output is correct
118 Correct 50 ms 19036 KB Output is correct
119 Correct 298 ms 33060 KB Output is correct
120 Correct 342 ms 26212 KB Output is correct
121 Correct 24 ms 19276 KB Output is correct
122 Correct 84 ms 19256 KB Output is correct
123 Correct 717 ms 28924 KB Output is correct
124 Correct 317 ms 31676 KB Output is correct
125 Correct 768 ms 32860 KB Output is correct
126 Correct 822 ms 31804 KB Output is correct
127 Correct 924 ms 35080 KB Output is correct
128 Correct 559 ms 25076 KB Output is correct
129 Correct 23 ms 19032 KB Output is correct
130 Correct 50 ms 19036 KB Output is correct
131 Correct 1485 ms 35112 KB Output is correct
132 Correct 610 ms 23648 KB Output is correct
133 Correct 1490 ms 32656 KB Output is correct
134 Correct 1561 ms 31080 KB Output is correct
135 Correct 1839 ms 34340 KB Output is correct
136 Correct 1262 ms 26360 KB Output is correct
137 Correct 45 ms 19272 KB Output is correct
138 Correct 32 ms 19032 KB Output is correct
139 Correct 15 ms 19032 KB Output is correct
140 Correct 100 ms 19288 KB Output is correct
141 Correct 2 ms 10840 KB Output is correct
142 Correct 1020 ms 19464 KB Output is correct
143 Correct 432 ms 19284 KB Output is correct
144 Correct 1002 ms 19476 KB Output is correct
145 Correct 989 ms 19588 KB Output is correct
146 Correct 25 ms 19036 KB Output is correct
147 Correct 46 ms 19036 KB Output is correct
148 Correct 2 ms 10844 KB Output is correct
149 Correct 2060 ms 20884 KB Output is correct
150 Correct 765 ms 19680 KB Output is correct
151 Correct 2027 ms 22184 KB Output is correct
152 Correct 2096 ms 22284 KB Output is correct
153 Correct 23 ms 19036 KB Output is correct
154 Correct 49 ms 19036 KB Output is correct
155 Correct 423 ms 23152 KB Output is correct
156 Correct 121 ms 26152 KB Output is correct
157 Correct 471 ms 31692 KB Output is correct
158 Correct 444 ms 31480 KB Output is correct
159 Correct 560 ms 34592 KB Output is correct
160 Correct 28 ms 19548 KB Output is correct
161 Correct 48 ms 19036 KB Output is correct
162 Correct 315 ms 34548 KB Output is correct
163 Correct 312 ms 26104 KB Output is correct
164 Correct 735 ms 28900 KB Output is correct
165 Correct 332 ms 31704 KB Output is correct
166 Correct 767 ms 33804 KB Output is correct
167 Correct 847 ms 31804 KB Output is correct
168 Correct 971 ms 35096 KB Output is correct
169 Correct 600 ms 25056 KB Output is correct
170 Correct 652 ms 25312 KB Output is correct
171 Correct 250 ms 25204 KB Output is correct
172 Correct 788 ms 32352 KB Output is correct
173 Correct 696 ms 31380 KB Output is correct
174 Correct 814 ms 34128 KB Output is correct
175 Correct 1194 ms 25916 KB Output is correct
176 Correct 1163 ms 29052 KB Output is correct
177 Correct 1121 ms 34560 KB Output is correct
178 Correct 1318 ms 35084 KB Output is correct
179 Correct 1526 ms 33276 KB Output is correct
180 Correct 628 ms 23632 KB Output is correct
181 Correct 1463 ms 32888 KB Output is correct
182 Correct 1583 ms 31076 KB Output is correct
183 Correct 1985 ms 33832 KB Output is correct
184 Correct 1314 ms 26244 KB Output is correct
185 Correct 2407 ms 32008 KB Output is correct
186 Correct 2427 ms 31288 KB Output is correct
187 Correct 2707 ms 31676 KB Output is correct
188 Correct 2665 ms 33788 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 97 ms 19036 KB Output is correct
2 Correct 418 ms 23156 KB Output is correct
3 Correct 122 ms 26156 KB Output is correct
4 Correct 464 ms 31824 KB Output is correct
5 Correct 454 ms 31568 KB Output is correct
6 Correct 597 ms 34836 KB Output is correct
7 Correct 43 ms 19288 KB Output is correct
8 Correct 52 ms 19032 KB Output is correct
9 Correct 304 ms 32544 KB Output is correct
10 Correct 324 ms 26208 KB Output is correct
11 Correct 94 ms 19036 KB Output is correct
12 Correct 441 ms 23136 KB Output is correct
13 Correct 123 ms 26244 KB Output is correct
14 Correct 531 ms 31656 KB Output is correct
15 Correct 476 ms 31496 KB Output is correct
16 Correct 583 ms 33312 KB Output is correct
17 Correct 27 ms 19316 KB Output is correct
18 Correct 49 ms 19036 KB Output is correct
19 Correct 338 ms 33820 KB Output is correct
20 Correct 315 ms 26224 KB Output is correct
21 Correct 24 ms 19032 KB Output is correct
22 Correct 54 ms 19264 KB Output is correct
23 Correct 755 ms 28868 KB Output is correct
24 Correct 347 ms 31724 KB Output is correct
25 Correct 771 ms 34636 KB Output is correct
26 Correct 829 ms 31812 KB Output is correct
27 Correct 953 ms 32548 KB Output is correct
28 Correct 552 ms 24996 KB Output is correct
29 Correct 124 ms 19032 KB Output is correct
30 Correct 413 ms 23156 KB Output is correct
31 Correct 124 ms 26244 KB Output is correct
32 Correct 482 ms 31868 KB Output is correct
33 Correct 443 ms 31496 KB Output is correct
34 Correct 600 ms 34124 KB Output is correct
35 Correct 23 ms 19544 KB Output is correct
36 Correct 50 ms 19036 KB Output is correct
37 Correct 298 ms 33060 KB Output is correct
38 Correct 342 ms 26212 KB Output is correct
39 Correct 24 ms 19276 KB Output is correct
40 Correct 84 ms 19256 KB Output is correct
41 Correct 717 ms 28924 KB Output is correct
42 Correct 317 ms 31676 KB Output is correct
43 Correct 768 ms 32860 KB Output is correct
44 Correct 822 ms 31804 KB Output is correct
45 Correct 924 ms 35080 KB Output is correct
46 Correct 559 ms 25076 KB Output is correct
47 Correct 23 ms 19032 KB Output is correct
48 Correct 50 ms 19036 KB Output is correct
49 Correct 1485 ms 35112 KB Output is correct
50 Correct 610 ms 23648 KB Output is correct
51 Correct 1490 ms 32656 KB Output is correct
52 Correct 1561 ms 31080 KB Output is correct
53 Correct 1839 ms 34340 KB Output is correct
54 Correct 1262 ms 26360 KB Output is correct
55 Correct 92 ms 19036 KB Output is correct
56 Correct 536 ms 23124 KB Output is correct
57 Correct 131 ms 26244 KB Output is correct
58 Correct 512 ms 31764 KB Output is correct
59 Correct 448 ms 31504 KB Output is correct
60 Correct 612 ms 32540 KB Output is correct
61 Correct 26 ms 19548 KB Output is correct
62 Correct 100 ms 19036 KB Output is correct
63 Correct 334 ms 32624 KB Output is correct
64 Correct 298 ms 26204 KB Output is correct
65 Correct 23 ms 19036 KB Output is correct
66 Correct 50 ms 19036 KB Output is correct
67 Correct 742 ms 28960 KB Output is correct
68 Correct 321 ms 31716 KB Output is correct
69 Correct 751 ms 32928 KB Output is correct
70 Correct 777 ms 31784 KB Output is correct
71 Correct 905 ms 33560 KB Output is correct
72 Correct 572 ms 24996 KB Output is correct
73 Correct 23 ms 19036 KB Output is correct
74 Correct 49 ms 19036 KB Output is correct
75 Correct 1441 ms 32568 KB Output is correct
76 Correct 656 ms 23656 KB Output is correct
77 Correct 1537 ms 35616 KB Output is correct
78 Correct 1595 ms 31052 KB Output is correct
79 Correct 1838 ms 32540 KB Output is correct
80 Correct 1270 ms 26296 KB Output is correct
81 Correct 4419 ms 30260 KB Output is correct
82 Correct 2004 ms 23008 KB Output is correct
83 Correct 4449 ms 33288 KB Output is correct
84 Correct 4763 ms 34820 KB Output is correct
85 Correct 42 ms 19284 KB Output is correct
86 Correct 47 ms 19292 KB Output is correct
87 Correct 3909 ms 28944 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 43 ms 19032 KB Output is correct
2 Correct 29 ms 19036 KB Output is correct
3 Correct 20 ms 19276 KB Output is correct
4 Correct 95 ms 19036 KB Output is correct
5 Correct 3 ms 11096 KB Output is correct
6 Correct 997 ms 19468 KB Output is correct
7 Correct 452 ms 19284 KB Output is correct
8 Correct 973 ms 19504 KB Output is correct
9 Correct 1016 ms 19828 KB Output is correct
10 Correct 23 ms 19036 KB Output is correct
11 Correct 50 ms 19268 KB Output is correct
12 Correct 66 ms 19032 KB Output is correct
13 Correct 32 ms 19036 KB Output is correct
14 Correct 15 ms 19272 KB Output is correct
15 Correct 93 ms 19036 KB Output is correct
16 Correct 3 ms 10840 KB Output is correct
17 Correct 1002 ms 19512 KB Output is correct
18 Correct 463 ms 19256 KB Output is correct
19 Correct 982 ms 19504 KB Output is correct
20 Correct 996 ms 19588 KB Output is correct
21 Correct 24 ms 19036 KB Output is correct
22 Correct 79 ms 19036 KB Output is correct
23 Correct 2 ms 10840 KB Output is correct
24 Correct 2143 ms 20888 KB Output is correct
25 Correct 845 ms 19684 KB Output is correct
26 Correct 2245 ms 22204 KB Output is correct
27 Correct 2163 ms 22144 KB Output is correct
28 Correct 22 ms 19264 KB Output is correct
29 Correct 85 ms 19256 KB Output is correct
30 Correct 97 ms 19036 KB Output is correct
31 Correct 418 ms 23156 KB Output is correct
32 Correct 122 ms 26156 KB Output is correct
33 Correct 464 ms 31824 KB Output is correct
34 Correct 454 ms 31568 KB Output is correct
35 Correct 597 ms 34836 KB Output is correct
36 Correct 43 ms 19288 KB Output is correct
37 Correct 52 ms 19032 KB Output is correct
38 Correct 304 ms 32544 KB Output is correct
39 Correct 324 ms 26208 KB Output is correct
40 Correct 42 ms 19036 KB Output is correct
41 Correct 30 ms 19036 KB Output is correct
42 Correct 23 ms 19260 KB Output is correct
43 Correct 91 ms 19036 KB Output is correct
44 Correct 432 ms 23176 KB Output is correct
45 Correct 122 ms 26244 KB Output is correct
46 Correct 533 ms 31836 KB Output is correct
47 Correct 445 ms 31496 KB Output is correct
48 Correct 609 ms 32896 KB Output is correct
49 Correct 29 ms 19524 KB Output is correct
50 Correct 54 ms 19036 KB Output is correct
51 Correct 324 ms 34564 KB Output is correct
52 Correct 320 ms 26308 KB Output is correct
53 Correct 715 ms 25320 KB Output is correct
54 Correct 238 ms 25260 KB Output is correct
55 Correct 760 ms 32472 KB Output is correct
56 Correct 686 ms 31656 KB Output is correct
57 Correct 794 ms 35032 KB Output is correct
58 Correct 94 ms 19036 KB Output is correct
59 Correct 441 ms 23136 KB Output is correct
60 Correct 123 ms 26244 KB Output is correct
61 Correct 531 ms 31656 KB Output is correct
62 Correct 476 ms 31496 KB Output is correct
63 Correct 583 ms 33312 KB Output is correct
64 Correct 27 ms 19316 KB Output is correct
65 Correct 49 ms 19036 KB Output is correct
66 Correct 338 ms 33820 KB Output is correct
67 Correct 315 ms 26224 KB Output is correct
68 Correct 24 ms 19032 KB Output is correct
69 Correct 54 ms 19264 KB Output is correct
70 Correct 755 ms 28868 KB Output is correct
71 Correct 347 ms 31724 KB Output is correct
72 Correct 771 ms 34636 KB Output is correct
73 Correct 829 ms 31812 KB Output is correct
74 Correct 953 ms 32548 KB Output is correct
75 Correct 552 ms 24996 KB Output is correct
76 Correct 43 ms 19036 KB Output is correct
77 Correct 31 ms 19248 KB Output is correct
78 Correct 15 ms 19272 KB Output is correct
79 Correct 95 ms 19256 KB Output is correct
80 Correct 2 ms 10844 KB Output is correct
81 Correct 963 ms 19508 KB Output is correct
82 Correct 484 ms 19388 KB Output is correct
83 Correct 985 ms 19480 KB Output is correct
84 Correct 1031 ms 19572 KB Output is correct
85 Correct 23 ms 19264 KB Output is correct
86 Correct 51 ms 19288 KB Output is correct
87 Correct 424 ms 23148 KB Output is correct
88 Correct 124 ms 26236 KB Output is correct
89 Correct 518 ms 31884 KB Output is correct
90 Correct 440 ms 31804 KB Output is correct
91 Correct 632 ms 32532 KB Output is correct
92 Correct 25 ms 19548 KB Output is correct
93 Correct 82 ms 19248 KB Output is correct
94 Correct 310 ms 34344 KB Output is correct
95 Correct 302 ms 26212 KB Output is correct
96 Correct 688 ms 25356 KB Output is correct
97 Correct 281 ms 25372 KB Output is correct
98 Correct 770 ms 32352 KB Output is correct
99 Correct 680 ms 31348 KB Output is correct
100 Correct 770 ms 32556 KB Output is correct
101 Correct 727 ms 28880 KB Output is correct
102 Correct 304 ms 31680 KB Output is correct
103 Correct 749 ms 33680 KB Output is correct
104 Correct 770 ms 31796 KB Output is correct
105 Correct 871 ms 34552 KB Output is correct
106 Correct 535 ms 25020 KB Output is correct
107 Correct 1093 ms 26012 KB Output is correct
108 Correct 1097 ms 29052 KB Output is correct
109 Correct 1141 ms 33572 KB Output is correct
110 Correct 1333 ms 33824 KB Output is correct
111 Correct 124 ms 19032 KB Output is correct
112 Correct 413 ms 23156 KB Output is correct
113 Correct 124 ms 26244 KB Output is correct
114 Correct 482 ms 31868 KB Output is correct
115 Correct 443 ms 31496 KB Output is correct
116 Correct 600 ms 34124 KB Output is correct
117 Correct 23 ms 19544 KB Output is correct
118 Correct 50 ms 19036 KB Output is correct
119 Correct 298 ms 33060 KB Output is correct
120 Correct 342 ms 26212 KB Output is correct
121 Correct 24 ms 19276 KB Output is correct
122 Correct 84 ms 19256 KB Output is correct
123 Correct 717 ms 28924 KB Output is correct
124 Correct 317 ms 31676 KB Output is correct
125 Correct 768 ms 32860 KB Output is correct
126 Correct 822 ms 31804 KB Output is correct
127 Correct 924 ms 35080 KB Output is correct
128 Correct 559 ms 25076 KB Output is correct
129 Correct 23 ms 19032 KB Output is correct
130 Correct 50 ms 19036 KB Output is correct
131 Correct 1485 ms 35112 KB Output is correct
132 Correct 610 ms 23648 KB Output is correct
133 Correct 1490 ms 32656 KB Output is correct
134 Correct 1561 ms 31080 KB Output is correct
135 Correct 1839 ms 34340 KB Output is correct
136 Correct 1262 ms 26360 KB Output is correct
137 Correct 45 ms 19272 KB Output is correct
138 Correct 32 ms 19032 KB Output is correct
139 Correct 15 ms 19032 KB Output is correct
140 Correct 100 ms 19288 KB Output is correct
141 Correct 2 ms 10840 KB Output is correct
142 Correct 1020 ms 19464 KB Output is correct
143 Correct 432 ms 19284 KB Output is correct
144 Correct 1002 ms 19476 KB Output is correct
145 Correct 989 ms 19588 KB Output is correct
146 Correct 25 ms 19036 KB Output is correct
147 Correct 46 ms 19036 KB Output is correct
148 Correct 2 ms 10844 KB Output is correct
149 Correct 2060 ms 20884 KB Output is correct
150 Correct 765 ms 19680 KB Output is correct
151 Correct 2027 ms 22184 KB Output is correct
152 Correct 2096 ms 22284 KB Output is correct
153 Correct 23 ms 19036 KB Output is correct
154 Correct 49 ms 19036 KB Output is correct
155 Correct 423 ms 23152 KB Output is correct
156 Correct 121 ms 26152 KB Output is correct
157 Correct 471 ms 31692 KB Output is correct
158 Correct 444 ms 31480 KB Output is correct
159 Correct 560 ms 34592 KB Output is correct
160 Correct 28 ms 19548 KB Output is correct
161 Correct 48 ms 19036 KB Output is correct
162 Correct 315 ms 34548 KB Output is correct
163 Correct 312 ms 26104 KB Output is correct
164 Correct 735 ms 28900 KB Output is correct
165 Correct 332 ms 31704 KB Output is correct
166 Correct 767 ms 33804 KB Output is correct
167 Correct 847 ms 31804 KB Output is correct
168 Correct 971 ms 35096 KB Output is correct
169 Correct 600 ms 25056 KB Output is correct
170 Correct 652 ms 25312 KB Output is correct
171 Correct 250 ms 25204 KB Output is correct
172 Correct 788 ms 32352 KB Output is correct
173 Correct 696 ms 31380 KB Output is correct
174 Correct 814 ms 34128 KB Output is correct
175 Correct 1194 ms 25916 KB Output is correct
176 Correct 1163 ms 29052 KB Output is correct
177 Correct 1121 ms 34560 KB Output is correct
178 Correct 1318 ms 35084 KB Output is correct
179 Correct 1526 ms 33276 KB Output is correct
180 Correct 628 ms 23632 KB Output is correct
181 Correct 1463 ms 32888 KB Output is correct
182 Correct 1583 ms 31076 KB Output is correct
183 Correct 1985 ms 33832 KB Output is correct
184 Correct 1314 ms 26244 KB Output is correct
185 Correct 2407 ms 32008 KB Output is correct
186 Correct 2427 ms 31288 KB Output is correct
187 Correct 2707 ms 31676 KB Output is correct
188 Correct 2665 ms 33788 KB Output is correct
189 Correct 92 ms 19036 KB Output is correct
190 Correct 536 ms 23124 KB Output is correct
191 Correct 131 ms 26244 KB Output is correct
192 Correct 512 ms 31764 KB Output is correct
193 Correct 448 ms 31504 KB Output is correct
194 Correct 612 ms 32540 KB Output is correct
195 Correct 26 ms 19548 KB Output is correct
196 Correct 100 ms 19036 KB Output is correct
197 Correct 334 ms 32624 KB Output is correct
198 Correct 298 ms 26204 KB Output is correct
199 Correct 23 ms 19036 KB Output is correct
200 Correct 50 ms 19036 KB Output is correct
201 Correct 742 ms 28960 KB Output is correct
202 Correct 321 ms 31716 KB Output is correct
203 Correct 751 ms 32928 KB Output is correct
204 Correct 777 ms 31784 KB Output is correct
205 Correct 905 ms 33560 KB Output is correct
206 Correct 572 ms 24996 KB Output is correct
207 Correct 23 ms 19036 KB Output is correct
208 Correct 49 ms 19036 KB Output is correct
209 Correct 1441 ms 32568 KB Output is correct
210 Correct 656 ms 23656 KB Output is correct
211 Correct 1537 ms 35616 KB Output is correct
212 Correct 1595 ms 31052 KB Output is correct
213 Correct 1838 ms 32540 KB Output is correct
214 Correct 1270 ms 26296 KB Output is correct
215 Correct 4419 ms 30260 KB Output is correct
216 Correct 2004 ms 23008 KB Output is correct
217 Correct 4449 ms 33288 KB Output is correct
218 Correct 4763 ms 34820 KB Output is correct
219 Correct 42 ms 19284 KB Output is correct
220 Correct 47 ms 19292 KB Output is correct
221 Correct 3909 ms 28944 KB Output is correct
222 Correct 89 ms 19036 KB Output is correct
223 Correct 438 ms 23108 KB Output is correct
224 Correct 133 ms 26232 KB Output is correct
225 Correct 485 ms 31720 KB Output is correct
226 Correct 476 ms 31528 KB Output is correct
227 Correct 606 ms 32504 KB Output is correct
228 Correct 25 ms 19544 KB Output is correct
229 Correct 87 ms 19268 KB Output is correct
230 Correct 354 ms 35104 KB Output is correct
231 Correct 307 ms 26252 KB Output is correct
232 Correct 23 ms 19276 KB Output is correct
233 Correct 47 ms 19036 KB Output is correct
234 Correct 821 ms 28904 KB Output is correct
235 Correct 354 ms 31676 KB Output is correct
236 Correct 808 ms 34032 KB Output is correct
237 Correct 840 ms 31816 KB Output is correct
238 Correct 973 ms 34596 KB Output is correct
239 Correct 571 ms 25056 KB Output is correct
240 Correct 40 ms 19160 KB Output is correct
241 Correct 91 ms 19036 KB Output is correct
242 Correct 1445 ms 34580 KB Output is correct
243 Correct 634 ms 23636 KB Output is correct
244 Correct 1568 ms 33528 KB Output is correct
245 Correct 1556 ms 31268 KB Output is correct
246 Correct 1968 ms 33128 KB Output is correct
247 Correct 1339 ms 26292 KB Output is correct
248 Correct 72 ms 19252 KB Output is correct
249 Correct 34 ms 19032 KB Output is correct
250 Correct 13 ms 19276 KB Output is correct
251 Correct 2 ms 10844 KB Output is correct
252 Correct 977 ms 19500 KB Output is correct
253 Correct 445 ms 19284 KB Output is correct
254 Correct 978 ms 19492 KB Output is correct
255 Correct 1008 ms 19592 KB Output is correct
256 Correct 2 ms 10844 KB Output is correct
257 Correct 2100 ms 20884 KB Output is correct
258 Correct 817 ms 19920 KB Output is correct
259 Correct 2132 ms 22140 KB Output is correct
260 Correct 2167 ms 22164 KB Output is correct
261 Correct 733 ms 25272 KB Output is correct
262 Correct 259 ms 25248 KB Output is correct
263 Correct 754 ms 32380 KB Output is correct
264 Correct 709 ms 31372 KB Output is correct
265 Correct 811 ms 33828 KB Output is correct
266 Correct 1180 ms 25968 KB Output is correct
267 Correct 1148 ms 28864 KB Output is correct
268 Correct 1207 ms 33452 KB Output is correct
269 Correct 1320 ms 32548 KB Output is correct
270 Correct 2179 ms 31984 KB Output is correct
271 Correct 2433 ms 31292 KB Output is correct
272 Correct 2647 ms 31528 KB Output is correct
273 Correct 2722 ms 33572 KB Output is correct
274 Correct 4487 ms 30032 KB Output is correct
275 Correct 2160 ms 23076 KB Output is correct
276 Correct 4681 ms 37956 KB Output is correct
277 Correct 4620 ms 34568 KB Output is correct
278 Correct 23 ms 19292 KB Output is correct
279 Correct 51 ms 19268 KB Output is correct
280 Correct 3808 ms 28960 KB Output is correct
281 Execution timed out 5097 ms 27184 KB Time limit exceeded
282 Halted 0 ms 0 KB -