답안 #910119

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
910119 2024-01-17T23:20:30 Z Tigerpants Uplifting Excursion (BOI22_vault) C++17
100 / 100
954 ms 3668 KB
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <set>
#include <map>

using namespace std;

typedef long long int ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;

#define rep(i, a, b) for (ll i = a; i < b; i++)
#define rev_rep(i, a, b) for (ll i = a; i >= b; i--)
#define sz(a) (ll) a.size()
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define trav(itr, a, t) for (t::iterator itr = a.begin(); itr != a.end(); itr++)

const ll MAXM = 300LL;
const ll MAXB = MAXM * (2 * MAXM + 1LL);
const ll INF = 1'000'000'000'000'000'000LL;

ll M, L;
vll A;
vll in_greedy;

void reduce(vll& res, ll x, ll multiplier = 1) {
    res.clear();
    while (x) {
        res.pb(multiplier);
        x--;
        if (x & 1LL) {
            res.pb(multiplier);
            x--;
        }
        x >>= 1LL;
        multiplier *= 2LL;
    }
}

int main() {
    cin.tie(NULL)->sync_with_stdio(false);

    cin >> M >> L;
    A.resize(2 * M + 1);
    rep(i, 0, 2 * M + 1) cin >> A[i];

    ll s = 0LL;
    rep(i, -M, M + 1) {
        s += A[i + M] * i;
    }
    if (s < L) { // reverse the problem
        rep(i, 1, M + 1) swap(A[M - i], A[M + i]);
        L *= -1;
    }

    // greedy
    in_greedy.resize(M + 1, 0);
    s = 0LL;
    ll n = 0LL;
    rep(i, -M, 1) {
        s += A[i + M] * i;
        n += A[i + M];
    }
    rep(i, 1, M + 1) {
        in_greedy[i] = max<ll>(0LL, min<ll>((L - s) / i, A[i + M]));
        s += in_greedy[i] * i;
        n += in_greedy[i];
    }

    // dp
    ll dp[2 * MAXB + 1];
    rep(i, 0, 2 * MAXB + 1) dp[i] = -INF;
    if ((L - s >= -MAXB) && (L - s <= MAXB)) dp[MAXB + (L - s)] = n; // base case

    vll deltas;

    rep(w, 1, M + 1) {
        // add w
        reduce(deltas, min<ll>(2 * M, A[w + M] - in_greedy[w]));
        trav(delta, deltas, vll) {
            rep(i, - MAXB, MAXB + 1 - (*delta) * w) {
                dp[i + MAXB] = max<ll>(dp[i + MAXB], dp[i + MAXB + (*delta) * w] + (*delta));
            }
        }

        // remove w
        reduce(deltas, min<ll>(2 * M, in_greedy[w]), -1);
        trav(delta, deltas, vll) {
            rev_rep(i, MAXB, - MAXB - (*delta) * w) {
                dp[i + MAXB] = max<ll>(dp[i + MAXB], dp[i + MAXB + (*delta) * w] + (*delta));
            }
        }
    }

    if (dp[MAXB] < 0) {
        cout << "impossible" << endl;
    } else {
        cout << dp[MAXB] << endl;
    }

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 3160 KB Output is correct
2 Correct 3 ms 3164 KB Output is correct
3 Correct 3 ms 3164 KB Output is correct
4 Correct 10 ms 3132 KB Output is correct
5 Correct 75 ms 3244 KB Output is correct
6 Correct 85 ms 3252 KB Output is correct
7 Correct 51 ms 3160 KB Output is correct
8 Correct 78 ms 3252 KB Output is correct
9 Correct 102 ms 3164 KB Output is correct
10 Correct 6 ms 3164 KB Output is correct
11 Correct 9 ms 3268 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 3160 KB Output is correct
2 Correct 3 ms 3164 KB Output is correct
3 Correct 3 ms 3164 KB Output is correct
4 Correct 10 ms 3132 KB Output is correct
5 Correct 75 ms 3244 KB Output is correct
6 Correct 85 ms 3252 KB Output is correct
7 Correct 51 ms 3160 KB Output is correct
8 Correct 78 ms 3252 KB Output is correct
9 Correct 102 ms 3164 KB Output is correct
10 Correct 6 ms 3164 KB Output is correct
11 Correct 9 ms 3268 KB Output is correct
12 Correct 3 ms 3160 KB Output is correct
13 Correct 4 ms 3160 KB Output is correct
14 Correct 3 ms 3160 KB Output is correct
15 Correct 11 ms 3160 KB Output is correct
16 Correct 79 ms 3160 KB Output is correct
17 Correct 78 ms 3160 KB Output is correct
18 Correct 42 ms 3244 KB Output is correct
19 Correct 79 ms 3160 KB Output is correct
20 Correct 103 ms 3248 KB Output is correct
21 Correct 10 ms 3160 KB Output is correct
22 Correct 9 ms 3164 KB Output is correct
23 Correct 206 ms 3272 KB Output is correct
24 Correct 193 ms 3248 KB Output is correct
25 Correct 77 ms 3160 KB Output is correct
26 Correct 218 ms 3412 KB Output is correct
27 Correct 221 ms 3264 KB Output is correct
28 Correct 7 ms 3164 KB Output is correct
29 Correct 10 ms 3280 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 3164 KB Output is correct
2 Correct 59 ms 3240 KB Output is correct
3 Correct 18 ms 3164 KB Output is correct
4 Correct 58 ms 3244 KB Output is correct
5 Correct 65 ms 3256 KB Output is correct
6 Correct 47 ms 3164 KB Output is correct
7 Correct 9 ms 3164 KB Output is correct
8 Correct 8 ms 3164 KB Output is correct
9 Correct 26 ms 3164 KB Output is correct
10 Correct 40 ms 3160 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 3164 KB Output is correct
2 Correct 59 ms 3240 KB Output is correct
3 Correct 18 ms 3164 KB Output is correct
4 Correct 58 ms 3244 KB Output is correct
5 Correct 65 ms 3256 KB Output is correct
6 Correct 47 ms 3164 KB Output is correct
7 Correct 9 ms 3164 KB Output is correct
8 Correct 8 ms 3164 KB Output is correct
9 Correct 26 ms 3164 KB Output is correct
10 Correct 40 ms 3160 KB Output is correct
11 Correct 3 ms 3160 KB Output is correct
12 Correct 3 ms 3272 KB Output is correct
13 Correct 3 ms 3164 KB Output is correct
14 Correct 10 ms 3160 KB Output is correct
15 Correct 59 ms 3248 KB Output is correct
16 Correct 19 ms 3164 KB Output is correct
17 Correct 58 ms 3164 KB Output is correct
18 Correct 68 ms 3244 KB Output is correct
19 Correct 48 ms 3160 KB Output is correct
20 Correct 9 ms 3164 KB Output is correct
21 Correct 8 ms 3164 KB Output is correct
22 Correct 26 ms 3164 KB Output is correct
23 Correct 39 ms 3164 KB Output is correct
24 Correct 55 ms 3160 KB Output is correct
25 Correct 21 ms 3164 KB Output is correct
26 Correct 65 ms 3244 KB Output is correct
27 Correct 57 ms 3164 KB Output is correct
28 Correct 54 ms 3240 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 3164 KB Output is correct
2 Correct 59 ms 3240 KB Output is correct
3 Correct 18 ms 3164 KB Output is correct
4 Correct 58 ms 3244 KB Output is correct
5 Correct 65 ms 3256 KB Output is correct
6 Correct 47 ms 3164 KB Output is correct
7 Correct 9 ms 3164 KB Output is correct
8 Correct 8 ms 3164 KB Output is correct
9 Correct 26 ms 3164 KB Output is correct
10 Correct 40 ms 3160 KB Output is correct
11 Correct 10 ms 3164 KB Output is correct
12 Correct 54 ms 3164 KB Output is correct
13 Correct 19 ms 3164 KB Output is correct
14 Correct 59 ms 3164 KB Output is correct
15 Correct 63 ms 3252 KB Output is correct
16 Correct 48 ms 3240 KB Output is correct
17 Correct 8 ms 3168 KB Output is correct
18 Correct 8 ms 3164 KB Output is correct
19 Correct 31 ms 3412 KB Output is correct
20 Correct 39 ms 3248 KB Output is correct
21 Correct 6 ms 3160 KB Output is correct
22 Correct 8 ms 3176 KB Output is correct
23 Correct 96 ms 3244 KB Output is correct
24 Correct 43 ms 3164 KB Output is correct
25 Correct 97 ms 3412 KB Output is correct
26 Correct 120 ms 3160 KB Output is correct
27 Correct 98 ms 3160 KB Output is correct
28 Correct 77 ms 3164 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 3160 KB Output is correct
2 Correct 3 ms 3164 KB Output is correct
3 Correct 3 ms 3164 KB Output is correct
4 Correct 10 ms 3132 KB Output is correct
5 Correct 75 ms 3244 KB Output is correct
6 Correct 85 ms 3252 KB Output is correct
7 Correct 51 ms 3160 KB Output is correct
8 Correct 78 ms 3252 KB Output is correct
9 Correct 102 ms 3164 KB Output is correct
10 Correct 6 ms 3164 KB Output is correct
11 Correct 9 ms 3268 KB Output is correct
12 Correct 11 ms 3164 KB Output is correct
13 Correct 59 ms 3240 KB Output is correct
14 Correct 18 ms 3164 KB Output is correct
15 Correct 58 ms 3244 KB Output is correct
16 Correct 65 ms 3256 KB Output is correct
17 Correct 47 ms 3164 KB Output is correct
18 Correct 9 ms 3164 KB Output is correct
19 Correct 8 ms 3164 KB Output is correct
20 Correct 26 ms 3164 KB Output is correct
21 Correct 40 ms 3160 KB Output is correct
22 Correct 3 ms 3160 KB Output is correct
23 Correct 3 ms 3272 KB Output is correct
24 Correct 3 ms 3164 KB Output is correct
25 Correct 10 ms 3160 KB Output is correct
26 Correct 59 ms 3248 KB Output is correct
27 Correct 19 ms 3164 KB Output is correct
28 Correct 58 ms 3164 KB Output is correct
29 Correct 68 ms 3244 KB Output is correct
30 Correct 48 ms 3160 KB Output is correct
31 Correct 9 ms 3164 KB Output is correct
32 Correct 8 ms 3164 KB Output is correct
33 Correct 26 ms 3164 KB Output is correct
34 Correct 39 ms 3164 KB Output is correct
35 Correct 55 ms 3160 KB Output is correct
36 Correct 21 ms 3164 KB Output is correct
37 Correct 65 ms 3244 KB Output is correct
38 Correct 57 ms 3164 KB Output is correct
39 Correct 54 ms 3240 KB Output is correct
40 Correct 10 ms 3164 KB Output is correct
41 Correct 54 ms 3164 KB Output is correct
42 Correct 19 ms 3164 KB Output is correct
43 Correct 59 ms 3164 KB Output is correct
44 Correct 63 ms 3252 KB Output is correct
45 Correct 48 ms 3240 KB Output is correct
46 Correct 8 ms 3168 KB Output is correct
47 Correct 8 ms 3164 KB Output is correct
48 Correct 31 ms 3412 KB Output is correct
49 Correct 39 ms 3248 KB Output is correct
50 Correct 6 ms 3160 KB Output is correct
51 Correct 8 ms 3176 KB Output is correct
52 Correct 96 ms 3244 KB Output is correct
53 Correct 43 ms 3164 KB Output is correct
54 Correct 97 ms 3412 KB Output is correct
55 Correct 120 ms 3160 KB Output is correct
56 Correct 98 ms 3160 KB Output is correct
57 Correct 77 ms 3164 KB Output is correct
58 Correct 3 ms 3164 KB Output is correct
59 Correct 3 ms 3164 KB Output is correct
60 Correct 4 ms 3168 KB Output is correct
61 Correct 11 ms 3164 KB Output is correct
62 Correct 74 ms 3248 KB Output is correct
63 Correct 78 ms 3244 KB Output is correct
64 Correct 40 ms 3164 KB Output is correct
65 Correct 105 ms 3164 KB Output is correct
66 Correct 104 ms 3316 KB Output is correct
67 Correct 6 ms 3164 KB Output is correct
68 Correct 9 ms 3164 KB Output is correct
69 Correct 53 ms 3164 KB Output is correct
70 Correct 18 ms 3164 KB Output is correct
71 Correct 61 ms 3164 KB Output is correct
72 Correct 63 ms 3164 KB Output is correct
73 Correct 51 ms 3164 KB Output is correct
74 Correct 10 ms 3160 KB Output is correct
75 Correct 8 ms 3164 KB Output is correct
76 Correct 26 ms 3268 KB Output is correct
77 Correct 42 ms 3160 KB Output is correct
78 Correct 55 ms 3164 KB Output is correct
79 Correct 22 ms 3164 KB Output is correct
80 Correct 65 ms 3248 KB Output is correct
81 Correct 50 ms 3244 KB Output is correct
82 Correct 53 ms 3164 KB Output is correct
83 Correct 92 ms 3244 KB Output is correct
84 Correct 47 ms 3164 KB Output is correct
85 Correct 92 ms 3164 KB Output is correct
86 Correct 112 ms 3160 KB Output is correct
87 Correct 100 ms 3244 KB Output is correct
88 Correct 78 ms 3164 KB Output is correct
89 Correct 90 ms 3164 KB Output is correct
90 Correct 113 ms 3240 KB Output is correct
91 Correct 100 ms 3244 KB Output is correct
92 Correct 100 ms 3164 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 3164 KB Output is correct
2 Correct 59 ms 3240 KB Output is correct
3 Correct 18 ms 3164 KB Output is correct
4 Correct 58 ms 3244 KB Output is correct
5 Correct 65 ms 3256 KB Output is correct
6 Correct 47 ms 3164 KB Output is correct
7 Correct 9 ms 3164 KB Output is correct
8 Correct 8 ms 3164 KB Output is correct
9 Correct 26 ms 3164 KB Output is correct
10 Correct 40 ms 3160 KB Output is correct
11 Correct 10 ms 3164 KB Output is correct
12 Correct 54 ms 3164 KB Output is correct
13 Correct 19 ms 3164 KB Output is correct
14 Correct 59 ms 3164 KB Output is correct
15 Correct 63 ms 3252 KB Output is correct
16 Correct 48 ms 3240 KB Output is correct
17 Correct 8 ms 3168 KB Output is correct
18 Correct 8 ms 3164 KB Output is correct
19 Correct 31 ms 3412 KB Output is correct
20 Correct 39 ms 3248 KB Output is correct
21 Correct 6 ms 3160 KB Output is correct
22 Correct 8 ms 3176 KB Output is correct
23 Correct 96 ms 3244 KB Output is correct
24 Correct 43 ms 3164 KB Output is correct
25 Correct 97 ms 3412 KB Output is correct
26 Correct 120 ms 3160 KB Output is correct
27 Correct 98 ms 3160 KB Output is correct
28 Correct 77 ms 3164 KB Output is correct
29 Correct 10 ms 3160 KB Output is correct
30 Correct 53 ms 3160 KB Output is correct
31 Correct 18 ms 3164 KB Output is correct
32 Correct 58 ms 3164 KB Output is correct
33 Correct 63 ms 3164 KB Output is correct
34 Correct 48 ms 3160 KB Output is correct
35 Correct 9 ms 3164 KB Output is correct
36 Correct 8 ms 3164 KB Output is correct
37 Correct 28 ms 3248 KB Output is correct
38 Correct 45 ms 3244 KB Output is correct
39 Correct 6 ms 3164 KB Output is correct
40 Correct 8 ms 3164 KB Output is correct
41 Correct 94 ms 3160 KB Output is correct
42 Correct 44 ms 3668 KB Output is correct
43 Correct 96 ms 3160 KB Output is correct
44 Correct 118 ms 3268 KB Output is correct
45 Correct 96 ms 3164 KB Output is correct
46 Correct 85 ms 3160 KB Output is correct
47 Correct 7 ms 3160 KB Output is correct
48 Correct 10 ms 3164 KB Output is correct
49 Correct 213 ms 3248 KB Output is correct
50 Correct 103 ms 3164 KB Output is correct
51 Correct 231 ms 3256 KB Output is correct
52 Correct 255 ms 3248 KB Output is correct
53 Correct 219 ms 3260 KB Output is correct
54 Correct 202 ms 3416 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 3160 KB Output is correct
2 Correct 3 ms 3164 KB Output is correct
3 Correct 3 ms 3164 KB Output is correct
4 Correct 10 ms 3132 KB Output is correct
5 Correct 75 ms 3244 KB Output is correct
6 Correct 85 ms 3252 KB Output is correct
7 Correct 51 ms 3160 KB Output is correct
8 Correct 78 ms 3252 KB Output is correct
9 Correct 102 ms 3164 KB Output is correct
10 Correct 6 ms 3164 KB Output is correct
11 Correct 9 ms 3268 KB Output is correct
12 Correct 3 ms 3160 KB Output is correct
13 Correct 4 ms 3160 KB Output is correct
14 Correct 3 ms 3160 KB Output is correct
15 Correct 11 ms 3160 KB Output is correct
16 Correct 79 ms 3160 KB Output is correct
17 Correct 78 ms 3160 KB Output is correct
18 Correct 42 ms 3244 KB Output is correct
19 Correct 79 ms 3160 KB Output is correct
20 Correct 103 ms 3248 KB Output is correct
21 Correct 10 ms 3160 KB Output is correct
22 Correct 9 ms 3164 KB Output is correct
23 Correct 206 ms 3272 KB Output is correct
24 Correct 193 ms 3248 KB Output is correct
25 Correct 77 ms 3160 KB Output is correct
26 Correct 218 ms 3412 KB Output is correct
27 Correct 221 ms 3264 KB Output is correct
28 Correct 7 ms 3164 KB Output is correct
29 Correct 10 ms 3280 KB Output is correct
30 Correct 11 ms 3164 KB Output is correct
31 Correct 59 ms 3240 KB Output is correct
32 Correct 18 ms 3164 KB Output is correct
33 Correct 58 ms 3244 KB Output is correct
34 Correct 65 ms 3256 KB Output is correct
35 Correct 47 ms 3164 KB Output is correct
36 Correct 9 ms 3164 KB Output is correct
37 Correct 8 ms 3164 KB Output is correct
38 Correct 26 ms 3164 KB Output is correct
39 Correct 40 ms 3160 KB Output is correct
40 Correct 3 ms 3160 KB Output is correct
41 Correct 3 ms 3272 KB Output is correct
42 Correct 3 ms 3164 KB Output is correct
43 Correct 10 ms 3160 KB Output is correct
44 Correct 59 ms 3248 KB Output is correct
45 Correct 19 ms 3164 KB Output is correct
46 Correct 58 ms 3164 KB Output is correct
47 Correct 68 ms 3244 KB Output is correct
48 Correct 48 ms 3160 KB Output is correct
49 Correct 9 ms 3164 KB Output is correct
50 Correct 8 ms 3164 KB Output is correct
51 Correct 26 ms 3164 KB Output is correct
52 Correct 39 ms 3164 KB Output is correct
53 Correct 55 ms 3160 KB Output is correct
54 Correct 21 ms 3164 KB Output is correct
55 Correct 65 ms 3244 KB Output is correct
56 Correct 57 ms 3164 KB Output is correct
57 Correct 54 ms 3240 KB Output is correct
58 Correct 10 ms 3164 KB Output is correct
59 Correct 54 ms 3164 KB Output is correct
60 Correct 19 ms 3164 KB Output is correct
61 Correct 59 ms 3164 KB Output is correct
62 Correct 63 ms 3252 KB Output is correct
63 Correct 48 ms 3240 KB Output is correct
64 Correct 8 ms 3168 KB Output is correct
65 Correct 8 ms 3164 KB Output is correct
66 Correct 31 ms 3412 KB Output is correct
67 Correct 39 ms 3248 KB Output is correct
68 Correct 6 ms 3160 KB Output is correct
69 Correct 8 ms 3176 KB Output is correct
70 Correct 96 ms 3244 KB Output is correct
71 Correct 43 ms 3164 KB Output is correct
72 Correct 97 ms 3412 KB Output is correct
73 Correct 120 ms 3160 KB Output is correct
74 Correct 98 ms 3160 KB Output is correct
75 Correct 77 ms 3164 KB Output is correct
76 Correct 3 ms 3164 KB Output is correct
77 Correct 3 ms 3164 KB Output is correct
78 Correct 4 ms 3168 KB Output is correct
79 Correct 11 ms 3164 KB Output is correct
80 Correct 74 ms 3248 KB Output is correct
81 Correct 78 ms 3244 KB Output is correct
82 Correct 40 ms 3164 KB Output is correct
83 Correct 105 ms 3164 KB Output is correct
84 Correct 104 ms 3316 KB Output is correct
85 Correct 6 ms 3164 KB Output is correct
86 Correct 9 ms 3164 KB Output is correct
87 Correct 53 ms 3164 KB Output is correct
88 Correct 18 ms 3164 KB Output is correct
89 Correct 61 ms 3164 KB Output is correct
90 Correct 63 ms 3164 KB Output is correct
91 Correct 51 ms 3164 KB Output is correct
92 Correct 10 ms 3160 KB Output is correct
93 Correct 8 ms 3164 KB Output is correct
94 Correct 26 ms 3268 KB Output is correct
95 Correct 42 ms 3160 KB Output is correct
96 Correct 55 ms 3164 KB Output is correct
97 Correct 22 ms 3164 KB Output is correct
98 Correct 65 ms 3248 KB Output is correct
99 Correct 50 ms 3244 KB Output is correct
100 Correct 53 ms 3164 KB Output is correct
101 Correct 92 ms 3244 KB Output is correct
102 Correct 47 ms 3164 KB Output is correct
103 Correct 92 ms 3164 KB Output is correct
104 Correct 112 ms 3160 KB Output is correct
105 Correct 100 ms 3244 KB Output is correct
106 Correct 78 ms 3164 KB Output is correct
107 Correct 90 ms 3164 KB Output is correct
108 Correct 113 ms 3240 KB Output is correct
109 Correct 100 ms 3244 KB Output is correct
110 Correct 100 ms 3164 KB Output is correct
111 Correct 10 ms 3160 KB Output is correct
112 Correct 53 ms 3160 KB Output is correct
113 Correct 18 ms 3164 KB Output is correct
114 Correct 58 ms 3164 KB Output is correct
115 Correct 63 ms 3164 KB Output is correct
116 Correct 48 ms 3160 KB Output is correct
117 Correct 9 ms 3164 KB Output is correct
118 Correct 8 ms 3164 KB Output is correct
119 Correct 28 ms 3248 KB Output is correct
120 Correct 45 ms 3244 KB Output is correct
121 Correct 6 ms 3164 KB Output is correct
122 Correct 8 ms 3164 KB Output is correct
123 Correct 94 ms 3160 KB Output is correct
124 Correct 44 ms 3668 KB Output is correct
125 Correct 96 ms 3160 KB Output is correct
126 Correct 118 ms 3268 KB Output is correct
127 Correct 96 ms 3164 KB Output is correct
128 Correct 85 ms 3160 KB Output is correct
129 Correct 7 ms 3160 KB Output is correct
130 Correct 10 ms 3164 KB Output is correct
131 Correct 213 ms 3248 KB Output is correct
132 Correct 103 ms 3164 KB Output is correct
133 Correct 231 ms 3256 KB Output is correct
134 Correct 255 ms 3248 KB Output is correct
135 Correct 219 ms 3260 KB Output is correct
136 Correct 202 ms 3416 KB Output is correct
137 Correct 3 ms 3160 KB Output is correct
138 Correct 3 ms 3164 KB Output is correct
139 Correct 3 ms 3164 KB Output is correct
140 Correct 10 ms 3272 KB Output is correct
141 Correct 75 ms 3164 KB Output is correct
142 Correct 79 ms 3244 KB Output is correct
143 Correct 41 ms 3248 KB Output is correct
144 Correct 84 ms 3164 KB Output is correct
145 Correct 102 ms 3164 KB Output is correct
146 Correct 6 ms 3164 KB Output is correct
147 Correct 8 ms 3264 KB Output is correct
148 Correct 196 ms 3160 KB Output is correct
149 Correct 193 ms 3252 KB Output is correct
150 Correct 77 ms 3164 KB Output is correct
151 Correct 217 ms 3248 KB Output is correct
152 Correct 220 ms 3260 KB Output is correct
153 Correct 8 ms 3164 KB Output is correct
154 Correct 9 ms 3272 KB Output is correct
155 Correct 54 ms 3164 KB Output is correct
156 Correct 18 ms 3164 KB Output is correct
157 Correct 59 ms 3164 KB Output is correct
158 Correct 65 ms 3248 KB Output is correct
159 Correct 59 ms 3248 KB Output is correct
160 Correct 9 ms 3160 KB Output is correct
161 Correct 8 ms 3164 KB Output is correct
162 Correct 26 ms 3164 KB Output is correct
163 Correct 39 ms 3160 KB Output is correct
164 Correct 92 ms 3256 KB Output is correct
165 Correct 44 ms 3160 KB Output is correct
166 Correct 93 ms 3164 KB Output is correct
167 Correct 113 ms 3164 KB Output is correct
168 Correct 100 ms 3164 KB Output is correct
169 Correct 76 ms 3160 KB Output is correct
170 Correct 54 ms 3164 KB Output is correct
171 Correct 21 ms 3160 KB Output is correct
172 Correct 63 ms 3164 KB Output is correct
173 Correct 53 ms 3408 KB Output is correct
174 Correct 53 ms 3500 KB Output is correct
175 Correct 90 ms 3248 KB Output is correct
176 Correct 109 ms 3160 KB Output is correct
177 Correct 88 ms 3160 KB Output is correct
178 Correct 102 ms 3244 KB Output is correct
179 Correct 209 ms 3252 KB Output is correct
180 Correct 91 ms 3164 KB Output is correct
181 Correct 231 ms 3416 KB Output is correct
182 Correct 240 ms 3256 KB Output is correct
183 Correct 211 ms 3160 KB Output is correct
184 Correct 177 ms 3164 KB Output is correct
185 Correct 211 ms 3252 KB Output is correct
186 Correct 238 ms 3160 KB Output is correct
187 Correct 221 ms 3408 KB Output is correct
188 Correct 227 ms 3160 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 3164 KB Output is correct
2 Correct 59 ms 3240 KB Output is correct
3 Correct 18 ms 3164 KB Output is correct
4 Correct 58 ms 3244 KB Output is correct
5 Correct 65 ms 3256 KB Output is correct
6 Correct 47 ms 3164 KB Output is correct
7 Correct 9 ms 3164 KB Output is correct
8 Correct 8 ms 3164 KB Output is correct
9 Correct 26 ms 3164 KB Output is correct
10 Correct 40 ms 3160 KB Output is correct
11 Correct 10 ms 3164 KB Output is correct
12 Correct 54 ms 3164 KB Output is correct
13 Correct 19 ms 3164 KB Output is correct
14 Correct 59 ms 3164 KB Output is correct
15 Correct 63 ms 3252 KB Output is correct
16 Correct 48 ms 3240 KB Output is correct
17 Correct 8 ms 3168 KB Output is correct
18 Correct 8 ms 3164 KB Output is correct
19 Correct 31 ms 3412 KB Output is correct
20 Correct 39 ms 3248 KB Output is correct
21 Correct 6 ms 3160 KB Output is correct
22 Correct 8 ms 3176 KB Output is correct
23 Correct 96 ms 3244 KB Output is correct
24 Correct 43 ms 3164 KB Output is correct
25 Correct 97 ms 3412 KB Output is correct
26 Correct 120 ms 3160 KB Output is correct
27 Correct 98 ms 3160 KB Output is correct
28 Correct 77 ms 3164 KB Output is correct
29 Correct 10 ms 3160 KB Output is correct
30 Correct 53 ms 3160 KB Output is correct
31 Correct 18 ms 3164 KB Output is correct
32 Correct 58 ms 3164 KB Output is correct
33 Correct 63 ms 3164 KB Output is correct
34 Correct 48 ms 3160 KB Output is correct
35 Correct 9 ms 3164 KB Output is correct
36 Correct 8 ms 3164 KB Output is correct
37 Correct 28 ms 3248 KB Output is correct
38 Correct 45 ms 3244 KB Output is correct
39 Correct 6 ms 3164 KB Output is correct
40 Correct 8 ms 3164 KB Output is correct
41 Correct 94 ms 3160 KB Output is correct
42 Correct 44 ms 3668 KB Output is correct
43 Correct 96 ms 3160 KB Output is correct
44 Correct 118 ms 3268 KB Output is correct
45 Correct 96 ms 3164 KB Output is correct
46 Correct 85 ms 3160 KB Output is correct
47 Correct 7 ms 3160 KB Output is correct
48 Correct 10 ms 3164 KB Output is correct
49 Correct 213 ms 3248 KB Output is correct
50 Correct 103 ms 3164 KB Output is correct
51 Correct 231 ms 3256 KB Output is correct
52 Correct 255 ms 3248 KB Output is correct
53 Correct 219 ms 3260 KB Output is correct
54 Correct 202 ms 3416 KB Output is correct
55 Correct 10 ms 3160 KB Output is correct
56 Correct 55 ms 3244 KB Output is correct
57 Correct 18 ms 3164 KB Output is correct
58 Correct 59 ms 3164 KB Output is correct
59 Correct 67 ms 3492 KB Output is correct
60 Correct 47 ms 3164 KB Output is correct
61 Correct 8 ms 3164 KB Output is correct
62 Correct 9 ms 3276 KB Output is correct
63 Correct 26 ms 3164 KB Output is correct
64 Correct 41 ms 3252 KB Output is correct
65 Correct 6 ms 3416 KB Output is correct
66 Correct 9 ms 3420 KB Output is correct
67 Correct 98 ms 3252 KB Output is correct
68 Correct 43 ms 3160 KB Output is correct
69 Correct 98 ms 3160 KB Output is correct
70 Correct 113 ms 3160 KB Output is correct
71 Correct 106 ms 3408 KB Output is correct
72 Correct 77 ms 3160 KB Output is correct
73 Correct 7 ms 3164 KB Output is correct
74 Correct 10 ms 3272 KB Output is correct
75 Correct 208 ms 3244 KB Output is correct
76 Correct 93 ms 3264 KB Output is correct
77 Correct 227 ms 3164 KB Output is correct
78 Correct 248 ms 3160 KB Output is correct
79 Correct 223 ms 3260 KB Output is correct
80 Correct 194 ms 3164 KB Output is correct
81 Correct 854 ms 3256 KB Output is correct
82 Correct 361 ms 3248 KB Output is correct
83 Correct 831 ms 3160 KB Output is correct
84 Correct 910 ms 3516 KB Output is correct
85 Correct 12 ms 3160 KB Output is correct
86 Correct 11 ms 3160 KB Output is correct
87 Correct 736 ms 3256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 3160 KB Output is correct
2 Correct 3 ms 3164 KB Output is correct
3 Correct 3 ms 3164 KB Output is correct
4 Correct 10 ms 3132 KB Output is correct
5 Correct 75 ms 3244 KB Output is correct
6 Correct 85 ms 3252 KB Output is correct
7 Correct 51 ms 3160 KB Output is correct
8 Correct 78 ms 3252 KB Output is correct
9 Correct 102 ms 3164 KB Output is correct
10 Correct 6 ms 3164 KB Output is correct
11 Correct 9 ms 3268 KB Output is correct
12 Correct 3 ms 3160 KB Output is correct
13 Correct 4 ms 3160 KB Output is correct
14 Correct 3 ms 3160 KB Output is correct
15 Correct 11 ms 3160 KB Output is correct
16 Correct 79 ms 3160 KB Output is correct
17 Correct 78 ms 3160 KB Output is correct
18 Correct 42 ms 3244 KB Output is correct
19 Correct 79 ms 3160 KB Output is correct
20 Correct 103 ms 3248 KB Output is correct
21 Correct 10 ms 3160 KB Output is correct
22 Correct 9 ms 3164 KB Output is correct
23 Correct 206 ms 3272 KB Output is correct
24 Correct 193 ms 3248 KB Output is correct
25 Correct 77 ms 3160 KB Output is correct
26 Correct 218 ms 3412 KB Output is correct
27 Correct 221 ms 3264 KB Output is correct
28 Correct 7 ms 3164 KB Output is correct
29 Correct 10 ms 3280 KB Output is correct
30 Correct 11 ms 3164 KB Output is correct
31 Correct 59 ms 3240 KB Output is correct
32 Correct 18 ms 3164 KB Output is correct
33 Correct 58 ms 3244 KB Output is correct
34 Correct 65 ms 3256 KB Output is correct
35 Correct 47 ms 3164 KB Output is correct
36 Correct 9 ms 3164 KB Output is correct
37 Correct 8 ms 3164 KB Output is correct
38 Correct 26 ms 3164 KB Output is correct
39 Correct 40 ms 3160 KB Output is correct
40 Correct 3 ms 3160 KB Output is correct
41 Correct 3 ms 3272 KB Output is correct
42 Correct 3 ms 3164 KB Output is correct
43 Correct 10 ms 3160 KB Output is correct
44 Correct 59 ms 3248 KB Output is correct
45 Correct 19 ms 3164 KB Output is correct
46 Correct 58 ms 3164 KB Output is correct
47 Correct 68 ms 3244 KB Output is correct
48 Correct 48 ms 3160 KB Output is correct
49 Correct 9 ms 3164 KB Output is correct
50 Correct 8 ms 3164 KB Output is correct
51 Correct 26 ms 3164 KB Output is correct
52 Correct 39 ms 3164 KB Output is correct
53 Correct 55 ms 3160 KB Output is correct
54 Correct 21 ms 3164 KB Output is correct
55 Correct 65 ms 3244 KB Output is correct
56 Correct 57 ms 3164 KB Output is correct
57 Correct 54 ms 3240 KB Output is correct
58 Correct 10 ms 3164 KB Output is correct
59 Correct 54 ms 3164 KB Output is correct
60 Correct 19 ms 3164 KB Output is correct
61 Correct 59 ms 3164 KB Output is correct
62 Correct 63 ms 3252 KB Output is correct
63 Correct 48 ms 3240 KB Output is correct
64 Correct 8 ms 3168 KB Output is correct
65 Correct 8 ms 3164 KB Output is correct
66 Correct 31 ms 3412 KB Output is correct
67 Correct 39 ms 3248 KB Output is correct
68 Correct 6 ms 3160 KB Output is correct
69 Correct 8 ms 3176 KB Output is correct
70 Correct 96 ms 3244 KB Output is correct
71 Correct 43 ms 3164 KB Output is correct
72 Correct 97 ms 3412 KB Output is correct
73 Correct 120 ms 3160 KB Output is correct
74 Correct 98 ms 3160 KB Output is correct
75 Correct 77 ms 3164 KB Output is correct
76 Correct 3 ms 3164 KB Output is correct
77 Correct 3 ms 3164 KB Output is correct
78 Correct 4 ms 3168 KB Output is correct
79 Correct 11 ms 3164 KB Output is correct
80 Correct 74 ms 3248 KB Output is correct
81 Correct 78 ms 3244 KB Output is correct
82 Correct 40 ms 3164 KB Output is correct
83 Correct 105 ms 3164 KB Output is correct
84 Correct 104 ms 3316 KB Output is correct
85 Correct 6 ms 3164 KB Output is correct
86 Correct 9 ms 3164 KB Output is correct
87 Correct 53 ms 3164 KB Output is correct
88 Correct 18 ms 3164 KB Output is correct
89 Correct 61 ms 3164 KB Output is correct
90 Correct 63 ms 3164 KB Output is correct
91 Correct 51 ms 3164 KB Output is correct
92 Correct 10 ms 3160 KB Output is correct
93 Correct 8 ms 3164 KB Output is correct
94 Correct 26 ms 3268 KB Output is correct
95 Correct 42 ms 3160 KB Output is correct
96 Correct 55 ms 3164 KB Output is correct
97 Correct 22 ms 3164 KB Output is correct
98 Correct 65 ms 3248 KB Output is correct
99 Correct 50 ms 3244 KB Output is correct
100 Correct 53 ms 3164 KB Output is correct
101 Correct 92 ms 3244 KB Output is correct
102 Correct 47 ms 3164 KB Output is correct
103 Correct 92 ms 3164 KB Output is correct
104 Correct 112 ms 3160 KB Output is correct
105 Correct 100 ms 3244 KB Output is correct
106 Correct 78 ms 3164 KB Output is correct
107 Correct 90 ms 3164 KB Output is correct
108 Correct 113 ms 3240 KB Output is correct
109 Correct 100 ms 3244 KB Output is correct
110 Correct 100 ms 3164 KB Output is correct
111 Correct 10 ms 3160 KB Output is correct
112 Correct 53 ms 3160 KB Output is correct
113 Correct 18 ms 3164 KB Output is correct
114 Correct 58 ms 3164 KB Output is correct
115 Correct 63 ms 3164 KB Output is correct
116 Correct 48 ms 3160 KB Output is correct
117 Correct 9 ms 3164 KB Output is correct
118 Correct 8 ms 3164 KB Output is correct
119 Correct 28 ms 3248 KB Output is correct
120 Correct 45 ms 3244 KB Output is correct
121 Correct 6 ms 3164 KB Output is correct
122 Correct 8 ms 3164 KB Output is correct
123 Correct 94 ms 3160 KB Output is correct
124 Correct 44 ms 3668 KB Output is correct
125 Correct 96 ms 3160 KB Output is correct
126 Correct 118 ms 3268 KB Output is correct
127 Correct 96 ms 3164 KB Output is correct
128 Correct 85 ms 3160 KB Output is correct
129 Correct 7 ms 3160 KB Output is correct
130 Correct 10 ms 3164 KB Output is correct
131 Correct 213 ms 3248 KB Output is correct
132 Correct 103 ms 3164 KB Output is correct
133 Correct 231 ms 3256 KB Output is correct
134 Correct 255 ms 3248 KB Output is correct
135 Correct 219 ms 3260 KB Output is correct
136 Correct 202 ms 3416 KB Output is correct
137 Correct 3 ms 3160 KB Output is correct
138 Correct 3 ms 3164 KB Output is correct
139 Correct 3 ms 3164 KB Output is correct
140 Correct 10 ms 3272 KB Output is correct
141 Correct 75 ms 3164 KB Output is correct
142 Correct 79 ms 3244 KB Output is correct
143 Correct 41 ms 3248 KB Output is correct
144 Correct 84 ms 3164 KB Output is correct
145 Correct 102 ms 3164 KB Output is correct
146 Correct 6 ms 3164 KB Output is correct
147 Correct 8 ms 3264 KB Output is correct
148 Correct 196 ms 3160 KB Output is correct
149 Correct 193 ms 3252 KB Output is correct
150 Correct 77 ms 3164 KB Output is correct
151 Correct 217 ms 3248 KB Output is correct
152 Correct 220 ms 3260 KB Output is correct
153 Correct 8 ms 3164 KB Output is correct
154 Correct 9 ms 3272 KB Output is correct
155 Correct 54 ms 3164 KB Output is correct
156 Correct 18 ms 3164 KB Output is correct
157 Correct 59 ms 3164 KB Output is correct
158 Correct 65 ms 3248 KB Output is correct
159 Correct 59 ms 3248 KB Output is correct
160 Correct 9 ms 3160 KB Output is correct
161 Correct 8 ms 3164 KB Output is correct
162 Correct 26 ms 3164 KB Output is correct
163 Correct 39 ms 3160 KB Output is correct
164 Correct 92 ms 3256 KB Output is correct
165 Correct 44 ms 3160 KB Output is correct
166 Correct 93 ms 3164 KB Output is correct
167 Correct 113 ms 3164 KB Output is correct
168 Correct 100 ms 3164 KB Output is correct
169 Correct 76 ms 3160 KB Output is correct
170 Correct 54 ms 3164 KB Output is correct
171 Correct 21 ms 3160 KB Output is correct
172 Correct 63 ms 3164 KB Output is correct
173 Correct 53 ms 3408 KB Output is correct
174 Correct 53 ms 3500 KB Output is correct
175 Correct 90 ms 3248 KB Output is correct
176 Correct 109 ms 3160 KB Output is correct
177 Correct 88 ms 3160 KB Output is correct
178 Correct 102 ms 3244 KB Output is correct
179 Correct 209 ms 3252 KB Output is correct
180 Correct 91 ms 3164 KB Output is correct
181 Correct 231 ms 3416 KB Output is correct
182 Correct 240 ms 3256 KB Output is correct
183 Correct 211 ms 3160 KB Output is correct
184 Correct 177 ms 3164 KB Output is correct
185 Correct 211 ms 3252 KB Output is correct
186 Correct 238 ms 3160 KB Output is correct
187 Correct 221 ms 3408 KB Output is correct
188 Correct 227 ms 3160 KB Output is correct
189 Correct 10 ms 3160 KB Output is correct
190 Correct 55 ms 3244 KB Output is correct
191 Correct 18 ms 3164 KB Output is correct
192 Correct 59 ms 3164 KB Output is correct
193 Correct 67 ms 3492 KB Output is correct
194 Correct 47 ms 3164 KB Output is correct
195 Correct 8 ms 3164 KB Output is correct
196 Correct 9 ms 3276 KB Output is correct
197 Correct 26 ms 3164 KB Output is correct
198 Correct 41 ms 3252 KB Output is correct
199 Correct 6 ms 3416 KB Output is correct
200 Correct 9 ms 3420 KB Output is correct
201 Correct 98 ms 3252 KB Output is correct
202 Correct 43 ms 3160 KB Output is correct
203 Correct 98 ms 3160 KB Output is correct
204 Correct 113 ms 3160 KB Output is correct
205 Correct 106 ms 3408 KB Output is correct
206 Correct 77 ms 3160 KB Output is correct
207 Correct 7 ms 3164 KB Output is correct
208 Correct 10 ms 3272 KB Output is correct
209 Correct 208 ms 3244 KB Output is correct
210 Correct 93 ms 3264 KB Output is correct
211 Correct 227 ms 3164 KB Output is correct
212 Correct 248 ms 3160 KB Output is correct
213 Correct 223 ms 3260 KB Output is correct
214 Correct 194 ms 3164 KB Output is correct
215 Correct 854 ms 3256 KB Output is correct
216 Correct 361 ms 3248 KB Output is correct
217 Correct 831 ms 3160 KB Output is correct
218 Correct 910 ms 3516 KB Output is correct
219 Correct 12 ms 3160 KB Output is correct
220 Correct 11 ms 3160 KB Output is correct
221 Correct 736 ms 3256 KB Output is correct
222 Correct 10 ms 3164 KB Output is correct
223 Correct 54 ms 3164 KB Output is correct
224 Correct 18 ms 3164 KB Output is correct
225 Correct 59 ms 3160 KB Output is correct
226 Correct 68 ms 3164 KB Output is correct
227 Correct 56 ms 3248 KB Output is correct
228 Correct 9 ms 3160 KB Output is correct
229 Correct 8 ms 3164 KB Output is correct
230 Correct 26 ms 3268 KB Output is correct
231 Correct 40 ms 3164 KB Output is correct
232 Correct 7 ms 3160 KB Output is correct
233 Correct 9 ms 3164 KB Output is correct
234 Correct 92 ms 3160 KB Output is correct
235 Correct 43 ms 3244 KB Output is correct
236 Correct 91 ms 3244 KB Output is correct
237 Correct 141 ms 3240 KB Output is correct
238 Correct 111 ms 3248 KB Output is correct
239 Correct 77 ms 3160 KB Output is correct
240 Correct 7 ms 3160 KB Output is correct
241 Correct 12 ms 3164 KB Output is correct
242 Correct 210 ms 3416 KB Output is correct
243 Correct 91 ms 3164 KB Output is correct
244 Correct 225 ms 3164 KB Output is correct
245 Correct 236 ms 3252 KB Output is correct
246 Correct 211 ms 3164 KB Output is correct
247 Correct 185 ms 3248 KB Output is correct
248 Correct 3 ms 3160 KB Output is correct
249 Correct 3 ms 3164 KB Output is correct
250 Correct 3 ms 3164 KB Output is correct
251 Correct 75 ms 3244 KB Output is correct
252 Correct 78 ms 3160 KB Output is correct
253 Correct 40 ms 3176 KB Output is correct
254 Correct 79 ms 3416 KB Output is correct
255 Correct 100 ms 3164 KB Output is correct
256 Correct 200 ms 3164 KB Output is correct
257 Correct 196 ms 3164 KB Output is correct
258 Correct 87 ms 3252 KB Output is correct
259 Correct 219 ms 3160 KB Output is correct
260 Correct 216 ms 3244 KB Output is correct
261 Correct 54 ms 3160 KB Output is correct
262 Correct 27 ms 3264 KB Output is correct
263 Correct 67 ms 3164 KB Output is correct
264 Correct 50 ms 3240 KB Output is correct
265 Correct 52 ms 3164 KB Output is correct
266 Correct 91 ms 3164 KB Output is correct
267 Correct 121 ms 3252 KB Output is correct
268 Correct 89 ms 3240 KB Output is correct
269 Correct 101 ms 3164 KB Output is correct
270 Correct 213 ms 3160 KB Output is correct
271 Correct 248 ms 3248 KB Output is correct
272 Correct 212 ms 3164 KB Output is correct
273 Correct 218 ms 3252 KB Output is correct
274 Correct 848 ms 3256 KB Output is correct
275 Correct 365 ms 3424 KB Output is correct
276 Correct 842 ms 3272 KB Output is correct
277 Correct 954 ms 3264 KB Output is correct
278 Correct 13 ms 3164 KB Output is correct
279 Correct 11 ms 3160 KB Output is correct
280 Correct 755 ms 3408 KB Output is correct
281 Correct 833 ms 3260 KB Output is correct
282 Correct 954 ms 3260 KB Output is correct
283 Correct 852 ms 3252 KB Output is correct