답안 #599247

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
599247 2022-07-19T12:01:59 Z alextodoran Uplifting Excursion (BOI22_vault) C++17
70 / 100
5000 ms 178636 KB
/**
 ____ ____ ____ ____ ____
||a |||t |||o |||d |||o ||
||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|

**/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int BITS = 62;
const ll INF = LLONG_MAX / 2;

int M;
ll L;
int* A[BITS];

int S;
ll* maxTake[BITS];
ll* maxTakeBit;

void init () {
    for (int bit = 0; bit < BITS; bit++) {
        A[bit] = new int[M * 2 + 1] + M;
        maxTake[bit] = new ll[S * 2 + 1] + S;
        fill(A[bit] - M, A[bit] + M + 1, 0);
        fill(maxTake[bit] - S, maxTake[bit] + S + 1, -INF);
    }
    maxTakeBit = new ll[S * 2 + 1] + S;
}

void solveBit (int bit) {
    fill(maxTakeBit - S, maxTakeBit + S + 1, -INF);
    maxTakeBit[0] = 0;
    for (int l = -M; l <= M; l++) {
        if (l < 0) {
            for (int i = 1; i <= A[bit][l]; i++) {
                for (int s = -S - l; s <= +S; s++) {
                    if (maxTakeBit[s] != -INF) {
                        maxTakeBit[s + l] = max(maxTakeBit[s + l], maxTakeBit[s] + 1);
                    }
                }
            }
        } else {
            for (int i = 1; i <= A[bit][l]; i++) {
                for (int s = +S - l; s >= -S; s--) {
                    if (maxTakeBit[s] != -INF) {
                        maxTakeBit[s + l] = max(maxTakeBit[s + l], maxTakeBit[s] + 1);
                    }
                }
            }
        }
    }
}

void update (ll &x, const ll &y) {
    if (y > x) {
        x = y;
    }
}

mt19937 rnd(0);

int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin >> M >> L;
    S = M * (M + 1) * 2;
    init();
    for (int l = -M; l <= +M; l++) {
        ll cnt; cin >> cnt;
        int bit = 0;
        while (((ll) 1 << bit) <= cnt) {
            cnt -= ((ll) 1 << bit);
            A[bit][l]++;
            bit++;
        }
        for (int bit = 0; bit < BITS; bit++) {
            if ((cnt >> bit) & 1) {
                A[bit][l]++;
            }
        }
    }
    if (L < 0) {
        L = -L;
        for (int bit = 0; bit < BITS; bit++) {
            reverse(A[bit] - M, A[bit] + M + 1);
        }
    }

    solveBit(0);
    for (int here = -S; here <= +S; here++) {
        int sum = here - (L & 1);
        if (sum % 2 == 0) {
            update(maxTake[0][sum / 2], maxTakeBit[here]);
        }
    }
    for (int bit = 1; bit < BITS; bit++) {
        solveBit(bit);
        for (int carry = -S; carry <= +S; carry++) {
            if (maxTake[bit - 1][carry] != -INF) {
                for (int here = -S; here <= +S; here++) {
                    int sum = carry + here - ((L >> bit) & 1);
                    if (maxTakeBit[here] != -INF && sum % 2 == 0) {
                        update(maxTake[bit][sum / 2], maxTake[bit - 1][carry] + maxTakeBit[here] * ((ll) 1 << bit));
                    }
                }
            }
        }
    }
    ll answer = maxTake[BITS - 1][0];
    if (answer != -INF) {
        cout << answer << "\n";
    } else {
        cout << "impossible\n";
    }

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 468 KB Output is correct
5 Correct 131 ms 5332 KB Output is correct
6 Correct 158 ms 5364 KB Output is correct
7 Correct 58 ms 5364 KB Output is correct
8 Correct 126 ms 5364 KB Output is correct
9 Correct 170 ms 5364 KB Output is correct
10 Correct 5 ms 5460 KB Output is correct
11 Correct 10 ms 5384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 468 KB Output is correct
5 Correct 131 ms 5332 KB Output is correct
6 Correct 158 ms 5364 KB Output is correct
7 Correct 58 ms 5364 KB Output is correct
8 Correct 126 ms 5364 KB Output is correct
9 Correct 170 ms 5364 KB Output is correct
10 Correct 5 ms 5460 KB Output is correct
11 Correct 10 ms 5384 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 468 KB Output is correct
16 Correct 135 ms 5384 KB Output is correct
17 Correct 135 ms 5356 KB Output is correct
18 Correct 59 ms 5332 KB Output is correct
19 Correct 137 ms 5332 KB Output is correct
20 Correct 172 ms 5332 KB Output is correct
21 Correct 5 ms 5332 KB Output is correct
22 Correct 8 ms 5392 KB Output is correct
23 Correct 2485 ms 20312 KB Output is correct
24 Correct 2585 ms 20316 KB Output is correct
25 Correct 1057 ms 20320 KB Output is correct
26 Correct 2961 ms 20312 KB Output is correct
27 Correct 2859 ms 20312 KB Output is correct
28 Correct 29 ms 20336 KB Output is correct
29 Correct 33 ms 20316 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 468 KB Output is correct
2 Correct 52 ms 2152 KB Output is correct
3 Correct 16 ms 2176 KB Output is correct
4 Correct 34 ms 2152 KB Output is correct
5 Correct 40 ms 2132 KB Output is correct
6 Correct 11 ms 2132 KB Output is correct
7 Correct 13 ms 2260 KB Output is correct
8 Correct 6 ms 2132 KB Output is correct
9 Correct 7 ms 2176 KB Output is correct
10 Correct 19 ms 2176 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 468 KB Output is correct
2 Correct 52 ms 2152 KB Output is correct
3 Correct 16 ms 2176 KB Output is correct
4 Correct 34 ms 2152 KB Output is correct
5 Correct 40 ms 2132 KB Output is correct
6 Correct 11 ms 2132 KB Output is correct
7 Correct 13 ms 2260 KB Output is correct
8 Correct 6 ms 2132 KB Output is correct
9 Correct 7 ms 2176 KB Output is correct
10 Correct 19 ms 2176 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 1 ms 468 KB Output is correct
15 Correct 39 ms 2152 KB Output is correct
16 Correct 17 ms 2132 KB Output is correct
17 Correct 32 ms 2160 KB Output is correct
18 Correct 41 ms 2132 KB Output is correct
19 Correct 12 ms 2132 KB Output is correct
20 Correct 10 ms 2172 KB Output is correct
21 Correct 7 ms 2176 KB Output is correct
22 Correct 7 ms 2132 KB Output is correct
23 Correct 20 ms 2132 KB Output is correct
24 Correct 103 ms 2132 KB Output is correct
25 Correct 39 ms 2132 KB Output is correct
26 Correct 88 ms 2132 KB Output is correct
27 Correct 55 ms 2132 KB Output is correct
28 Correct 82 ms 2164 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 468 KB Output is correct
2 Correct 52 ms 2152 KB Output is correct
3 Correct 16 ms 2176 KB Output is correct
4 Correct 34 ms 2152 KB Output is correct
5 Correct 40 ms 2132 KB Output is correct
6 Correct 11 ms 2132 KB Output is correct
7 Correct 13 ms 2260 KB Output is correct
8 Correct 6 ms 2132 KB Output is correct
9 Correct 7 ms 2176 KB Output is correct
10 Correct 19 ms 2176 KB Output is correct
11 Correct 1 ms 468 KB Output is correct
12 Correct 38 ms 2144 KB Output is correct
13 Correct 16 ms 2168 KB Output is correct
14 Correct 34 ms 2132 KB Output is correct
15 Correct 45 ms 2152 KB Output is correct
16 Correct 11 ms 2132 KB Output is correct
17 Correct 9 ms 2132 KB Output is correct
18 Correct 8 ms 2132 KB Output is correct
19 Correct 7 ms 2132 KB Output is correct
20 Correct 19 ms 2180 KB Output is correct
21 Correct 5 ms 5332 KB Output is correct
22 Correct 8 ms 5332 KB Output is correct
23 Correct 218 ms 5372 KB Output is correct
24 Correct 229 ms 5332 KB Output is correct
25 Correct 237 ms 5356 KB Output is correct
26 Correct 323 ms 5356 KB Output is correct
27 Correct 227 ms 5360 KB Output is correct
28 Correct 186 ms 5332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 468 KB Output is correct
5 Correct 131 ms 5332 KB Output is correct
6 Correct 158 ms 5364 KB Output is correct
7 Correct 58 ms 5364 KB Output is correct
8 Correct 126 ms 5364 KB Output is correct
9 Correct 170 ms 5364 KB Output is correct
10 Correct 5 ms 5460 KB Output is correct
11 Correct 10 ms 5384 KB Output is correct
12 Correct 1 ms 468 KB Output is correct
13 Correct 52 ms 2152 KB Output is correct
14 Correct 16 ms 2176 KB Output is correct
15 Correct 34 ms 2152 KB Output is correct
16 Correct 40 ms 2132 KB Output is correct
17 Correct 11 ms 2132 KB Output is correct
18 Correct 13 ms 2260 KB Output is correct
19 Correct 6 ms 2132 KB Output is correct
20 Correct 7 ms 2176 KB Output is correct
21 Correct 19 ms 2176 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 0 ms 340 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 1 ms 468 KB Output is correct
26 Correct 39 ms 2152 KB Output is correct
27 Correct 17 ms 2132 KB Output is correct
28 Correct 32 ms 2160 KB Output is correct
29 Correct 41 ms 2132 KB Output is correct
30 Correct 12 ms 2132 KB Output is correct
31 Correct 10 ms 2172 KB Output is correct
32 Correct 7 ms 2176 KB Output is correct
33 Correct 7 ms 2132 KB Output is correct
34 Correct 20 ms 2132 KB Output is correct
35 Correct 103 ms 2132 KB Output is correct
36 Correct 39 ms 2132 KB Output is correct
37 Correct 88 ms 2132 KB Output is correct
38 Correct 55 ms 2132 KB Output is correct
39 Correct 82 ms 2164 KB Output is correct
40 Correct 1 ms 468 KB Output is correct
41 Correct 38 ms 2144 KB Output is correct
42 Correct 16 ms 2168 KB Output is correct
43 Correct 34 ms 2132 KB Output is correct
44 Correct 45 ms 2152 KB Output is correct
45 Correct 11 ms 2132 KB Output is correct
46 Correct 9 ms 2132 KB Output is correct
47 Correct 8 ms 2132 KB Output is correct
48 Correct 7 ms 2132 KB Output is correct
49 Correct 19 ms 2180 KB Output is correct
50 Correct 5 ms 5332 KB Output is correct
51 Correct 8 ms 5332 KB Output is correct
52 Correct 218 ms 5372 KB Output is correct
53 Correct 229 ms 5332 KB Output is correct
54 Correct 237 ms 5356 KB Output is correct
55 Correct 323 ms 5356 KB Output is correct
56 Correct 227 ms 5360 KB Output is correct
57 Correct 186 ms 5332 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 1 ms 340 KB Output is correct
60 Correct 0 ms 340 KB Output is correct
61 Correct 1 ms 468 KB Output is correct
62 Correct 153 ms 5360 KB Output is correct
63 Correct 128 ms 5364 KB Output is correct
64 Correct 58 ms 5368 KB Output is correct
65 Correct 146 ms 5368 KB Output is correct
66 Correct 182 ms 5368 KB Output is correct
67 Correct 6 ms 5332 KB Output is correct
68 Correct 6 ms 5332 KB Output is correct
69 Correct 36 ms 2160 KB Output is correct
70 Correct 15 ms 2132 KB Output is correct
71 Correct 32 ms 2132 KB Output is correct
72 Correct 42 ms 2132 KB Output is correct
73 Correct 11 ms 2120 KB Output is correct
74 Correct 9 ms 2132 KB Output is correct
75 Correct 8 ms 2228 KB Output is correct
76 Correct 7 ms 2180 KB Output is correct
77 Correct 20 ms 2132 KB Output is correct
78 Correct 100 ms 2132 KB Output is correct
79 Correct 26 ms 2132 KB Output is correct
80 Correct 84 ms 2172 KB Output is correct
81 Correct 61 ms 2156 KB Output is correct
82 Correct 86 ms 2156 KB Output is correct
83 Correct 221 ms 5360 KB Output is correct
84 Correct 178 ms 5332 KB Output is correct
85 Correct 244 ms 5364 KB Output is correct
86 Correct 311 ms 5356 KB Output is correct
87 Correct 235 ms 5364 KB Output is correct
88 Correct 187 ms 5360 KB Output is correct
89 Correct 448 ms 5384 KB Output is correct
90 Correct 575 ms 5364 KB Output is correct
91 Correct 497 ms 5368 KB Output is correct
92 Correct 674 ms 5360 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 468 KB Output is correct
2 Correct 52 ms 2152 KB Output is correct
3 Correct 16 ms 2176 KB Output is correct
4 Correct 34 ms 2152 KB Output is correct
5 Correct 40 ms 2132 KB Output is correct
6 Correct 11 ms 2132 KB Output is correct
7 Correct 13 ms 2260 KB Output is correct
8 Correct 6 ms 2132 KB Output is correct
9 Correct 7 ms 2176 KB Output is correct
10 Correct 19 ms 2176 KB Output is correct
11 Correct 1 ms 468 KB Output is correct
12 Correct 38 ms 2144 KB Output is correct
13 Correct 16 ms 2168 KB Output is correct
14 Correct 34 ms 2132 KB Output is correct
15 Correct 45 ms 2152 KB Output is correct
16 Correct 11 ms 2132 KB Output is correct
17 Correct 9 ms 2132 KB Output is correct
18 Correct 8 ms 2132 KB Output is correct
19 Correct 7 ms 2132 KB Output is correct
20 Correct 19 ms 2180 KB Output is correct
21 Correct 5 ms 5332 KB Output is correct
22 Correct 8 ms 5332 KB Output is correct
23 Correct 218 ms 5372 KB Output is correct
24 Correct 229 ms 5332 KB Output is correct
25 Correct 237 ms 5356 KB Output is correct
26 Correct 323 ms 5356 KB Output is correct
27 Correct 227 ms 5360 KB Output is correct
28 Correct 186 ms 5332 KB Output is correct
29 Correct 0 ms 468 KB Output is correct
30 Correct 39 ms 2132 KB Output is correct
31 Correct 17 ms 2176 KB Output is correct
32 Correct 35 ms 2176 KB Output is correct
33 Correct 41 ms 2132 KB Output is correct
34 Correct 11 ms 2132 KB Output is correct
35 Correct 11 ms 2132 KB Output is correct
36 Correct 7 ms 2132 KB Output is correct
37 Correct 7 ms 2132 KB Output is correct
38 Correct 19 ms 2168 KB Output is correct
39 Correct 5 ms 5332 KB Output is correct
40 Correct 7 ms 5332 KB Output is correct
41 Correct 221 ms 5360 KB Output is correct
42 Correct 197 ms 5364 KB Output is correct
43 Correct 273 ms 5360 KB Output is correct
44 Correct 319 ms 5360 KB Output is correct
45 Correct 233 ms 5360 KB Output is correct
46 Correct 227 ms 5372 KB Output is correct
47 Correct 33 ms 20308 KB Output is correct
48 Correct 41 ms 20308 KB Output is correct
49 Correct 3375 ms 20308 KB Output is correct
50 Correct 1723 ms 20332 KB Output is correct
51 Correct 4314 ms 20312 KB Output is correct
52 Correct 4279 ms 20308 KB Output is correct
53 Correct 4485 ms 20312 KB Output is correct
54 Correct 2687 ms 20308 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 468 KB Output is correct
5 Correct 131 ms 5332 KB Output is correct
6 Correct 158 ms 5364 KB Output is correct
7 Correct 58 ms 5364 KB Output is correct
8 Correct 126 ms 5364 KB Output is correct
9 Correct 170 ms 5364 KB Output is correct
10 Correct 5 ms 5460 KB Output is correct
11 Correct 10 ms 5384 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 468 KB Output is correct
16 Correct 135 ms 5384 KB Output is correct
17 Correct 135 ms 5356 KB Output is correct
18 Correct 59 ms 5332 KB Output is correct
19 Correct 137 ms 5332 KB Output is correct
20 Correct 172 ms 5332 KB Output is correct
21 Correct 5 ms 5332 KB Output is correct
22 Correct 8 ms 5392 KB Output is correct
23 Correct 2485 ms 20312 KB Output is correct
24 Correct 2585 ms 20316 KB Output is correct
25 Correct 1057 ms 20320 KB Output is correct
26 Correct 2961 ms 20312 KB Output is correct
27 Correct 2859 ms 20312 KB Output is correct
28 Correct 29 ms 20336 KB Output is correct
29 Correct 33 ms 20316 KB Output is correct
30 Correct 1 ms 468 KB Output is correct
31 Correct 52 ms 2152 KB Output is correct
32 Correct 16 ms 2176 KB Output is correct
33 Correct 34 ms 2152 KB Output is correct
34 Correct 40 ms 2132 KB Output is correct
35 Correct 11 ms 2132 KB Output is correct
36 Correct 13 ms 2260 KB Output is correct
37 Correct 6 ms 2132 KB Output is correct
38 Correct 7 ms 2176 KB Output is correct
39 Correct 19 ms 2176 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 1 ms 468 KB Output is correct
44 Correct 39 ms 2152 KB Output is correct
45 Correct 17 ms 2132 KB Output is correct
46 Correct 32 ms 2160 KB Output is correct
47 Correct 41 ms 2132 KB Output is correct
48 Correct 12 ms 2132 KB Output is correct
49 Correct 10 ms 2172 KB Output is correct
50 Correct 7 ms 2176 KB Output is correct
51 Correct 7 ms 2132 KB Output is correct
52 Correct 20 ms 2132 KB Output is correct
53 Correct 103 ms 2132 KB Output is correct
54 Correct 39 ms 2132 KB Output is correct
55 Correct 88 ms 2132 KB Output is correct
56 Correct 55 ms 2132 KB Output is correct
57 Correct 82 ms 2164 KB Output is correct
58 Correct 1 ms 468 KB Output is correct
59 Correct 38 ms 2144 KB Output is correct
60 Correct 16 ms 2168 KB Output is correct
61 Correct 34 ms 2132 KB Output is correct
62 Correct 45 ms 2152 KB Output is correct
63 Correct 11 ms 2132 KB Output is correct
64 Correct 9 ms 2132 KB Output is correct
65 Correct 8 ms 2132 KB Output is correct
66 Correct 7 ms 2132 KB Output is correct
67 Correct 19 ms 2180 KB Output is correct
68 Correct 5 ms 5332 KB Output is correct
69 Correct 8 ms 5332 KB Output is correct
70 Correct 218 ms 5372 KB Output is correct
71 Correct 229 ms 5332 KB Output is correct
72 Correct 237 ms 5356 KB Output is correct
73 Correct 323 ms 5356 KB Output is correct
74 Correct 227 ms 5360 KB Output is correct
75 Correct 186 ms 5332 KB Output is correct
76 Correct 1 ms 340 KB Output is correct
77 Correct 1 ms 340 KB Output is correct
78 Correct 0 ms 340 KB Output is correct
79 Correct 1 ms 468 KB Output is correct
80 Correct 153 ms 5360 KB Output is correct
81 Correct 128 ms 5364 KB Output is correct
82 Correct 58 ms 5368 KB Output is correct
83 Correct 146 ms 5368 KB Output is correct
84 Correct 182 ms 5368 KB Output is correct
85 Correct 6 ms 5332 KB Output is correct
86 Correct 6 ms 5332 KB Output is correct
87 Correct 36 ms 2160 KB Output is correct
88 Correct 15 ms 2132 KB Output is correct
89 Correct 32 ms 2132 KB Output is correct
90 Correct 42 ms 2132 KB Output is correct
91 Correct 11 ms 2120 KB Output is correct
92 Correct 9 ms 2132 KB Output is correct
93 Correct 8 ms 2228 KB Output is correct
94 Correct 7 ms 2180 KB Output is correct
95 Correct 20 ms 2132 KB Output is correct
96 Correct 100 ms 2132 KB Output is correct
97 Correct 26 ms 2132 KB Output is correct
98 Correct 84 ms 2172 KB Output is correct
99 Correct 61 ms 2156 KB Output is correct
100 Correct 86 ms 2156 KB Output is correct
101 Correct 221 ms 5360 KB Output is correct
102 Correct 178 ms 5332 KB Output is correct
103 Correct 244 ms 5364 KB Output is correct
104 Correct 311 ms 5356 KB Output is correct
105 Correct 235 ms 5364 KB Output is correct
106 Correct 187 ms 5360 KB Output is correct
107 Correct 448 ms 5384 KB Output is correct
108 Correct 575 ms 5364 KB Output is correct
109 Correct 497 ms 5368 KB Output is correct
110 Correct 674 ms 5360 KB Output is correct
111 Correct 0 ms 468 KB Output is correct
112 Correct 39 ms 2132 KB Output is correct
113 Correct 17 ms 2176 KB Output is correct
114 Correct 35 ms 2176 KB Output is correct
115 Correct 41 ms 2132 KB Output is correct
116 Correct 11 ms 2132 KB Output is correct
117 Correct 11 ms 2132 KB Output is correct
118 Correct 7 ms 2132 KB Output is correct
119 Correct 7 ms 2132 KB Output is correct
120 Correct 19 ms 2168 KB Output is correct
121 Correct 5 ms 5332 KB Output is correct
122 Correct 7 ms 5332 KB Output is correct
123 Correct 221 ms 5360 KB Output is correct
124 Correct 197 ms 5364 KB Output is correct
125 Correct 273 ms 5360 KB Output is correct
126 Correct 319 ms 5360 KB Output is correct
127 Correct 233 ms 5360 KB Output is correct
128 Correct 227 ms 5372 KB Output is correct
129 Correct 33 ms 20308 KB Output is correct
130 Correct 41 ms 20308 KB Output is correct
131 Correct 3375 ms 20308 KB Output is correct
132 Correct 1723 ms 20332 KB Output is correct
133 Correct 4314 ms 20312 KB Output is correct
134 Correct 4279 ms 20308 KB Output is correct
135 Correct 4485 ms 20312 KB Output is correct
136 Correct 2687 ms 20308 KB Output is correct
137 Correct 1 ms 340 KB Output is correct
138 Correct 1 ms 340 KB Output is correct
139 Correct 1 ms 212 KB Output is correct
140 Correct 1 ms 468 KB Output is correct
141 Correct 141 ms 5364 KB Output is correct
142 Correct 138 ms 5364 KB Output is correct
143 Correct 73 ms 5364 KB Output is correct
144 Correct 135 ms 5364 KB Output is correct
145 Correct 196 ms 5360 KB Output is correct
146 Correct 8 ms 5332 KB Output is correct
147 Correct 13 ms 5332 KB Output is correct
148 Correct 2726 ms 20308 KB Output is correct
149 Correct 2815 ms 20308 KB Output is correct
150 Correct 1292 ms 20316 KB Output is correct
151 Correct 2926 ms 20308 KB Output is correct
152 Correct 2956 ms 20308 KB Output is correct
153 Correct 29 ms 20312 KB Output is correct
154 Correct 37 ms 20292 KB Output is correct
155 Correct 38 ms 2160 KB Output is correct
156 Correct 16 ms 2176 KB Output is correct
157 Correct 36 ms 2132 KB Output is correct
158 Correct 41 ms 2252 KB Output is correct
159 Correct 12 ms 2176 KB Output is correct
160 Correct 10 ms 2132 KB Output is correct
161 Correct 8 ms 2132 KB Output is correct
162 Correct 7 ms 2132 KB Output is correct
163 Correct 21 ms 2180 KB Output is correct
164 Correct 222 ms 5360 KB Output is correct
165 Correct 199 ms 5376 KB Output is correct
166 Correct 436 ms 5364 KB Output is correct
167 Correct 333 ms 5360 KB Output is correct
168 Correct 231 ms 5332 KB Output is correct
169 Correct 229 ms 5332 KB Output is correct
170 Correct 103 ms 2160 KB Output is correct
171 Correct 29 ms 2132 KB Output is correct
172 Correct 95 ms 2156 KB Output is correct
173 Correct 59 ms 2132 KB Output is correct
174 Correct 93 ms 2132 KB Output is correct
175 Correct 597 ms 5360 KB Output is correct
176 Correct 687 ms 5368 KB Output is correct
177 Correct 565 ms 5368 KB Output is correct
178 Correct 788 ms 5364 KB Output is correct
179 Correct 3853 ms 20312 KB Output is correct
180 Correct 1735 ms 20308 KB Output is correct
181 Correct 4246 ms 20312 KB Output is correct
182 Correct 4278 ms 20316 KB Output is correct
183 Correct 3866 ms 20308 KB Output is correct
184 Correct 2305 ms 20312 KB Output is correct
185 Execution timed out 5062 ms 20308 KB Time limit exceeded
186 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 468 KB Output is correct
2 Correct 52 ms 2152 KB Output is correct
3 Correct 16 ms 2176 KB Output is correct
4 Correct 34 ms 2152 KB Output is correct
5 Correct 40 ms 2132 KB Output is correct
6 Correct 11 ms 2132 KB Output is correct
7 Correct 13 ms 2260 KB Output is correct
8 Correct 6 ms 2132 KB Output is correct
9 Correct 7 ms 2176 KB Output is correct
10 Correct 19 ms 2176 KB Output is correct
11 Correct 1 ms 468 KB Output is correct
12 Correct 38 ms 2144 KB Output is correct
13 Correct 16 ms 2168 KB Output is correct
14 Correct 34 ms 2132 KB Output is correct
15 Correct 45 ms 2152 KB Output is correct
16 Correct 11 ms 2132 KB Output is correct
17 Correct 9 ms 2132 KB Output is correct
18 Correct 8 ms 2132 KB Output is correct
19 Correct 7 ms 2132 KB Output is correct
20 Correct 19 ms 2180 KB Output is correct
21 Correct 5 ms 5332 KB Output is correct
22 Correct 8 ms 5332 KB Output is correct
23 Correct 218 ms 5372 KB Output is correct
24 Correct 229 ms 5332 KB Output is correct
25 Correct 237 ms 5356 KB Output is correct
26 Correct 323 ms 5356 KB Output is correct
27 Correct 227 ms 5360 KB Output is correct
28 Correct 186 ms 5332 KB Output is correct
29 Correct 0 ms 468 KB Output is correct
30 Correct 39 ms 2132 KB Output is correct
31 Correct 17 ms 2176 KB Output is correct
32 Correct 35 ms 2176 KB Output is correct
33 Correct 41 ms 2132 KB Output is correct
34 Correct 11 ms 2132 KB Output is correct
35 Correct 11 ms 2132 KB Output is correct
36 Correct 7 ms 2132 KB Output is correct
37 Correct 7 ms 2132 KB Output is correct
38 Correct 19 ms 2168 KB Output is correct
39 Correct 5 ms 5332 KB Output is correct
40 Correct 7 ms 5332 KB Output is correct
41 Correct 221 ms 5360 KB Output is correct
42 Correct 197 ms 5364 KB Output is correct
43 Correct 273 ms 5360 KB Output is correct
44 Correct 319 ms 5360 KB Output is correct
45 Correct 233 ms 5360 KB Output is correct
46 Correct 227 ms 5372 KB Output is correct
47 Correct 33 ms 20308 KB Output is correct
48 Correct 41 ms 20308 KB Output is correct
49 Correct 3375 ms 20308 KB Output is correct
50 Correct 1723 ms 20332 KB Output is correct
51 Correct 4314 ms 20312 KB Output is correct
52 Correct 4279 ms 20308 KB Output is correct
53 Correct 4485 ms 20312 KB Output is correct
54 Correct 2687 ms 20308 KB Output is correct
55 Correct 2 ms 468 KB Output is correct
56 Correct 37 ms 2152 KB Output is correct
57 Correct 16 ms 2180 KB Output is correct
58 Correct 34 ms 2156 KB Output is correct
59 Correct 46 ms 2152 KB Output is correct
60 Correct 14 ms 2132 KB Output is correct
61 Correct 15 ms 2176 KB Output is correct
62 Correct 7 ms 2132 KB Output is correct
63 Correct 7 ms 2132 KB Output is correct
64 Correct 20 ms 2132 KB Output is correct
65 Correct 6 ms 5332 KB Output is correct
66 Correct 8 ms 5332 KB Output is correct
67 Correct 234 ms 5356 KB Output is correct
68 Correct 182 ms 5376 KB Output is correct
69 Correct 259 ms 5364 KB Output is correct
70 Correct 364 ms 5360 KB Output is correct
71 Correct 244 ms 5360 KB Output is correct
72 Correct 226 ms 5364 KB Output is correct
73 Correct 28 ms 20296 KB Output is correct
74 Correct 46 ms 20228 KB Output is correct
75 Correct 3601 ms 20312 KB Output is correct
76 Correct 1681 ms 20308 KB Output is correct
77 Correct 4476 ms 20312 KB Output is correct
78 Correct 3978 ms 20312 KB Output is correct
79 Correct 3795 ms 20308 KB Output is correct
80 Correct 2266 ms 20308 KB Output is correct
81 Execution timed out 5043 ms 178636 KB Time limit exceeded
82 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 468 KB Output is correct
5 Correct 131 ms 5332 KB Output is correct
6 Correct 158 ms 5364 KB Output is correct
7 Correct 58 ms 5364 KB Output is correct
8 Correct 126 ms 5364 KB Output is correct
9 Correct 170 ms 5364 KB Output is correct
10 Correct 5 ms 5460 KB Output is correct
11 Correct 10 ms 5384 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 0 ms 340 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 1 ms 468 KB Output is correct
16 Correct 135 ms 5384 KB Output is correct
17 Correct 135 ms 5356 KB Output is correct
18 Correct 59 ms 5332 KB Output is correct
19 Correct 137 ms 5332 KB Output is correct
20 Correct 172 ms 5332 KB Output is correct
21 Correct 5 ms 5332 KB Output is correct
22 Correct 8 ms 5392 KB Output is correct
23 Correct 2485 ms 20312 KB Output is correct
24 Correct 2585 ms 20316 KB Output is correct
25 Correct 1057 ms 20320 KB Output is correct
26 Correct 2961 ms 20312 KB Output is correct
27 Correct 2859 ms 20312 KB Output is correct
28 Correct 29 ms 20336 KB Output is correct
29 Correct 33 ms 20316 KB Output is correct
30 Correct 1 ms 468 KB Output is correct
31 Correct 52 ms 2152 KB Output is correct
32 Correct 16 ms 2176 KB Output is correct
33 Correct 34 ms 2152 KB Output is correct
34 Correct 40 ms 2132 KB Output is correct
35 Correct 11 ms 2132 KB Output is correct
36 Correct 13 ms 2260 KB Output is correct
37 Correct 6 ms 2132 KB Output is correct
38 Correct 7 ms 2176 KB Output is correct
39 Correct 19 ms 2176 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 0 ms 340 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 1 ms 468 KB Output is correct
44 Correct 39 ms 2152 KB Output is correct
45 Correct 17 ms 2132 KB Output is correct
46 Correct 32 ms 2160 KB Output is correct
47 Correct 41 ms 2132 KB Output is correct
48 Correct 12 ms 2132 KB Output is correct
49 Correct 10 ms 2172 KB Output is correct
50 Correct 7 ms 2176 KB Output is correct
51 Correct 7 ms 2132 KB Output is correct
52 Correct 20 ms 2132 KB Output is correct
53 Correct 103 ms 2132 KB Output is correct
54 Correct 39 ms 2132 KB Output is correct
55 Correct 88 ms 2132 KB Output is correct
56 Correct 55 ms 2132 KB Output is correct
57 Correct 82 ms 2164 KB Output is correct
58 Correct 1 ms 468 KB Output is correct
59 Correct 38 ms 2144 KB Output is correct
60 Correct 16 ms 2168 KB Output is correct
61 Correct 34 ms 2132 KB Output is correct
62 Correct 45 ms 2152 KB Output is correct
63 Correct 11 ms 2132 KB Output is correct
64 Correct 9 ms 2132 KB Output is correct
65 Correct 8 ms 2132 KB Output is correct
66 Correct 7 ms 2132 KB Output is correct
67 Correct 19 ms 2180 KB Output is correct
68 Correct 5 ms 5332 KB Output is correct
69 Correct 8 ms 5332 KB Output is correct
70 Correct 218 ms 5372 KB Output is correct
71 Correct 229 ms 5332 KB Output is correct
72 Correct 237 ms 5356 KB Output is correct
73 Correct 323 ms 5356 KB Output is correct
74 Correct 227 ms 5360 KB Output is correct
75 Correct 186 ms 5332 KB Output is correct
76 Correct 1 ms 340 KB Output is correct
77 Correct 1 ms 340 KB Output is correct
78 Correct 0 ms 340 KB Output is correct
79 Correct 1 ms 468 KB Output is correct
80 Correct 153 ms 5360 KB Output is correct
81 Correct 128 ms 5364 KB Output is correct
82 Correct 58 ms 5368 KB Output is correct
83 Correct 146 ms 5368 KB Output is correct
84 Correct 182 ms 5368 KB Output is correct
85 Correct 6 ms 5332 KB Output is correct
86 Correct 6 ms 5332 KB Output is correct
87 Correct 36 ms 2160 KB Output is correct
88 Correct 15 ms 2132 KB Output is correct
89 Correct 32 ms 2132 KB Output is correct
90 Correct 42 ms 2132 KB Output is correct
91 Correct 11 ms 2120 KB Output is correct
92 Correct 9 ms 2132 KB Output is correct
93 Correct 8 ms 2228 KB Output is correct
94 Correct 7 ms 2180 KB Output is correct
95 Correct 20 ms 2132 KB Output is correct
96 Correct 100 ms 2132 KB Output is correct
97 Correct 26 ms 2132 KB Output is correct
98 Correct 84 ms 2172 KB Output is correct
99 Correct 61 ms 2156 KB Output is correct
100 Correct 86 ms 2156 KB Output is correct
101 Correct 221 ms 5360 KB Output is correct
102 Correct 178 ms 5332 KB Output is correct
103 Correct 244 ms 5364 KB Output is correct
104 Correct 311 ms 5356 KB Output is correct
105 Correct 235 ms 5364 KB Output is correct
106 Correct 187 ms 5360 KB Output is correct
107 Correct 448 ms 5384 KB Output is correct
108 Correct 575 ms 5364 KB Output is correct
109 Correct 497 ms 5368 KB Output is correct
110 Correct 674 ms 5360 KB Output is correct
111 Correct 0 ms 468 KB Output is correct
112 Correct 39 ms 2132 KB Output is correct
113 Correct 17 ms 2176 KB Output is correct
114 Correct 35 ms 2176 KB Output is correct
115 Correct 41 ms 2132 KB Output is correct
116 Correct 11 ms 2132 KB Output is correct
117 Correct 11 ms 2132 KB Output is correct
118 Correct 7 ms 2132 KB Output is correct
119 Correct 7 ms 2132 KB Output is correct
120 Correct 19 ms 2168 KB Output is correct
121 Correct 5 ms 5332 KB Output is correct
122 Correct 7 ms 5332 KB Output is correct
123 Correct 221 ms 5360 KB Output is correct
124 Correct 197 ms 5364 KB Output is correct
125 Correct 273 ms 5360 KB Output is correct
126 Correct 319 ms 5360 KB Output is correct
127 Correct 233 ms 5360 KB Output is correct
128 Correct 227 ms 5372 KB Output is correct
129 Correct 33 ms 20308 KB Output is correct
130 Correct 41 ms 20308 KB Output is correct
131 Correct 3375 ms 20308 KB Output is correct
132 Correct 1723 ms 20332 KB Output is correct
133 Correct 4314 ms 20312 KB Output is correct
134 Correct 4279 ms 20308 KB Output is correct
135 Correct 4485 ms 20312 KB Output is correct
136 Correct 2687 ms 20308 KB Output is correct
137 Correct 1 ms 340 KB Output is correct
138 Correct 1 ms 340 KB Output is correct
139 Correct 1 ms 212 KB Output is correct
140 Correct 1 ms 468 KB Output is correct
141 Correct 141 ms 5364 KB Output is correct
142 Correct 138 ms 5364 KB Output is correct
143 Correct 73 ms 5364 KB Output is correct
144 Correct 135 ms 5364 KB Output is correct
145 Correct 196 ms 5360 KB Output is correct
146 Correct 8 ms 5332 KB Output is correct
147 Correct 13 ms 5332 KB Output is correct
148 Correct 2726 ms 20308 KB Output is correct
149 Correct 2815 ms 20308 KB Output is correct
150 Correct 1292 ms 20316 KB Output is correct
151 Correct 2926 ms 20308 KB Output is correct
152 Correct 2956 ms 20308 KB Output is correct
153 Correct 29 ms 20312 KB Output is correct
154 Correct 37 ms 20292 KB Output is correct
155 Correct 38 ms 2160 KB Output is correct
156 Correct 16 ms 2176 KB Output is correct
157 Correct 36 ms 2132 KB Output is correct
158 Correct 41 ms 2252 KB Output is correct
159 Correct 12 ms 2176 KB Output is correct
160 Correct 10 ms 2132 KB Output is correct
161 Correct 8 ms 2132 KB Output is correct
162 Correct 7 ms 2132 KB Output is correct
163 Correct 21 ms 2180 KB Output is correct
164 Correct 222 ms 5360 KB Output is correct
165 Correct 199 ms 5376 KB Output is correct
166 Correct 436 ms 5364 KB Output is correct
167 Correct 333 ms 5360 KB Output is correct
168 Correct 231 ms 5332 KB Output is correct
169 Correct 229 ms 5332 KB Output is correct
170 Correct 103 ms 2160 KB Output is correct
171 Correct 29 ms 2132 KB Output is correct
172 Correct 95 ms 2156 KB Output is correct
173 Correct 59 ms 2132 KB Output is correct
174 Correct 93 ms 2132 KB Output is correct
175 Correct 597 ms 5360 KB Output is correct
176 Correct 687 ms 5368 KB Output is correct
177 Correct 565 ms 5368 KB Output is correct
178 Correct 788 ms 5364 KB Output is correct
179 Correct 3853 ms 20312 KB Output is correct
180 Correct 1735 ms 20308 KB Output is correct
181 Correct 4246 ms 20312 KB Output is correct
182 Correct 4278 ms 20316 KB Output is correct
183 Correct 3866 ms 20308 KB Output is correct
184 Correct 2305 ms 20312 KB Output is correct
185 Execution timed out 5062 ms 20308 KB Time limit exceeded
186 Halted 0 ms 0 KB -