답안 #711409

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
711409 2023-03-16T21:09:22 Z Johann Uplifting Excursion (BOI22_vault) C++14
80 / 100
5000 ms 284492 KB
// tatsaechlich in echt falsch, wie 8.in zeigt
#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
typedef pair<ll, ll> pii;
typedef vector<pii> vpii;
typedef vector<ll> vi;
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()

vi calcShifts(ll a)
{
    vi ans;
    ll i = 0;
    while ((1LL << i) <= a)
    {
        a -= (1LL << i);
        ans.push_back(i++);
    }
    while (i > 0)
        if ((1LL << --i) <= a)
            ans.push_back(i), a -= (1 << i);
    return ans;
}

vi dp;
ll center;
void calcDP(vi &A, ll M)
{
    ll an = accumulate(A.begin(), A.begin() + M, 0);
    ll ap = accumulate(A.begin() + M + 1, A.begin() + 2 * M + 1, 0);

    center = M * max(an, ap) + 1;
    dp.assign(2 * center + 1, -1);
    dp[center] = A[M];
    for (int foo = 0; foo < 2; ++foo)
    {
        reverse(all(A)), reverse(all(dp));
        for (ll m = 1; m <= M; ++m)
        {
            ll maxNum = A[m + M];
            vi shifts = calcShifts(maxNum);
            for (int i : shifts)
            {
                ll amount = (1 << i);
                ll d = amount * m;
                for (int j = sz(dp) - 1; j >= d; --j)
                    dp[j] = max(dp[j], (dp[j - d] != -1) ? dp[j - d] + amount : -1);
            }
        }
    }
}

pii calcPref(vi &A, int M, ll L, ll &pref, ll &tmpans) // find last Prefix position { i, idx } with pref <= L, or { sz(A)-1 = 2 * M, A[2 * M] }
{
    int i = 0;
    tmpans = 0, pref = 0;
    for (; i < M; ++i)
        tmpans += A[i], pref += A[i] * (i - M);
    if (pref >= L)
        return {i, 0};
    while (i < sz(A) && pref + A[i] * (i - M) < L)
    {
        pref += A[i] * (i - M);
        tmpans += A[i];
        ++i;
    }
    if (i == sz(A))
        return {i - 1, A[i - 1]};

    ll delta = L - pref;
    assert(delta >= 0); // The expectation after the while loop is, that one is able to forfill this shit with the A[i] * (i - M) stuff
    ll l = delta / (i - M);
    pref += l * (i - M);
    tmpans += l;

    return {i, l};
}

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

    ll M, L;
    cin >> M >> L;
    vi A(2 * M + 1);
    for (int i = 0; i < sz(A); ++i)
        cin >> A[i];

    vi B(sz(A), 0);
    for (int i = 0; i < sz(B); ++i)
    {
        if (i == M)
        {
            B[i] = A[i];
            A[i] = 0;
            continue;
        }
        B[i] = min(M - 1, A[i]);
        A[i] -= B[i];
    }

    // Calc dp with normal stuff
    calcDP(B, M);

    ll ans = -1;
    for (int foo = 0; foo < 2; ++foo)
    {
        reverse(all(dp)), reverse(all(A));
        L = -L;

        ll i, idx, pref, tmpans;
        tie(i, idx) = calcPref(A, M, L - center, pref, tmpans);

        while (i < sz(A) && L - pref + center >= 0)
        {
            if (L - pref + center < sz(dp) && dp[L - pref + center] != -1)
                ans = max(ans, tmpans + dp[L - pref + center]);
            if (idx < A[i])
            {
                ++idx;
                ++tmpans;
                pref += i - M;
            }
            else
            {
                ++i;
                idx = 0;
            }
        }
    }

    if (ans == -1)
        cout << "impossible\n";
    else
        cout << ans << "\n";

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 80 ms 1236 KB Output is correct
6 Correct 88 ms 1364 KB Output is correct
7 Correct 18 ms 724 KB Output is correct
8 Correct 77 ms 1236 KB Output is correct
9 Correct 185 ms 2132 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 80 ms 1236 KB Output is correct
6 Correct 88 ms 1364 KB Output is correct
7 Correct 18 ms 724 KB Output is correct
8 Correct 77 ms 1236 KB Output is correct
9 Correct 185 ms 2132 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 81 ms 1236 KB Output is correct
17 Correct 94 ms 1364 KB Output is correct
18 Correct 27 ms 724 KB Output is correct
19 Correct 85 ms 1236 KB Output is correct
20 Correct 185 ms 2132 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1860 ms 8660 KB Output is correct
24 Correct 1620 ms 8276 KB Output is correct
25 Correct 217 ms 3156 KB Output is correct
26 Correct 4121 ms 15572 KB Output is correct
27 Correct 4077 ms 15444 KB Output is correct
28 Correct 1 ms 596 KB Output is correct
29 Correct 1 ms 596 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 7 ms 596 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 11 ms 596 KB Output is correct
5 Correct 12 ms 596 KB Output is correct
6 Correct 6 ms 468 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 2 ms 340 KB Output is correct
10 Correct 7 ms 468 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 7 ms 596 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 11 ms 596 KB Output is correct
5 Correct 12 ms 596 KB Output is correct
6 Correct 6 ms 468 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 2 ms 340 KB Output is correct
10 Correct 7 ms 468 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 256 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 10 ms 596 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 9 ms 596 KB Output is correct
18 Correct 13 ms 596 KB Output is correct
19 Correct 8 ms 468 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 2 ms 340 KB Output is correct
23 Correct 5 ms 604 KB Output is correct
24 Correct 18 ms 596 KB Output is correct
25 Correct 3 ms 468 KB Output is correct
26 Correct 29 ms 596 KB Output is correct
27 Correct 15 ms 596 KB Output is correct
28 Correct 22 ms 596 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 7 ms 596 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 11 ms 596 KB Output is correct
5 Correct 12 ms 596 KB Output is correct
6 Correct 6 ms 468 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 2 ms 340 KB Output is correct
10 Correct 7 ms 468 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 10 ms 596 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 10 ms 596 KB Output is correct
15 Correct 12 ms 596 KB Output is correct
16 Correct 6 ms 468 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 2 ms 340 KB Output is correct
20 Correct 5 ms 468 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 58 ms 1492 KB Output is correct
24 Correct 13 ms 852 KB Output is correct
25 Correct 53 ms 1492 KB Output is correct
26 Correct 108 ms 2132 KB Output is correct
27 Correct 67 ms 1620 KB Output is correct
28 Correct 40 ms 1364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 80 ms 1236 KB Output is correct
6 Correct 88 ms 1364 KB Output is correct
7 Correct 18 ms 724 KB Output is correct
8 Correct 77 ms 1236 KB Output is correct
9 Correct 185 ms 2132 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 7 ms 596 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
15 Correct 11 ms 596 KB Output is correct
16 Correct 12 ms 596 KB Output is correct
17 Correct 6 ms 468 KB Output is correct
18 Correct 0 ms 340 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 2 ms 340 KB Output is correct
21 Correct 7 ms 468 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 1 ms 212 KB Output is correct
24 Correct 1 ms 256 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 10 ms 596 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 9 ms 596 KB Output is correct
29 Correct 13 ms 596 KB Output is correct
30 Correct 8 ms 468 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 2 ms 340 KB Output is correct
34 Correct 5 ms 604 KB Output is correct
35 Correct 18 ms 596 KB Output is correct
36 Correct 3 ms 468 KB Output is correct
37 Correct 29 ms 596 KB Output is correct
38 Correct 15 ms 596 KB Output is correct
39 Correct 22 ms 596 KB Output is correct
40 Correct 1 ms 212 KB Output is correct
41 Correct 10 ms 596 KB Output is correct
42 Correct 1 ms 340 KB Output is correct
43 Correct 10 ms 596 KB Output is correct
44 Correct 12 ms 596 KB Output is correct
45 Correct 6 ms 468 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 212 KB Output is correct
48 Correct 2 ms 340 KB Output is correct
49 Correct 5 ms 468 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
52 Correct 58 ms 1492 KB Output is correct
53 Correct 13 ms 852 KB Output is correct
54 Correct 53 ms 1492 KB Output is correct
55 Correct 108 ms 2132 KB Output is correct
56 Correct 67 ms 1620 KB Output is correct
57 Correct 40 ms 1364 KB Output is correct
58 Correct 0 ms 212 KB Output is correct
59 Correct 0 ms 212 KB Output is correct
60 Correct 0 ms 212 KB Output is correct
61 Correct 0 ms 212 KB Output is correct
62 Correct 81 ms 1236 KB Output is correct
63 Correct 95 ms 1364 KB Output is correct
64 Correct 21 ms 724 KB Output is correct
65 Correct 85 ms 1236 KB Output is correct
66 Correct 186 ms 2132 KB Output is correct
67 Correct 1 ms 340 KB Output is correct
68 Correct 1 ms 340 KB Output is correct
69 Correct 7 ms 596 KB Output is correct
70 Correct 1 ms 340 KB Output is correct
71 Correct 10 ms 596 KB Output is correct
72 Correct 12 ms 596 KB Output is correct
73 Correct 5 ms 468 KB Output is correct
74 Correct 1 ms 340 KB Output is correct
75 Correct 1 ms 212 KB Output is correct
76 Correct 2 ms 340 KB Output is correct
77 Correct 4 ms 468 KB Output is correct
78 Correct 19 ms 596 KB Output is correct
79 Correct 3 ms 340 KB Output is correct
80 Correct 27 ms 596 KB Output is correct
81 Correct 13 ms 596 KB Output is correct
82 Correct 16 ms 596 KB Output is correct
83 Correct 55 ms 1492 KB Output is correct
84 Correct 13 ms 852 KB Output is correct
85 Correct 52 ms 1492 KB Output is correct
86 Correct 97 ms 2132 KB Output is correct
87 Correct 60 ms 1620 KB Output is correct
88 Correct 37 ms 1364 KB Output is correct
89 Correct 102 ms 1492 KB Output is correct
90 Correct 197 ms 2132 KB Output is correct
91 Correct 103 ms 1492 KB Output is correct
92 Correct 119 ms 1620 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 7 ms 596 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 11 ms 596 KB Output is correct
5 Correct 12 ms 596 KB Output is correct
6 Correct 6 ms 468 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 2 ms 340 KB Output is correct
10 Correct 7 ms 468 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 10 ms 596 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 10 ms 596 KB Output is correct
15 Correct 12 ms 596 KB Output is correct
16 Correct 6 ms 468 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 2 ms 340 KB Output is correct
20 Correct 5 ms 468 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 58 ms 1492 KB Output is correct
24 Correct 13 ms 852 KB Output is correct
25 Correct 53 ms 1492 KB Output is correct
26 Correct 108 ms 2132 KB Output is correct
27 Correct 67 ms 1620 KB Output is correct
28 Correct 40 ms 1364 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 7 ms 596 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 8 ms 596 KB Output is correct
33 Correct 12 ms 596 KB Output is correct
34 Correct 9 ms 468 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 0 ms 340 KB Output is correct
37 Correct 2 ms 340 KB Output is correct
38 Correct 4 ms 468 KB Output is correct
39 Correct 1 ms 340 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 52 ms 1492 KB Output is correct
42 Correct 13 ms 852 KB Output is correct
43 Correct 56 ms 1492 KB Output is correct
44 Correct 96 ms 2132 KB Output is correct
45 Correct 61 ms 1620 KB Output is correct
46 Correct 37 ms 1364 KB Output is correct
47 Correct 1 ms 596 KB Output is correct
48 Correct 2 ms 596 KB Output is correct
49 Correct 1174 ms 10196 KB Output is correct
50 Correct 180 ms 4564 KB Output is correct
51 Correct 1313 ms 11284 KB Output is correct
52 Correct 2062 ms 15572 KB Output is correct
53 Correct 1122 ms 10068 KB Output is correct
54 Correct 752 ms 8532 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 80 ms 1236 KB Output is correct
6 Correct 88 ms 1364 KB Output is correct
7 Correct 18 ms 724 KB Output is correct
8 Correct 77 ms 1236 KB Output is correct
9 Correct 185 ms 2132 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 81 ms 1236 KB Output is correct
17 Correct 94 ms 1364 KB Output is correct
18 Correct 27 ms 724 KB Output is correct
19 Correct 85 ms 1236 KB Output is correct
20 Correct 185 ms 2132 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1860 ms 8660 KB Output is correct
24 Correct 1620 ms 8276 KB Output is correct
25 Correct 217 ms 3156 KB Output is correct
26 Correct 4121 ms 15572 KB Output is correct
27 Correct 4077 ms 15444 KB Output is correct
28 Correct 1 ms 596 KB Output is correct
29 Correct 1 ms 596 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 7 ms 596 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 11 ms 596 KB Output is correct
34 Correct 12 ms 596 KB Output is correct
35 Correct 6 ms 468 KB Output is correct
36 Correct 0 ms 340 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Correct 2 ms 340 KB Output is correct
39 Correct 7 ms 468 KB Output is correct
40 Correct 0 ms 212 KB Output is correct
41 Correct 1 ms 212 KB Output is correct
42 Correct 1 ms 256 KB Output is correct
43 Correct 1 ms 212 KB Output is correct
44 Correct 10 ms 596 KB Output is correct
45 Correct 1 ms 340 KB Output is correct
46 Correct 9 ms 596 KB Output is correct
47 Correct 13 ms 596 KB Output is correct
48 Correct 8 ms 468 KB Output is correct
49 Correct 1 ms 340 KB Output is correct
50 Correct 1 ms 212 KB Output is correct
51 Correct 2 ms 340 KB Output is correct
52 Correct 5 ms 604 KB Output is correct
53 Correct 18 ms 596 KB Output is correct
54 Correct 3 ms 468 KB Output is correct
55 Correct 29 ms 596 KB Output is correct
56 Correct 15 ms 596 KB Output is correct
57 Correct 22 ms 596 KB Output is correct
58 Correct 1 ms 212 KB Output is correct
59 Correct 10 ms 596 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 10 ms 596 KB Output is correct
62 Correct 12 ms 596 KB Output is correct
63 Correct 6 ms 468 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 212 KB Output is correct
66 Correct 2 ms 340 KB Output is correct
67 Correct 5 ms 468 KB Output is correct
68 Correct 1 ms 340 KB Output is correct
69 Correct 1 ms 340 KB Output is correct
70 Correct 58 ms 1492 KB Output is correct
71 Correct 13 ms 852 KB Output is correct
72 Correct 53 ms 1492 KB Output is correct
73 Correct 108 ms 2132 KB Output is correct
74 Correct 67 ms 1620 KB Output is correct
75 Correct 40 ms 1364 KB Output is correct
76 Correct 0 ms 212 KB Output is correct
77 Correct 0 ms 212 KB Output is correct
78 Correct 0 ms 212 KB Output is correct
79 Correct 0 ms 212 KB Output is correct
80 Correct 81 ms 1236 KB Output is correct
81 Correct 95 ms 1364 KB Output is correct
82 Correct 21 ms 724 KB Output is correct
83 Correct 85 ms 1236 KB Output is correct
84 Correct 186 ms 2132 KB Output is correct
85 Correct 1 ms 340 KB Output is correct
86 Correct 1 ms 340 KB Output is correct
87 Correct 7 ms 596 KB Output is correct
88 Correct 1 ms 340 KB Output is correct
89 Correct 10 ms 596 KB Output is correct
90 Correct 12 ms 596 KB Output is correct
91 Correct 5 ms 468 KB Output is correct
92 Correct 1 ms 340 KB Output is correct
93 Correct 1 ms 212 KB Output is correct
94 Correct 2 ms 340 KB Output is correct
95 Correct 4 ms 468 KB Output is correct
96 Correct 19 ms 596 KB Output is correct
97 Correct 3 ms 340 KB Output is correct
98 Correct 27 ms 596 KB Output is correct
99 Correct 13 ms 596 KB Output is correct
100 Correct 16 ms 596 KB Output is correct
101 Correct 55 ms 1492 KB Output is correct
102 Correct 13 ms 852 KB Output is correct
103 Correct 52 ms 1492 KB Output is correct
104 Correct 97 ms 2132 KB Output is correct
105 Correct 60 ms 1620 KB Output is correct
106 Correct 37 ms 1364 KB Output is correct
107 Correct 102 ms 1492 KB Output is correct
108 Correct 197 ms 2132 KB Output is correct
109 Correct 103 ms 1492 KB Output is correct
110 Correct 119 ms 1620 KB Output is correct
111 Correct 1 ms 212 KB Output is correct
112 Correct 7 ms 596 KB Output is correct
113 Correct 1 ms 340 KB Output is correct
114 Correct 8 ms 596 KB Output is correct
115 Correct 12 ms 596 KB Output is correct
116 Correct 9 ms 468 KB Output is correct
117 Correct 1 ms 340 KB Output is correct
118 Correct 0 ms 340 KB Output is correct
119 Correct 2 ms 340 KB Output is correct
120 Correct 4 ms 468 KB Output is correct
121 Correct 1 ms 340 KB Output is correct
122 Correct 1 ms 340 KB Output is correct
123 Correct 52 ms 1492 KB Output is correct
124 Correct 13 ms 852 KB Output is correct
125 Correct 56 ms 1492 KB Output is correct
126 Correct 96 ms 2132 KB Output is correct
127 Correct 61 ms 1620 KB Output is correct
128 Correct 37 ms 1364 KB Output is correct
129 Correct 1 ms 596 KB Output is correct
130 Correct 2 ms 596 KB Output is correct
131 Correct 1174 ms 10196 KB Output is correct
132 Correct 180 ms 4564 KB Output is correct
133 Correct 1313 ms 11284 KB Output is correct
134 Correct 2062 ms 15572 KB Output is correct
135 Correct 1122 ms 10068 KB Output is correct
136 Correct 752 ms 8532 KB Output is correct
137 Correct 0 ms 212 KB Output is correct
138 Correct 0 ms 212 KB Output is correct
139 Correct 0 ms 212 KB Output is correct
140 Correct 1 ms 212 KB Output is correct
141 Correct 90 ms 1236 KB Output is correct
142 Correct 89 ms 1304 KB Output is correct
143 Correct 24 ms 724 KB Output is correct
144 Correct 75 ms 1236 KB Output is correct
145 Correct 206 ms 2132 KB Output is correct
146 Correct 1 ms 340 KB Output is correct
147 Correct 1 ms 340 KB Output is correct
148 Correct 1827 ms 8660 KB Output is correct
149 Correct 1718 ms 8276 KB Output is correct
150 Correct 220 ms 3156 KB Output is correct
151 Correct 4022 ms 15572 KB Output is correct
152 Correct 3903 ms 15444 KB Output is correct
153 Correct 1 ms 596 KB Output is correct
154 Correct 2 ms 596 KB Output is correct
155 Correct 7 ms 596 KB Output is correct
156 Correct 1 ms 340 KB Output is correct
157 Correct 8 ms 596 KB Output is correct
158 Correct 11 ms 596 KB Output is correct
159 Correct 5 ms 468 KB Output is correct
160 Correct 0 ms 340 KB Output is correct
161 Correct 0 ms 212 KB Output is correct
162 Correct 2 ms 340 KB Output is correct
163 Correct 4 ms 420 KB Output is correct
164 Correct 50 ms 1492 KB Output is correct
165 Correct 12 ms 852 KB Output is correct
166 Correct 56 ms 1496 KB Output is correct
167 Correct 97 ms 2132 KB Output is correct
168 Correct 73 ms 1620 KB Output is correct
169 Correct 39 ms 1364 KB Output is correct
170 Correct 14 ms 596 KB Output is correct
171 Correct 3 ms 340 KB Output is correct
172 Correct 22 ms 596 KB Output is correct
173 Correct 13 ms 468 KB Output is correct
174 Correct 18 ms 596 KB Output is correct
175 Correct 105 ms 1492 KB Output is correct
176 Correct 179 ms 2132 KB Output is correct
177 Correct 99 ms 1492 KB Output is correct
178 Correct 117 ms 1648 KB Output is correct
179 Correct 1066 ms 10196 KB Output is correct
180 Correct 180 ms 4564 KB Output is correct
181 Correct 1331 ms 11348 KB Output is correct
182 Correct 2017 ms 15572 KB Output is correct
183 Correct 1076 ms 10068 KB Output is correct
184 Correct 731 ms 8532 KB Output is correct
185 Correct 2225 ms 10320 KB Output is correct
186 Correct 3910 ms 15572 KB Output is correct
187 Correct 2180 ms 10324 KB Output is correct
188 Correct 2231 ms 10324 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 7 ms 596 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 11 ms 596 KB Output is correct
5 Correct 12 ms 596 KB Output is correct
6 Correct 6 ms 468 KB Output is correct
7 Correct 0 ms 340 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 2 ms 340 KB Output is correct
10 Correct 7 ms 468 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 10 ms 596 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 10 ms 596 KB Output is correct
15 Correct 12 ms 596 KB Output is correct
16 Correct 6 ms 468 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 2 ms 340 KB Output is correct
20 Correct 5 ms 468 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 58 ms 1492 KB Output is correct
24 Correct 13 ms 852 KB Output is correct
25 Correct 53 ms 1492 KB Output is correct
26 Correct 108 ms 2132 KB Output is correct
27 Correct 67 ms 1620 KB Output is correct
28 Correct 40 ms 1364 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 7 ms 596 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 8 ms 596 KB Output is correct
33 Correct 12 ms 596 KB Output is correct
34 Correct 9 ms 468 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 0 ms 340 KB Output is correct
37 Correct 2 ms 340 KB Output is correct
38 Correct 4 ms 468 KB Output is correct
39 Correct 1 ms 340 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 52 ms 1492 KB Output is correct
42 Correct 13 ms 852 KB Output is correct
43 Correct 56 ms 1492 KB Output is correct
44 Correct 96 ms 2132 KB Output is correct
45 Correct 61 ms 1620 KB Output is correct
46 Correct 37 ms 1364 KB Output is correct
47 Correct 1 ms 596 KB Output is correct
48 Correct 2 ms 596 KB Output is correct
49 Correct 1174 ms 10196 KB Output is correct
50 Correct 180 ms 4564 KB Output is correct
51 Correct 1313 ms 11284 KB Output is correct
52 Correct 2062 ms 15572 KB Output is correct
53 Correct 1122 ms 10068 KB Output is correct
54 Correct 752 ms 8532 KB Output is correct
55 Correct 0 ms 212 KB Output is correct
56 Correct 7 ms 596 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 8 ms 596 KB Output is correct
59 Correct 11 ms 596 KB Output is correct
60 Correct 6 ms 468 KB Output is correct
61 Correct 1 ms 340 KB Output is correct
62 Correct 0 ms 212 KB Output is correct
63 Correct 2 ms 340 KB Output is correct
64 Correct 5 ms 468 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 1 ms 340 KB Output is correct
67 Correct 51 ms 1492 KB Output is correct
68 Correct 12 ms 852 KB Output is correct
69 Correct 51 ms 1492 KB Output is correct
70 Correct 99 ms 2132 KB Output is correct
71 Correct 59 ms 1620 KB Output is correct
72 Correct 36 ms 1364 KB Output is correct
73 Correct 2 ms 596 KB Output is correct
74 Correct 2 ms 596 KB Output is correct
75 Correct 1159 ms 10168 KB Output is correct
76 Correct 193 ms 4564 KB Output is correct
77 Correct 1388 ms 11348 KB Output is correct
78 Correct 2126 ms 15572 KB Output is correct
79 Correct 1178 ms 10068 KB Output is correct
80 Correct 773 ms 8532 KB Output is correct
81 Execution timed out 5041 ms 284492 KB Time limit exceeded
82 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 80 ms 1236 KB Output is correct
6 Correct 88 ms 1364 KB Output is correct
7 Correct 18 ms 724 KB Output is correct
8 Correct 77 ms 1236 KB Output is correct
9 Correct 185 ms 2132 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 81 ms 1236 KB Output is correct
17 Correct 94 ms 1364 KB Output is correct
18 Correct 27 ms 724 KB Output is correct
19 Correct 85 ms 1236 KB Output is correct
20 Correct 185 ms 2132 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1860 ms 8660 KB Output is correct
24 Correct 1620 ms 8276 KB Output is correct
25 Correct 217 ms 3156 KB Output is correct
26 Correct 4121 ms 15572 KB Output is correct
27 Correct 4077 ms 15444 KB Output is correct
28 Correct 1 ms 596 KB Output is correct
29 Correct 1 ms 596 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 7 ms 596 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 11 ms 596 KB Output is correct
34 Correct 12 ms 596 KB Output is correct
35 Correct 6 ms 468 KB Output is correct
36 Correct 0 ms 340 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Correct 2 ms 340 KB Output is correct
39 Correct 7 ms 468 KB Output is correct
40 Correct 0 ms 212 KB Output is correct
41 Correct 1 ms 212 KB Output is correct
42 Correct 1 ms 256 KB Output is correct
43 Correct 1 ms 212 KB Output is correct
44 Correct 10 ms 596 KB Output is correct
45 Correct 1 ms 340 KB Output is correct
46 Correct 9 ms 596 KB Output is correct
47 Correct 13 ms 596 KB Output is correct
48 Correct 8 ms 468 KB Output is correct
49 Correct 1 ms 340 KB Output is correct
50 Correct 1 ms 212 KB Output is correct
51 Correct 2 ms 340 KB Output is correct
52 Correct 5 ms 604 KB Output is correct
53 Correct 18 ms 596 KB Output is correct
54 Correct 3 ms 468 KB Output is correct
55 Correct 29 ms 596 KB Output is correct
56 Correct 15 ms 596 KB Output is correct
57 Correct 22 ms 596 KB Output is correct
58 Correct 1 ms 212 KB Output is correct
59 Correct 10 ms 596 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 10 ms 596 KB Output is correct
62 Correct 12 ms 596 KB Output is correct
63 Correct 6 ms 468 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 212 KB Output is correct
66 Correct 2 ms 340 KB Output is correct
67 Correct 5 ms 468 KB Output is correct
68 Correct 1 ms 340 KB Output is correct
69 Correct 1 ms 340 KB Output is correct
70 Correct 58 ms 1492 KB Output is correct
71 Correct 13 ms 852 KB Output is correct
72 Correct 53 ms 1492 KB Output is correct
73 Correct 108 ms 2132 KB Output is correct
74 Correct 67 ms 1620 KB Output is correct
75 Correct 40 ms 1364 KB Output is correct
76 Correct 0 ms 212 KB Output is correct
77 Correct 0 ms 212 KB Output is correct
78 Correct 0 ms 212 KB Output is correct
79 Correct 0 ms 212 KB Output is correct
80 Correct 81 ms 1236 KB Output is correct
81 Correct 95 ms 1364 KB Output is correct
82 Correct 21 ms 724 KB Output is correct
83 Correct 85 ms 1236 KB Output is correct
84 Correct 186 ms 2132 KB Output is correct
85 Correct 1 ms 340 KB Output is correct
86 Correct 1 ms 340 KB Output is correct
87 Correct 7 ms 596 KB Output is correct
88 Correct 1 ms 340 KB Output is correct
89 Correct 10 ms 596 KB Output is correct
90 Correct 12 ms 596 KB Output is correct
91 Correct 5 ms 468 KB Output is correct
92 Correct 1 ms 340 KB Output is correct
93 Correct 1 ms 212 KB Output is correct
94 Correct 2 ms 340 KB Output is correct
95 Correct 4 ms 468 KB Output is correct
96 Correct 19 ms 596 KB Output is correct
97 Correct 3 ms 340 KB Output is correct
98 Correct 27 ms 596 KB Output is correct
99 Correct 13 ms 596 KB Output is correct
100 Correct 16 ms 596 KB Output is correct
101 Correct 55 ms 1492 KB Output is correct
102 Correct 13 ms 852 KB Output is correct
103 Correct 52 ms 1492 KB Output is correct
104 Correct 97 ms 2132 KB Output is correct
105 Correct 60 ms 1620 KB Output is correct
106 Correct 37 ms 1364 KB Output is correct
107 Correct 102 ms 1492 KB Output is correct
108 Correct 197 ms 2132 KB Output is correct
109 Correct 103 ms 1492 KB Output is correct
110 Correct 119 ms 1620 KB Output is correct
111 Correct 1 ms 212 KB Output is correct
112 Correct 7 ms 596 KB Output is correct
113 Correct 1 ms 340 KB Output is correct
114 Correct 8 ms 596 KB Output is correct
115 Correct 12 ms 596 KB Output is correct
116 Correct 9 ms 468 KB Output is correct
117 Correct 1 ms 340 KB Output is correct
118 Correct 0 ms 340 KB Output is correct
119 Correct 2 ms 340 KB Output is correct
120 Correct 4 ms 468 KB Output is correct
121 Correct 1 ms 340 KB Output is correct
122 Correct 1 ms 340 KB Output is correct
123 Correct 52 ms 1492 KB Output is correct
124 Correct 13 ms 852 KB Output is correct
125 Correct 56 ms 1492 KB Output is correct
126 Correct 96 ms 2132 KB Output is correct
127 Correct 61 ms 1620 KB Output is correct
128 Correct 37 ms 1364 KB Output is correct
129 Correct 1 ms 596 KB Output is correct
130 Correct 2 ms 596 KB Output is correct
131 Correct 1174 ms 10196 KB Output is correct
132 Correct 180 ms 4564 KB Output is correct
133 Correct 1313 ms 11284 KB Output is correct
134 Correct 2062 ms 15572 KB Output is correct
135 Correct 1122 ms 10068 KB Output is correct
136 Correct 752 ms 8532 KB Output is correct
137 Correct 0 ms 212 KB Output is correct
138 Correct 0 ms 212 KB Output is correct
139 Correct 0 ms 212 KB Output is correct
140 Correct 1 ms 212 KB Output is correct
141 Correct 90 ms 1236 KB Output is correct
142 Correct 89 ms 1304 KB Output is correct
143 Correct 24 ms 724 KB Output is correct
144 Correct 75 ms 1236 KB Output is correct
145 Correct 206 ms 2132 KB Output is correct
146 Correct 1 ms 340 KB Output is correct
147 Correct 1 ms 340 KB Output is correct
148 Correct 1827 ms 8660 KB Output is correct
149 Correct 1718 ms 8276 KB Output is correct
150 Correct 220 ms 3156 KB Output is correct
151 Correct 4022 ms 15572 KB Output is correct
152 Correct 3903 ms 15444 KB Output is correct
153 Correct 1 ms 596 KB Output is correct
154 Correct 2 ms 596 KB Output is correct
155 Correct 7 ms 596 KB Output is correct
156 Correct 1 ms 340 KB Output is correct
157 Correct 8 ms 596 KB Output is correct
158 Correct 11 ms 596 KB Output is correct
159 Correct 5 ms 468 KB Output is correct
160 Correct 0 ms 340 KB Output is correct
161 Correct 0 ms 212 KB Output is correct
162 Correct 2 ms 340 KB Output is correct
163 Correct 4 ms 420 KB Output is correct
164 Correct 50 ms 1492 KB Output is correct
165 Correct 12 ms 852 KB Output is correct
166 Correct 56 ms 1496 KB Output is correct
167 Correct 97 ms 2132 KB Output is correct
168 Correct 73 ms 1620 KB Output is correct
169 Correct 39 ms 1364 KB Output is correct
170 Correct 14 ms 596 KB Output is correct
171 Correct 3 ms 340 KB Output is correct
172 Correct 22 ms 596 KB Output is correct
173 Correct 13 ms 468 KB Output is correct
174 Correct 18 ms 596 KB Output is correct
175 Correct 105 ms 1492 KB Output is correct
176 Correct 179 ms 2132 KB Output is correct
177 Correct 99 ms 1492 KB Output is correct
178 Correct 117 ms 1648 KB Output is correct
179 Correct 1066 ms 10196 KB Output is correct
180 Correct 180 ms 4564 KB Output is correct
181 Correct 1331 ms 11348 KB Output is correct
182 Correct 2017 ms 15572 KB Output is correct
183 Correct 1076 ms 10068 KB Output is correct
184 Correct 731 ms 8532 KB Output is correct
185 Correct 2225 ms 10320 KB Output is correct
186 Correct 3910 ms 15572 KB Output is correct
187 Correct 2180 ms 10324 KB Output is correct
188 Correct 2231 ms 10324 KB Output is correct
189 Correct 0 ms 212 KB Output is correct
190 Correct 7 ms 596 KB Output is correct
191 Correct 1 ms 340 KB Output is correct
192 Correct 8 ms 596 KB Output is correct
193 Correct 11 ms 596 KB Output is correct
194 Correct 6 ms 468 KB Output is correct
195 Correct 1 ms 340 KB Output is correct
196 Correct 0 ms 212 KB Output is correct
197 Correct 2 ms 340 KB Output is correct
198 Correct 5 ms 468 KB Output is correct
199 Correct 1 ms 340 KB Output is correct
200 Correct 1 ms 340 KB Output is correct
201 Correct 51 ms 1492 KB Output is correct
202 Correct 12 ms 852 KB Output is correct
203 Correct 51 ms 1492 KB Output is correct
204 Correct 99 ms 2132 KB Output is correct
205 Correct 59 ms 1620 KB Output is correct
206 Correct 36 ms 1364 KB Output is correct
207 Correct 2 ms 596 KB Output is correct
208 Correct 2 ms 596 KB Output is correct
209 Correct 1159 ms 10168 KB Output is correct
210 Correct 193 ms 4564 KB Output is correct
211 Correct 1388 ms 11348 KB Output is correct
212 Correct 2126 ms 15572 KB Output is correct
213 Correct 1178 ms 10068 KB Output is correct
214 Correct 773 ms 8532 KB Output is correct
215 Execution timed out 5041 ms 284492 KB Time limit exceeded
216 Halted 0 ms 0 KB -