답안 #708407

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
708407 2023-03-11T17:29:27 Z Johann Uplifting Excursion (BOI22_vault) C++14
50 / 100
5000 ms 427204 KB
#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;
}

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

    ll MAXSIZE = 2 * M * max(an, ap) + 2;

    vi dp(MAXSIZE, -1);
    ll center = MAXSIZE / 2;
    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);
            }
        }
    }

    if (0 <= center + L && center + L < sz(dp))
        return dp[center + L];
    else
        return -1;
}

pii calcPref(vi &A, int M, ll L, ll &pref, ll &tmpans) // find first 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 = 0, r = A[i], m;
    while (l < r)
    {
        m = (l + r) / 2;
        ll v = (i - M) * m;
        if (v < delta)
            l = m + 1;
        else
            r = 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];

    // cout << calcDP(A, L, M) << endl;

    vi B(sz(A), 0);
    ll dpMax = 0, dpMin = 0; // Obere Grenze und untere Grenze für das davon induzierte DP
    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];
        dpMax = max(dpMax, dpMax + B[i] * (i - M));
        dpMin = min(dpMin, dpMin + B[i] * (i - M));
    }

    vi C;
    for (ll b : B)
        C.push_back(b);
    ll li, lidx, ri, ridx, pref, tmpans;
    tie(ri, ridx) = calcPref(A, M, L - dpMin + 1, pref, tmpans);
    tie(li, lidx) = calcPref(A, M, L - dpMax, pref, tmpans);

    for (int i = li; i < ri; ++i)
    {
        C[i] += A[i] - lidx;
        lidx = 0;
    }
    C[ri] += ridx - lidx;

    ll ans = -1;
    ll tmp = calcDP(C, L - pref, M);
    if (tmp != -1)
        ans = tmpans + tmp;

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

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 81 ms 1236 KB Output is correct
6 Correct 90 ms 1364 KB Output is correct
7 Correct 25 ms 724 KB Output is correct
8 Correct 84 ms 1236 KB Output is correct
9 Correct 183 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 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 81 ms 1236 KB Output is correct
6 Correct 90 ms 1364 KB Output is correct
7 Correct 25 ms 724 KB Output is correct
8 Correct 84 ms 1236 KB Output is correct
9 Correct 183 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 0 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 83 ms 1236 KB Output is correct
17 Correct 85 ms 1364 KB Output is correct
18 Correct 19 ms 724 KB Output is correct
19 Correct 78 ms 1236 KB Output is correct
20 Correct 210 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 1802 ms 8660 KB Output is correct
24 Correct 1678 ms 8276 KB Output is correct
25 Correct 214 ms 3156 KB Output is correct
26 Correct 4091 ms 15572 KB Output is correct
27 Correct 4133 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 17 ms 980 KB Output is correct
5 Correct 18 ms 852 KB Output is correct
6 Correct 93 ms 3388 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 3 ms 468 KB Output is correct
10 Correct 6 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 17 ms 980 KB Output is correct
5 Correct 18 ms 852 KB Output is correct
6 Correct 93 ms 3388 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 3 ms 468 KB Output is correct
10 Correct 6 ms 468 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 316 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 320 KB Output is correct
15 Correct 7 ms 596 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 24 ms 960 KB Output is correct
18 Correct 20 ms 852 KB Output is correct
19 Correct 78 ms 3412 KB Output is correct
20 Correct 1 ms 340 KB Output is correct
21 Correct 1 ms 340 KB Output is correct
22 Correct 3 ms 468 KB Output is correct
23 Correct 5 ms 468 KB Output is correct
24 Correct 22 ms 704 KB Output is correct
25 Correct 3 ms 420 KB Output is correct
26 Correct 191 ms 3028 KB Output is correct
27 Correct 30 ms 852 KB Output is correct
28 Correct 303 ms 5716 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 17 ms 980 KB Output is correct
5 Correct 18 ms 852 KB Output is correct
6 Correct 93 ms 3388 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 3 ms 468 KB Output is correct
10 Correct 6 ms 468 KB Output is correct
11 Correct 1 ms 324 KB Output is correct
12 Correct 8 ms 596 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 20 ms 980 KB Output is correct
15 Correct 19 ms 852 KB Output is correct
16 Correct 84 ms 3412 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 5 ms 592 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 56 ms 1492 KB Output is correct
24 Correct 12 ms 852 KB Output is correct
25 Correct 81 ms 2132 KB Output is correct
26 Correct 205 ms 3900 KB Output is correct
27 Correct 1957 ms 33216 KB Output is correct
28 Correct 57 ms 1876 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 81 ms 1236 KB Output is correct
6 Correct 90 ms 1364 KB Output is correct
7 Correct 25 ms 724 KB Output is correct
8 Correct 84 ms 1236 KB Output is correct
9 Correct 183 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 17 ms 980 KB Output is correct
16 Correct 18 ms 852 KB Output is correct
17 Correct 93 ms 3388 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 1 ms 340 KB Output is correct
20 Correct 3 ms 468 KB Output is correct
21 Correct 6 ms 468 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 1 ms 316 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 1 ms 320 KB Output is correct
26 Correct 7 ms 596 KB Output is correct
27 Correct 1 ms 340 KB Output is correct
28 Correct 24 ms 960 KB Output is correct
29 Correct 20 ms 852 KB Output is correct
30 Correct 78 ms 3412 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 3 ms 468 KB Output is correct
34 Correct 5 ms 468 KB Output is correct
35 Correct 22 ms 704 KB Output is correct
36 Correct 3 ms 420 KB Output is correct
37 Correct 191 ms 3028 KB Output is correct
38 Correct 30 ms 852 KB Output is correct
39 Correct 303 ms 5716 KB Output is correct
40 Correct 1 ms 324 KB Output is correct
41 Correct 8 ms 596 KB Output is correct
42 Correct 1 ms 340 KB Output is correct
43 Correct 20 ms 980 KB Output is correct
44 Correct 19 ms 852 KB Output is correct
45 Correct 84 ms 3412 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 5 ms 592 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 56 ms 1492 KB Output is correct
53 Correct 12 ms 852 KB Output is correct
54 Correct 81 ms 2132 KB Output is correct
55 Correct 205 ms 3900 KB Output is correct
56 Correct 1957 ms 33216 KB Output is correct
57 Correct 57 ms 1876 KB Output is correct
58 Correct 1 ms 324 KB Output is correct
59 Correct 1 ms 212 KB Output is correct
60 Correct 1 ms 212 KB Output is correct
61 Correct 1 ms 212 KB Output is correct
62 Correct 77 ms 1236 KB Output is correct
63 Correct 88 ms 1364 KB Output is correct
64 Correct 20 ms 724 KB Output is correct
65 Correct 84 ms 1236 KB Output is correct
66 Correct 187 ms 2132 KB Output is correct
67 Correct 1 ms 316 KB Output is correct
68 Correct 1 ms 340 KB Output is correct
69 Correct 9 ms 596 KB Output is correct
70 Correct 1 ms 340 KB Output is correct
71 Correct 22 ms 980 KB Output is correct
72 Correct 22 ms 852 KB Output is correct
73 Correct 78 ms 3412 KB Output is correct
74 Correct 1 ms 340 KB Output is correct
75 Correct 1 ms 340 KB Output is correct
76 Correct 3 ms 468 KB Output is correct
77 Correct 4 ms 572 KB Output is correct
78 Correct 20 ms 724 KB Output is correct
79 Correct 4 ms 340 KB Output is correct
80 Correct 166 ms 3028 KB Output is correct
81 Correct 28 ms 852 KB Output is correct
82 Correct 284 ms 5696 KB Output is correct
83 Correct 54 ms 1492 KB Output is correct
84 Correct 13 ms 852 KB Output is correct
85 Correct 82 ms 2236 KB Output is correct
86 Correct 188 ms 3924 KB Output is correct
87 Correct 1966 ms 33236 KB Output is correct
88 Correct 56 ms 1876 KB Output is correct
89 Correct 161 ms 2112 KB Output is correct
90 Correct 399 ms 4180 KB Output is correct
91 Correct 300 ms 3796 KB Output is correct
92 Execution timed out 5045 ms 45012 KB Time limit exceeded
93 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 17 ms 980 KB Output is correct
5 Correct 18 ms 852 KB Output is correct
6 Correct 93 ms 3388 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 3 ms 468 KB Output is correct
10 Correct 6 ms 468 KB Output is correct
11 Correct 1 ms 324 KB Output is correct
12 Correct 8 ms 596 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 20 ms 980 KB Output is correct
15 Correct 19 ms 852 KB Output is correct
16 Correct 84 ms 3412 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 5 ms 592 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 56 ms 1492 KB Output is correct
24 Correct 12 ms 852 KB Output is correct
25 Correct 81 ms 2132 KB Output is correct
26 Correct 205 ms 3900 KB Output is correct
27 Correct 1957 ms 33216 KB Output is correct
28 Correct 57 ms 1876 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 8 ms 596 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 18 ms 980 KB Output is correct
33 Correct 21 ms 832 KB Output is correct
34 Correct 90 ms 3388 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 0 ms 316 KB Output is correct
37 Correct 3 ms 468 KB Output is correct
38 Correct 5 ms 468 KB Output is correct
39 Correct 1 ms 316 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 54 ms 1492 KB Output is correct
42 Correct 12 ms 852 KB Output is correct
43 Correct 82 ms 2224 KB Output is correct
44 Correct 191 ms 3924 KB Output is correct
45 Correct 1960 ms 33204 KB Output is correct
46 Correct 54 ms 1876 KB Output is correct
47 Correct 2 ms 596 KB Output is correct
48 Correct 3 ms 584 KB Output is correct
49 Correct 1208 ms 10452 KB Output is correct
50 Correct 192 ms 4564 KB Output is correct
51 Correct 2623 ms 19392 KB Output is correct
52 Correct 4162 ms 28884 KB Output is correct
53 Execution timed out 5093 ms 427204 KB Time limit exceeded
54 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 81 ms 1236 KB Output is correct
6 Correct 90 ms 1364 KB Output is correct
7 Correct 25 ms 724 KB Output is correct
8 Correct 84 ms 1236 KB Output is correct
9 Correct 183 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 0 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 83 ms 1236 KB Output is correct
17 Correct 85 ms 1364 KB Output is correct
18 Correct 19 ms 724 KB Output is correct
19 Correct 78 ms 1236 KB Output is correct
20 Correct 210 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 1802 ms 8660 KB Output is correct
24 Correct 1678 ms 8276 KB Output is correct
25 Correct 214 ms 3156 KB Output is correct
26 Correct 4091 ms 15572 KB Output is correct
27 Correct 4133 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 17 ms 980 KB Output is correct
34 Correct 18 ms 852 KB Output is correct
35 Correct 93 ms 3388 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 3 ms 468 KB Output is correct
39 Correct 6 ms 468 KB Output is correct
40 Correct 1 ms 212 KB Output is correct
41 Correct 1 ms 316 KB Output is correct
42 Correct 1 ms 212 KB Output is correct
43 Correct 1 ms 320 KB Output is correct
44 Correct 7 ms 596 KB Output is correct
45 Correct 1 ms 340 KB Output is correct
46 Correct 24 ms 960 KB Output is correct
47 Correct 20 ms 852 KB Output is correct
48 Correct 78 ms 3412 KB Output is correct
49 Correct 1 ms 340 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 3 ms 468 KB Output is correct
52 Correct 5 ms 468 KB Output is correct
53 Correct 22 ms 704 KB Output is correct
54 Correct 3 ms 420 KB Output is correct
55 Correct 191 ms 3028 KB Output is correct
56 Correct 30 ms 852 KB Output is correct
57 Correct 303 ms 5716 KB Output is correct
58 Correct 1 ms 324 KB Output is correct
59 Correct 8 ms 596 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 20 ms 980 KB Output is correct
62 Correct 19 ms 852 KB Output is correct
63 Correct 84 ms 3412 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 5 ms 592 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 56 ms 1492 KB Output is correct
71 Correct 12 ms 852 KB Output is correct
72 Correct 81 ms 2132 KB Output is correct
73 Correct 205 ms 3900 KB Output is correct
74 Correct 1957 ms 33216 KB Output is correct
75 Correct 57 ms 1876 KB Output is correct
76 Correct 1 ms 324 KB Output is correct
77 Correct 1 ms 212 KB Output is correct
78 Correct 1 ms 212 KB Output is correct
79 Correct 1 ms 212 KB Output is correct
80 Correct 77 ms 1236 KB Output is correct
81 Correct 88 ms 1364 KB Output is correct
82 Correct 20 ms 724 KB Output is correct
83 Correct 84 ms 1236 KB Output is correct
84 Correct 187 ms 2132 KB Output is correct
85 Correct 1 ms 316 KB Output is correct
86 Correct 1 ms 340 KB Output is correct
87 Correct 9 ms 596 KB Output is correct
88 Correct 1 ms 340 KB Output is correct
89 Correct 22 ms 980 KB Output is correct
90 Correct 22 ms 852 KB Output is correct
91 Correct 78 ms 3412 KB Output is correct
92 Correct 1 ms 340 KB Output is correct
93 Correct 1 ms 340 KB Output is correct
94 Correct 3 ms 468 KB Output is correct
95 Correct 4 ms 572 KB Output is correct
96 Correct 20 ms 724 KB Output is correct
97 Correct 4 ms 340 KB Output is correct
98 Correct 166 ms 3028 KB Output is correct
99 Correct 28 ms 852 KB Output is correct
100 Correct 284 ms 5696 KB Output is correct
101 Correct 54 ms 1492 KB Output is correct
102 Correct 13 ms 852 KB Output is correct
103 Correct 82 ms 2236 KB Output is correct
104 Correct 188 ms 3924 KB Output is correct
105 Correct 1966 ms 33236 KB Output is correct
106 Correct 56 ms 1876 KB Output is correct
107 Correct 161 ms 2112 KB Output is correct
108 Correct 399 ms 4180 KB Output is correct
109 Correct 300 ms 3796 KB Output is correct
110 Execution timed out 5045 ms 45012 KB Time limit exceeded
111 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 17 ms 980 KB Output is correct
5 Correct 18 ms 852 KB Output is correct
6 Correct 93 ms 3388 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 3 ms 468 KB Output is correct
10 Correct 6 ms 468 KB Output is correct
11 Correct 1 ms 324 KB Output is correct
12 Correct 8 ms 596 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 20 ms 980 KB Output is correct
15 Correct 19 ms 852 KB Output is correct
16 Correct 84 ms 3412 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 5 ms 592 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 56 ms 1492 KB Output is correct
24 Correct 12 ms 852 KB Output is correct
25 Correct 81 ms 2132 KB Output is correct
26 Correct 205 ms 3900 KB Output is correct
27 Correct 1957 ms 33216 KB Output is correct
28 Correct 57 ms 1876 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 8 ms 596 KB Output is correct
31 Correct 1 ms 340 KB Output is correct
32 Correct 18 ms 980 KB Output is correct
33 Correct 21 ms 832 KB Output is correct
34 Correct 90 ms 3388 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 0 ms 316 KB Output is correct
37 Correct 3 ms 468 KB Output is correct
38 Correct 5 ms 468 KB Output is correct
39 Correct 1 ms 316 KB Output is correct
40 Correct 1 ms 340 KB Output is correct
41 Correct 54 ms 1492 KB Output is correct
42 Correct 12 ms 852 KB Output is correct
43 Correct 82 ms 2224 KB Output is correct
44 Correct 191 ms 3924 KB Output is correct
45 Correct 1960 ms 33204 KB Output is correct
46 Correct 54 ms 1876 KB Output is correct
47 Correct 2 ms 596 KB Output is correct
48 Correct 3 ms 584 KB Output is correct
49 Correct 1208 ms 10452 KB Output is correct
50 Correct 192 ms 4564 KB Output is correct
51 Correct 2623 ms 19392 KB Output is correct
52 Correct 4162 ms 28884 KB Output is correct
53 Execution timed out 5093 ms 427204 KB Time limit exceeded
54 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 81 ms 1236 KB Output is correct
6 Correct 90 ms 1364 KB Output is correct
7 Correct 25 ms 724 KB Output is correct
8 Correct 84 ms 1236 KB Output is correct
9 Correct 183 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 0 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 83 ms 1236 KB Output is correct
17 Correct 85 ms 1364 KB Output is correct
18 Correct 19 ms 724 KB Output is correct
19 Correct 78 ms 1236 KB Output is correct
20 Correct 210 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 1802 ms 8660 KB Output is correct
24 Correct 1678 ms 8276 KB Output is correct
25 Correct 214 ms 3156 KB Output is correct
26 Correct 4091 ms 15572 KB Output is correct
27 Correct 4133 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 17 ms 980 KB Output is correct
34 Correct 18 ms 852 KB Output is correct
35 Correct 93 ms 3388 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 340 KB Output is correct
38 Correct 3 ms 468 KB Output is correct
39 Correct 6 ms 468 KB Output is correct
40 Correct 1 ms 212 KB Output is correct
41 Correct 1 ms 316 KB Output is correct
42 Correct 1 ms 212 KB Output is correct
43 Correct 1 ms 320 KB Output is correct
44 Correct 7 ms 596 KB Output is correct
45 Correct 1 ms 340 KB Output is correct
46 Correct 24 ms 960 KB Output is correct
47 Correct 20 ms 852 KB Output is correct
48 Correct 78 ms 3412 KB Output is correct
49 Correct 1 ms 340 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 3 ms 468 KB Output is correct
52 Correct 5 ms 468 KB Output is correct
53 Correct 22 ms 704 KB Output is correct
54 Correct 3 ms 420 KB Output is correct
55 Correct 191 ms 3028 KB Output is correct
56 Correct 30 ms 852 KB Output is correct
57 Correct 303 ms 5716 KB Output is correct
58 Correct 1 ms 324 KB Output is correct
59 Correct 8 ms 596 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 20 ms 980 KB Output is correct
62 Correct 19 ms 852 KB Output is correct
63 Correct 84 ms 3412 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 5 ms 592 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 56 ms 1492 KB Output is correct
71 Correct 12 ms 852 KB Output is correct
72 Correct 81 ms 2132 KB Output is correct
73 Correct 205 ms 3900 KB Output is correct
74 Correct 1957 ms 33216 KB Output is correct
75 Correct 57 ms 1876 KB Output is correct
76 Correct 1 ms 324 KB Output is correct
77 Correct 1 ms 212 KB Output is correct
78 Correct 1 ms 212 KB Output is correct
79 Correct 1 ms 212 KB Output is correct
80 Correct 77 ms 1236 KB Output is correct
81 Correct 88 ms 1364 KB Output is correct
82 Correct 20 ms 724 KB Output is correct
83 Correct 84 ms 1236 KB Output is correct
84 Correct 187 ms 2132 KB Output is correct
85 Correct 1 ms 316 KB Output is correct
86 Correct 1 ms 340 KB Output is correct
87 Correct 9 ms 596 KB Output is correct
88 Correct 1 ms 340 KB Output is correct
89 Correct 22 ms 980 KB Output is correct
90 Correct 22 ms 852 KB Output is correct
91 Correct 78 ms 3412 KB Output is correct
92 Correct 1 ms 340 KB Output is correct
93 Correct 1 ms 340 KB Output is correct
94 Correct 3 ms 468 KB Output is correct
95 Correct 4 ms 572 KB Output is correct
96 Correct 20 ms 724 KB Output is correct
97 Correct 4 ms 340 KB Output is correct
98 Correct 166 ms 3028 KB Output is correct
99 Correct 28 ms 852 KB Output is correct
100 Correct 284 ms 5696 KB Output is correct
101 Correct 54 ms 1492 KB Output is correct
102 Correct 13 ms 852 KB Output is correct
103 Correct 82 ms 2236 KB Output is correct
104 Correct 188 ms 3924 KB Output is correct
105 Correct 1966 ms 33236 KB Output is correct
106 Correct 56 ms 1876 KB Output is correct
107 Correct 161 ms 2112 KB Output is correct
108 Correct 399 ms 4180 KB Output is correct
109 Correct 300 ms 3796 KB Output is correct
110 Execution timed out 5045 ms 45012 KB Time limit exceeded
111 Halted 0 ms 0 KB -