답안 #655147

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
655147 2022-11-03T10:19:18 Z prvocislo Uplifting Excursion (BOI22_vault) C++17
100 / 100
1693 ms 3308 KB
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <deque>
#include <random>
#include <set>
#include <string>
#include <vector>
typedef long long ll;
typedef long double ld;
using namespace std;

const int maxn = 305;
const ll inf = 1e18 + 5, z = 2 * maxn * maxn;
int m;
ll l;
vector<ll> a(maxn * 2 + 5);
vector<ll> g(maxn * 2 + 5); // volba pazraveho riesenia
ll cnt = 0;
vector<ll> dp(z * 2 + 5, -inf); // dp[layer][zero + sucet oproti povodnemu greedy]
void upd(ll& a, ll b)
{
    a = max(a, b);
}
void apply(ll siz, ll cost)
{
    if (siz > 0)
    {
        for (ll j = z - siz; j >= -z; j--) if (dp[z + j] != -inf) upd(dp[z + j + siz], dp[z + j] + cost);
    }
    else
    {
        for (ll j = -z - siz; j <= z; j++) if (dp[z + j] != -inf) upd(dp[z + j + siz], dp[z + j] + cost);
    }
}
ll divup(ll a, ll b)
{
    return (a + b - 1) / b;
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> m >> l;
    ll sum = 0;
    for (ll i = -m; i <= m; i++) cin >> a[m + i], sum += a[m + i] * i;
    if (sum > l)
    {
        l *= -1ll;
        reverse(a.begin(), a.begin() + 2 * m + 1);
    }
    // sum < l -> v greedy rieseni zoberieme vsetky kladne a nejaky prefix zapornych
    sum = 0;
    for (ll i = 0; i <= m; i++) g[m + i] = a[m + i], sum += a[m + i] * i, cnt += a[m + i];
    if (sum < l)
    {
        cout << "impossible\n";
        return 0;
    }
    for (ll i = -1; i >= -m; i--)
    {
        if (l <= sum + a[m + i] * i) g[m + i] = a[m + i], sum += a[m + i] * i, cnt += a[m + i];
        else
        {
            ll k = divup(sum - l, -i);
            g[m + i] = k, sum += k * i, cnt += k;
            break;
        }
    }
    int ly = 0;
    dp[z] = cnt;
    for (ll i = -m; i <= m; i++)
    {
        vector<ll> jump;
        ll neg = min(g[m + i], 2ll * m);
        if (neg > 0)
        {
            for (ll j = 1; j <= neg; j <<= 1ll) if (j - 1 <= neg) jump.push_back(j), neg -= j;
            jump.push_back(neg);
            for (ll j : jump) apply(j * -i, -j);
        }
        ll pos = min(a[m + i] - g[m + i], 2ll * m);
        if (pos > 0)
        {
            for (ll j = 1; j <= pos; j <<= 1ll) if (j - 1 <= pos) jump.push_back(j), pos -= j;
            jump.push_back(pos);
            for (ll j : jump) apply(j * i, j);
        }
    }
    ll d = l - sum;
    if (d > (ll)z || dp[z + d] == -inf) cout << "impossible\n";
    else cout << dp[z + d] << "\n";
    return 0;
}

Compilation message

vault.cpp: In function 'int main()':
vault.cpp:77:9: warning: unused variable 'ly' [-Wunused-variable]
   77 |     int ly = 0;
      |         ^~
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 3176 KB Output is correct
2 Correct 4 ms 3156 KB Output is correct
3 Correct 4 ms 3172 KB Output is correct
4 Correct 16 ms 3156 KB Output is correct
5 Correct 2 ms 3156 KB Output is correct
6 Correct 162 ms 3156 KB Output is correct
7 Correct 55 ms 3156 KB Output is correct
8 Correct 147 ms 3156 KB Output is correct
9 Correct 171 ms 3156 KB Output is correct
10 Correct 9 ms 3156 KB Output is correct
11 Correct 15 ms 3156 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 3176 KB Output is correct
2 Correct 4 ms 3156 KB Output is correct
3 Correct 4 ms 3172 KB Output is correct
4 Correct 16 ms 3156 KB Output is correct
5 Correct 2 ms 3156 KB Output is correct
6 Correct 162 ms 3156 KB Output is correct
7 Correct 55 ms 3156 KB Output is correct
8 Correct 147 ms 3156 KB Output is correct
9 Correct 171 ms 3156 KB Output is correct
10 Correct 9 ms 3156 KB Output is correct
11 Correct 15 ms 3156 KB Output is correct
12 Correct 6 ms 3156 KB Output is correct
13 Correct 4 ms 3156 KB Output is correct
14 Correct 3 ms 3156 KB Output is correct
15 Correct 11 ms 3156 KB Output is correct
16 Correct 2 ms 3156 KB Output is correct
17 Correct 163 ms 3156 KB Output is correct
18 Correct 57 ms 3156 KB Output is correct
19 Correct 154 ms 3156 KB Output is correct
20 Correct 185 ms 3156 KB Output is correct
21 Correct 9 ms 3156 KB Output is correct
22 Correct 11 ms 3156 KB Output is correct
23 Correct 2 ms 3308 KB Output is correct
24 Correct 404 ms 3156 KB Output is correct
25 Correct 164 ms 3156 KB Output is correct
26 Correct 490 ms 3156 KB Output is correct
27 Correct 453 ms 3156 KB Output is correct
28 Correct 10 ms 3156 KB Output is correct
29 Correct 14 ms 3156 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 3156 KB Output is correct
2 Correct 65 ms 3156 KB Output is correct
3 Correct 18 ms 3156 KB Output is correct
4 Correct 57 ms 3156 KB Output is correct
5 Correct 62 ms 3156 KB Output is correct
6 Correct 41 ms 3156 KB Output is correct
7 Correct 9 ms 3156 KB Output is correct
8 Correct 11 ms 3156 KB Output is correct
9 Correct 30 ms 3156 KB Output is correct
10 Correct 42 ms 3156 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 3156 KB Output is correct
2 Correct 65 ms 3156 KB Output is correct
3 Correct 18 ms 3156 KB Output is correct
4 Correct 57 ms 3156 KB Output is correct
5 Correct 62 ms 3156 KB Output is correct
6 Correct 41 ms 3156 KB Output is correct
7 Correct 9 ms 3156 KB Output is correct
8 Correct 11 ms 3156 KB Output is correct
9 Correct 30 ms 3156 KB Output is correct
10 Correct 42 ms 3156 KB Output is correct
11 Correct 7 ms 3160 KB Output is correct
12 Correct 5 ms 3156 KB Output is correct
13 Correct 3 ms 3156 KB Output is correct
14 Correct 12 ms 3156 KB Output is correct
15 Correct 58 ms 3156 KB Output is correct
16 Correct 17 ms 3156 KB Output is correct
17 Correct 54 ms 3156 KB Output is correct
18 Correct 74 ms 3156 KB Output is correct
19 Correct 41 ms 3156 KB Output is correct
20 Correct 9 ms 3156 KB Output is correct
21 Correct 11 ms 3156 KB Output is correct
22 Correct 30 ms 3156 KB Output is correct
23 Correct 45 ms 3156 KB Output is correct
24 Correct 101 ms 3156 KB Output is correct
25 Correct 44 ms 3156 KB Output is correct
26 Correct 92 ms 3156 KB Output is correct
27 Correct 93 ms 3156 KB Output is correct
28 Correct 81 ms 3156 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 3156 KB Output is correct
2 Correct 65 ms 3156 KB Output is correct
3 Correct 18 ms 3156 KB Output is correct
4 Correct 57 ms 3156 KB Output is correct
5 Correct 62 ms 3156 KB Output is correct
6 Correct 41 ms 3156 KB Output is correct
7 Correct 9 ms 3156 KB Output is correct
8 Correct 11 ms 3156 KB Output is correct
9 Correct 30 ms 3156 KB Output is correct
10 Correct 42 ms 3156 KB Output is correct
11 Correct 12 ms 3156 KB Output is correct
12 Correct 70 ms 3156 KB Output is correct
13 Correct 17 ms 3156 KB Output is correct
14 Correct 54 ms 3156 KB Output is correct
15 Correct 65 ms 3156 KB Output is correct
16 Correct 42 ms 3156 KB Output is correct
17 Correct 9 ms 3156 KB Output is correct
18 Correct 11 ms 3156 KB Output is correct
19 Correct 30 ms 3156 KB Output is correct
20 Correct 41 ms 3156 KB Output is correct
21 Correct 9 ms 3156 KB Output is correct
22 Correct 10 ms 3156 KB Output is correct
23 Correct 145 ms 3156 KB Output is correct
24 Correct 48 ms 3156 KB Output is correct
25 Correct 102 ms 3156 KB Output is correct
26 Correct 115 ms 3156 KB Output is correct
27 Correct 82 ms 3156 KB Output is correct
28 Correct 90 ms 3156 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 3176 KB Output is correct
2 Correct 4 ms 3156 KB Output is correct
3 Correct 4 ms 3172 KB Output is correct
4 Correct 16 ms 3156 KB Output is correct
5 Correct 2 ms 3156 KB Output is correct
6 Correct 162 ms 3156 KB Output is correct
7 Correct 55 ms 3156 KB Output is correct
8 Correct 147 ms 3156 KB Output is correct
9 Correct 171 ms 3156 KB Output is correct
10 Correct 9 ms 3156 KB Output is correct
11 Correct 15 ms 3156 KB Output is correct
12 Correct 11 ms 3156 KB Output is correct
13 Correct 65 ms 3156 KB Output is correct
14 Correct 18 ms 3156 KB Output is correct
15 Correct 57 ms 3156 KB Output is correct
16 Correct 62 ms 3156 KB Output is correct
17 Correct 41 ms 3156 KB Output is correct
18 Correct 9 ms 3156 KB Output is correct
19 Correct 11 ms 3156 KB Output is correct
20 Correct 30 ms 3156 KB Output is correct
21 Correct 42 ms 3156 KB Output is correct
22 Correct 7 ms 3160 KB Output is correct
23 Correct 5 ms 3156 KB Output is correct
24 Correct 3 ms 3156 KB Output is correct
25 Correct 12 ms 3156 KB Output is correct
26 Correct 58 ms 3156 KB Output is correct
27 Correct 17 ms 3156 KB Output is correct
28 Correct 54 ms 3156 KB Output is correct
29 Correct 74 ms 3156 KB Output is correct
30 Correct 41 ms 3156 KB Output is correct
31 Correct 9 ms 3156 KB Output is correct
32 Correct 11 ms 3156 KB Output is correct
33 Correct 30 ms 3156 KB Output is correct
34 Correct 45 ms 3156 KB Output is correct
35 Correct 101 ms 3156 KB Output is correct
36 Correct 44 ms 3156 KB Output is correct
37 Correct 92 ms 3156 KB Output is correct
38 Correct 93 ms 3156 KB Output is correct
39 Correct 81 ms 3156 KB Output is correct
40 Correct 12 ms 3156 KB Output is correct
41 Correct 70 ms 3156 KB Output is correct
42 Correct 17 ms 3156 KB Output is correct
43 Correct 54 ms 3156 KB Output is correct
44 Correct 65 ms 3156 KB Output is correct
45 Correct 42 ms 3156 KB Output is correct
46 Correct 9 ms 3156 KB Output is correct
47 Correct 11 ms 3156 KB Output is correct
48 Correct 30 ms 3156 KB Output is correct
49 Correct 41 ms 3156 KB Output is correct
50 Correct 9 ms 3156 KB Output is correct
51 Correct 10 ms 3156 KB Output is correct
52 Correct 145 ms 3156 KB Output is correct
53 Correct 48 ms 3156 KB Output is correct
54 Correct 102 ms 3156 KB Output is correct
55 Correct 115 ms 3156 KB Output is correct
56 Correct 82 ms 3156 KB Output is correct
57 Correct 90 ms 3156 KB Output is correct
58 Correct 6 ms 3156 KB Output is correct
59 Correct 4 ms 3156 KB Output is correct
60 Correct 4 ms 3156 KB Output is correct
61 Correct 12 ms 3156 KB Output is correct
62 Correct 2 ms 3156 KB Output is correct
63 Correct 159 ms 3244 KB Output is correct
64 Correct 72 ms 3156 KB Output is correct
65 Correct 162 ms 3156 KB Output is correct
66 Correct 170 ms 3156 KB Output is correct
67 Correct 8 ms 3156 KB Output is correct
68 Correct 11 ms 3156 KB Output is correct
69 Correct 65 ms 3156 KB Output is correct
70 Correct 18 ms 3156 KB Output is correct
71 Correct 57 ms 3156 KB Output is correct
72 Correct 63 ms 3156 KB Output is correct
73 Correct 40 ms 3156 KB Output is correct
74 Correct 9 ms 3156 KB Output is correct
75 Correct 13 ms 3188 KB Output is correct
76 Correct 43 ms 3156 KB Output is correct
77 Correct 42 ms 3156 KB Output is correct
78 Correct 92 ms 3156 KB Output is correct
79 Correct 32 ms 3156 KB Output is correct
80 Correct 89 ms 3156 KB Output is correct
81 Correct 90 ms 3156 KB Output is correct
82 Correct 87 ms 3156 KB Output is correct
83 Correct 109 ms 3156 KB Output is correct
84 Correct 48 ms 3156 KB Output is correct
85 Correct 105 ms 3156 KB Output is correct
86 Correct 129 ms 3256 KB Output is correct
87 Correct 83 ms 3156 KB Output is correct
88 Correct 91 ms 3156 KB Output is correct
89 Correct 183 ms 3252 KB Output is correct
90 Correct 212 ms 3284 KB Output is correct
91 Correct 165 ms 3156 KB Output is correct
92 Correct 161 ms 3256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 3156 KB Output is correct
2 Correct 65 ms 3156 KB Output is correct
3 Correct 18 ms 3156 KB Output is correct
4 Correct 57 ms 3156 KB Output is correct
5 Correct 62 ms 3156 KB Output is correct
6 Correct 41 ms 3156 KB Output is correct
7 Correct 9 ms 3156 KB Output is correct
8 Correct 11 ms 3156 KB Output is correct
9 Correct 30 ms 3156 KB Output is correct
10 Correct 42 ms 3156 KB Output is correct
11 Correct 12 ms 3156 KB Output is correct
12 Correct 70 ms 3156 KB Output is correct
13 Correct 17 ms 3156 KB Output is correct
14 Correct 54 ms 3156 KB Output is correct
15 Correct 65 ms 3156 KB Output is correct
16 Correct 42 ms 3156 KB Output is correct
17 Correct 9 ms 3156 KB Output is correct
18 Correct 11 ms 3156 KB Output is correct
19 Correct 30 ms 3156 KB Output is correct
20 Correct 41 ms 3156 KB Output is correct
21 Correct 9 ms 3156 KB Output is correct
22 Correct 10 ms 3156 KB Output is correct
23 Correct 145 ms 3156 KB Output is correct
24 Correct 48 ms 3156 KB Output is correct
25 Correct 102 ms 3156 KB Output is correct
26 Correct 115 ms 3156 KB Output is correct
27 Correct 82 ms 3156 KB Output is correct
28 Correct 90 ms 3156 KB Output is correct
29 Correct 11 ms 3156 KB Output is correct
30 Correct 58 ms 3156 KB Output is correct
31 Correct 27 ms 3156 KB Output is correct
32 Correct 54 ms 3156 KB Output is correct
33 Correct 63 ms 3156 KB Output is correct
34 Correct 42 ms 3156 KB Output is correct
35 Correct 9 ms 3156 KB Output is correct
36 Correct 14 ms 3236 KB Output is correct
37 Correct 36 ms 3156 KB Output is correct
38 Correct 44 ms 3156 KB Output is correct
39 Correct 9 ms 3156 KB Output is correct
40 Correct 10 ms 3156 KB Output is correct
41 Correct 108 ms 3156 KB Output is correct
42 Correct 48 ms 3156 KB Output is correct
43 Correct 103 ms 3156 KB Output is correct
44 Correct 121 ms 3156 KB Output is correct
45 Correct 88 ms 3156 KB Output is correct
46 Correct 90 ms 3156 KB Output is correct
47 Correct 10 ms 3156 KB Output is correct
48 Correct 13 ms 3156 KB Output is correct
49 Correct 265 ms 3156 KB Output is correct
50 Correct 112 ms 3156 KB Output is correct
51 Correct 234 ms 3156 KB Output is correct
52 Correct 258 ms 3156 KB Output is correct
53 Correct 187 ms 3156 KB Output is correct
54 Correct 207 ms 3284 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 3176 KB Output is correct
2 Correct 4 ms 3156 KB Output is correct
3 Correct 4 ms 3172 KB Output is correct
4 Correct 16 ms 3156 KB Output is correct
5 Correct 2 ms 3156 KB Output is correct
6 Correct 162 ms 3156 KB Output is correct
7 Correct 55 ms 3156 KB Output is correct
8 Correct 147 ms 3156 KB Output is correct
9 Correct 171 ms 3156 KB Output is correct
10 Correct 9 ms 3156 KB Output is correct
11 Correct 15 ms 3156 KB Output is correct
12 Correct 6 ms 3156 KB Output is correct
13 Correct 4 ms 3156 KB Output is correct
14 Correct 3 ms 3156 KB Output is correct
15 Correct 11 ms 3156 KB Output is correct
16 Correct 2 ms 3156 KB Output is correct
17 Correct 163 ms 3156 KB Output is correct
18 Correct 57 ms 3156 KB Output is correct
19 Correct 154 ms 3156 KB Output is correct
20 Correct 185 ms 3156 KB Output is correct
21 Correct 9 ms 3156 KB Output is correct
22 Correct 11 ms 3156 KB Output is correct
23 Correct 2 ms 3308 KB Output is correct
24 Correct 404 ms 3156 KB Output is correct
25 Correct 164 ms 3156 KB Output is correct
26 Correct 490 ms 3156 KB Output is correct
27 Correct 453 ms 3156 KB Output is correct
28 Correct 10 ms 3156 KB Output is correct
29 Correct 14 ms 3156 KB Output is correct
30 Correct 11 ms 3156 KB Output is correct
31 Correct 65 ms 3156 KB Output is correct
32 Correct 18 ms 3156 KB Output is correct
33 Correct 57 ms 3156 KB Output is correct
34 Correct 62 ms 3156 KB Output is correct
35 Correct 41 ms 3156 KB Output is correct
36 Correct 9 ms 3156 KB Output is correct
37 Correct 11 ms 3156 KB Output is correct
38 Correct 30 ms 3156 KB Output is correct
39 Correct 42 ms 3156 KB Output is correct
40 Correct 7 ms 3160 KB Output is correct
41 Correct 5 ms 3156 KB Output is correct
42 Correct 3 ms 3156 KB Output is correct
43 Correct 12 ms 3156 KB Output is correct
44 Correct 58 ms 3156 KB Output is correct
45 Correct 17 ms 3156 KB Output is correct
46 Correct 54 ms 3156 KB Output is correct
47 Correct 74 ms 3156 KB Output is correct
48 Correct 41 ms 3156 KB Output is correct
49 Correct 9 ms 3156 KB Output is correct
50 Correct 11 ms 3156 KB Output is correct
51 Correct 30 ms 3156 KB Output is correct
52 Correct 45 ms 3156 KB Output is correct
53 Correct 101 ms 3156 KB Output is correct
54 Correct 44 ms 3156 KB Output is correct
55 Correct 92 ms 3156 KB Output is correct
56 Correct 93 ms 3156 KB Output is correct
57 Correct 81 ms 3156 KB Output is correct
58 Correct 12 ms 3156 KB Output is correct
59 Correct 70 ms 3156 KB Output is correct
60 Correct 17 ms 3156 KB Output is correct
61 Correct 54 ms 3156 KB Output is correct
62 Correct 65 ms 3156 KB Output is correct
63 Correct 42 ms 3156 KB Output is correct
64 Correct 9 ms 3156 KB Output is correct
65 Correct 11 ms 3156 KB Output is correct
66 Correct 30 ms 3156 KB Output is correct
67 Correct 41 ms 3156 KB Output is correct
68 Correct 9 ms 3156 KB Output is correct
69 Correct 10 ms 3156 KB Output is correct
70 Correct 145 ms 3156 KB Output is correct
71 Correct 48 ms 3156 KB Output is correct
72 Correct 102 ms 3156 KB Output is correct
73 Correct 115 ms 3156 KB Output is correct
74 Correct 82 ms 3156 KB Output is correct
75 Correct 90 ms 3156 KB Output is correct
76 Correct 6 ms 3156 KB Output is correct
77 Correct 4 ms 3156 KB Output is correct
78 Correct 4 ms 3156 KB Output is correct
79 Correct 12 ms 3156 KB Output is correct
80 Correct 2 ms 3156 KB Output is correct
81 Correct 159 ms 3244 KB Output is correct
82 Correct 72 ms 3156 KB Output is correct
83 Correct 162 ms 3156 KB Output is correct
84 Correct 170 ms 3156 KB Output is correct
85 Correct 8 ms 3156 KB Output is correct
86 Correct 11 ms 3156 KB Output is correct
87 Correct 65 ms 3156 KB Output is correct
88 Correct 18 ms 3156 KB Output is correct
89 Correct 57 ms 3156 KB Output is correct
90 Correct 63 ms 3156 KB Output is correct
91 Correct 40 ms 3156 KB Output is correct
92 Correct 9 ms 3156 KB Output is correct
93 Correct 13 ms 3188 KB Output is correct
94 Correct 43 ms 3156 KB Output is correct
95 Correct 42 ms 3156 KB Output is correct
96 Correct 92 ms 3156 KB Output is correct
97 Correct 32 ms 3156 KB Output is correct
98 Correct 89 ms 3156 KB Output is correct
99 Correct 90 ms 3156 KB Output is correct
100 Correct 87 ms 3156 KB Output is correct
101 Correct 109 ms 3156 KB Output is correct
102 Correct 48 ms 3156 KB Output is correct
103 Correct 105 ms 3156 KB Output is correct
104 Correct 129 ms 3256 KB Output is correct
105 Correct 83 ms 3156 KB Output is correct
106 Correct 91 ms 3156 KB Output is correct
107 Correct 183 ms 3252 KB Output is correct
108 Correct 212 ms 3284 KB Output is correct
109 Correct 165 ms 3156 KB Output is correct
110 Correct 161 ms 3256 KB Output is correct
111 Correct 11 ms 3156 KB Output is correct
112 Correct 58 ms 3156 KB Output is correct
113 Correct 27 ms 3156 KB Output is correct
114 Correct 54 ms 3156 KB Output is correct
115 Correct 63 ms 3156 KB Output is correct
116 Correct 42 ms 3156 KB Output is correct
117 Correct 9 ms 3156 KB Output is correct
118 Correct 14 ms 3236 KB Output is correct
119 Correct 36 ms 3156 KB Output is correct
120 Correct 44 ms 3156 KB Output is correct
121 Correct 9 ms 3156 KB Output is correct
122 Correct 10 ms 3156 KB Output is correct
123 Correct 108 ms 3156 KB Output is correct
124 Correct 48 ms 3156 KB Output is correct
125 Correct 103 ms 3156 KB Output is correct
126 Correct 121 ms 3156 KB Output is correct
127 Correct 88 ms 3156 KB Output is correct
128 Correct 90 ms 3156 KB Output is correct
129 Correct 10 ms 3156 KB Output is correct
130 Correct 13 ms 3156 KB Output is correct
131 Correct 265 ms 3156 KB Output is correct
132 Correct 112 ms 3156 KB Output is correct
133 Correct 234 ms 3156 KB Output is correct
134 Correct 258 ms 3156 KB Output is correct
135 Correct 187 ms 3156 KB Output is correct
136 Correct 207 ms 3284 KB Output is correct
137 Correct 6 ms 3156 KB Output is correct
138 Correct 4 ms 3156 KB Output is correct
139 Correct 4 ms 3156 KB Output is correct
140 Correct 11 ms 3156 KB Output is correct
141 Correct 2 ms 3156 KB Output is correct
142 Correct 172 ms 3156 KB Output is correct
143 Correct 55 ms 3156 KB Output is correct
144 Correct 148 ms 3156 KB Output is correct
145 Correct 175 ms 3156 KB Output is correct
146 Correct 11 ms 3156 KB Output is correct
147 Correct 16 ms 3156 KB Output is correct
148 Correct 2 ms 3256 KB Output is correct
149 Correct 413 ms 3156 KB Output is correct
150 Correct 130 ms 3156 KB Output is correct
151 Correct 473 ms 3260 KB Output is correct
152 Correct 450 ms 3252 KB Output is correct
153 Correct 10 ms 3156 KB Output is correct
154 Correct 16 ms 3156 KB Output is correct
155 Correct 57 ms 3156 KB Output is correct
156 Correct 18 ms 3156 KB Output is correct
157 Correct 53 ms 3156 KB Output is correct
158 Correct 65 ms 3156 KB Output is correct
159 Correct 42 ms 3156 KB Output is correct
160 Correct 9 ms 3156 KB Output is correct
161 Correct 12 ms 3156 KB Output is correct
162 Correct 33 ms 3156 KB Output is correct
163 Correct 42 ms 3156 KB Output is correct
164 Correct 108 ms 3156 KB Output is correct
165 Correct 63 ms 3156 KB Output is correct
166 Correct 113 ms 3156 KB Output is correct
167 Correct 108 ms 3156 KB Output is correct
168 Correct 85 ms 3156 KB Output is correct
169 Correct 84 ms 3156 KB Output is correct
170 Correct 118 ms 3252 KB Output is correct
171 Correct 32 ms 3156 KB Output is correct
172 Correct 88 ms 3156 KB Output is correct
173 Correct 98 ms 3156 KB Output is correct
174 Correct 86 ms 3156 KB Output is correct
175 Correct 180 ms 3156 KB Output is correct
176 Correct 206 ms 3156 KB Output is correct
177 Correct 166 ms 3156 KB Output is correct
178 Correct 158 ms 3156 KB Output is correct
179 Correct 241 ms 3156 KB Output is correct
180 Correct 109 ms 3264 KB Output is correct
181 Correct 270 ms 3156 KB Output is correct
182 Correct 269 ms 3156 KB Output is correct
183 Correct 212 ms 3156 KB Output is correct
184 Correct 211 ms 3156 KB Output is correct
185 Correct 486 ms 3156 KB Output is correct
186 Correct 535 ms 3148 KB Output is correct
187 Correct 406 ms 3156 KB Output is correct
188 Correct 459 ms 3156 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 3156 KB Output is correct
2 Correct 65 ms 3156 KB Output is correct
3 Correct 18 ms 3156 KB Output is correct
4 Correct 57 ms 3156 KB Output is correct
5 Correct 62 ms 3156 KB Output is correct
6 Correct 41 ms 3156 KB Output is correct
7 Correct 9 ms 3156 KB Output is correct
8 Correct 11 ms 3156 KB Output is correct
9 Correct 30 ms 3156 KB Output is correct
10 Correct 42 ms 3156 KB Output is correct
11 Correct 12 ms 3156 KB Output is correct
12 Correct 70 ms 3156 KB Output is correct
13 Correct 17 ms 3156 KB Output is correct
14 Correct 54 ms 3156 KB Output is correct
15 Correct 65 ms 3156 KB Output is correct
16 Correct 42 ms 3156 KB Output is correct
17 Correct 9 ms 3156 KB Output is correct
18 Correct 11 ms 3156 KB Output is correct
19 Correct 30 ms 3156 KB Output is correct
20 Correct 41 ms 3156 KB Output is correct
21 Correct 9 ms 3156 KB Output is correct
22 Correct 10 ms 3156 KB Output is correct
23 Correct 145 ms 3156 KB Output is correct
24 Correct 48 ms 3156 KB Output is correct
25 Correct 102 ms 3156 KB Output is correct
26 Correct 115 ms 3156 KB Output is correct
27 Correct 82 ms 3156 KB Output is correct
28 Correct 90 ms 3156 KB Output is correct
29 Correct 11 ms 3156 KB Output is correct
30 Correct 58 ms 3156 KB Output is correct
31 Correct 27 ms 3156 KB Output is correct
32 Correct 54 ms 3156 KB Output is correct
33 Correct 63 ms 3156 KB Output is correct
34 Correct 42 ms 3156 KB Output is correct
35 Correct 9 ms 3156 KB Output is correct
36 Correct 14 ms 3236 KB Output is correct
37 Correct 36 ms 3156 KB Output is correct
38 Correct 44 ms 3156 KB Output is correct
39 Correct 9 ms 3156 KB Output is correct
40 Correct 10 ms 3156 KB Output is correct
41 Correct 108 ms 3156 KB Output is correct
42 Correct 48 ms 3156 KB Output is correct
43 Correct 103 ms 3156 KB Output is correct
44 Correct 121 ms 3156 KB Output is correct
45 Correct 88 ms 3156 KB Output is correct
46 Correct 90 ms 3156 KB Output is correct
47 Correct 10 ms 3156 KB Output is correct
48 Correct 13 ms 3156 KB Output is correct
49 Correct 265 ms 3156 KB Output is correct
50 Correct 112 ms 3156 KB Output is correct
51 Correct 234 ms 3156 KB Output is correct
52 Correct 258 ms 3156 KB Output is correct
53 Correct 187 ms 3156 KB Output is correct
54 Correct 207 ms 3284 KB Output is correct
55 Correct 11 ms 3156 KB Output is correct
56 Correct 58 ms 3156 KB Output is correct
57 Correct 18 ms 3156 KB Output is correct
58 Correct 61 ms 3156 KB Output is correct
59 Correct 82 ms 3156 KB Output is correct
60 Correct 43 ms 3160 KB Output is correct
61 Correct 9 ms 3200 KB Output is correct
62 Correct 11 ms 3156 KB Output is correct
63 Correct 39 ms 3156 KB Output is correct
64 Correct 43 ms 3156 KB Output is correct
65 Correct 14 ms 3156 KB Output is correct
66 Correct 10 ms 3156 KB Output is correct
67 Correct 108 ms 3156 KB Output is correct
68 Correct 48 ms 3156 KB Output is correct
69 Correct 109 ms 3156 KB Output is correct
70 Correct 108 ms 3156 KB Output is correct
71 Correct 86 ms 3156 KB Output is correct
72 Correct 85 ms 3156 KB Output is correct
73 Correct 10 ms 3156 KB Output is correct
74 Correct 13 ms 3156 KB Output is correct
75 Correct 237 ms 3156 KB Output is correct
76 Correct 100 ms 3208 KB Output is correct
77 Correct 239 ms 3156 KB Output is correct
78 Correct 248 ms 3156 KB Output is correct
79 Correct 210 ms 3156 KB Output is correct
80 Correct 202 ms 3156 KB Output is correct
81 Correct 921 ms 3156 KB Output is correct
82 Correct 472 ms 3156 KB Output is correct
83 Correct 915 ms 3156 KB Output is correct
84 Correct 934 ms 3236 KB Output is correct
85 Correct 17 ms 3156 KB Output is correct
86 Correct 16 ms 3156 KB Output is correct
87 Correct 835 ms 3256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 3176 KB Output is correct
2 Correct 4 ms 3156 KB Output is correct
3 Correct 4 ms 3172 KB Output is correct
4 Correct 16 ms 3156 KB Output is correct
5 Correct 2 ms 3156 KB Output is correct
6 Correct 162 ms 3156 KB Output is correct
7 Correct 55 ms 3156 KB Output is correct
8 Correct 147 ms 3156 KB Output is correct
9 Correct 171 ms 3156 KB Output is correct
10 Correct 9 ms 3156 KB Output is correct
11 Correct 15 ms 3156 KB Output is correct
12 Correct 6 ms 3156 KB Output is correct
13 Correct 4 ms 3156 KB Output is correct
14 Correct 3 ms 3156 KB Output is correct
15 Correct 11 ms 3156 KB Output is correct
16 Correct 2 ms 3156 KB Output is correct
17 Correct 163 ms 3156 KB Output is correct
18 Correct 57 ms 3156 KB Output is correct
19 Correct 154 ms 3156 KB Output is correct
20 Correct 185 ms 3156 KB Output is correct
21 Correct 9 ms 3156 KB Output is correct
22 Correct 11 ms 3156 KB Output is correct
23 Correct 2 ms 3308 KB Output is correct
24 Correct 404 ms 3156 KB Output is correct
25 Correct 164 ms 3156 KB Output is correct
26 Correct 490 ms 3156 KB Output is correct
27 Correct 453 ms 3156 KB Output is correct
28 Correct 10 ms 3156 KB Output is correct
29 Correct 14 ms 3156 KB Output is correct
30 Correct 11 ms 3156 KB Output is correct
31 Correct 65 ms 3156 KB Output is correct
32 Correct 18 ms 3156 KB Output is correct
33 Correct 57 ms 3156 KB Output is correct
34 Correct 62 ms 3156 KB Output is correct
35 Correct 41 ms 3156 KB Output is correct
36 Correct 9 ms 3156 KB Output is correct
37 Correct 11 ms 3156 KB Output is correct
38 Correct 30 ms 3156 KB Output is correct
39 Correct 42 ms 3156 KB Output is correct
40 Correct 7 ms 3160 KB Output is correct
41 Correct 5 ms 3156 KB Output is correct
42 Correct 3 ms 3156 KB Output is correct
43 Correct 12 ms 3156 KB Output is correct
44 Correct 58 ms 3156 KB Output is correct
45 Correct 17 ms 3156 KB Output is correct
46 Correct 54 ms 3156 KB Output is correct
47 Correct 74 ms 3156 KB Output is correct
48 Correct 41 ms 3156 KB Output is correct
49 Correct 9 ms 3156 KB Output is correct
50 Correct 11 ms 3156 KB Output is correct
51 Correct 30 ms 3156 KB Output is correct
52 Correct 45 ms 3156 KB Output is correct
53 Correct 101 ms 3156 KB Output is correct
54 Correct 44 ms 3156 KB Output is correct
55 Correct 92 ms 3156 KB Output is correct
56 Correct 93 ms 3156 KB Output is correct
57 Correct 81 ms 3156 KB Output is correct
58 Correct 12 ms 3156 KB Output is correct
59 Correct 70 ms 3156 KB Output is correct
60 Correct 17 ms 3156 KB Output is correct
61 Correct 54 ms 3156 KB Output is correct
62 Correct 65 ms 3156 KB Output is correct
63 Correct 42 ms 3156 KB Output is correct
64 Correct 9 ms 3156 KB Output is correct
65 Correct 11 ms 3156 KB Output is correct
66 Correct 30 ms 3156 KB Output is correct
67 Correct 41 ms 3156 KB Output is correct
68 Correct 9 ms 3156 KB Output is correct
69 Correct 10 ms 3156 KB Output is correct
70 Correct 145 ms 3156 KB Output is correct
71 Correct 48 ms 3156 KB Output is correct
72 Correct 102 ms 3156 KB Output is correct
73 Correct 115 ms 3156 KB Output is correct
74 Correct 82 ms 3156 KB Output is correct
75 Correct 90 ms 3156 KB Output is correct
76 Correct 6 ms 3156 KB Output is correct
77 Correct 4 ms 3156 KB Output is correct
78 Correct 4 ms 3156 KB Output is correct
79 Correct 12 ms 3156 KB Output is correct
80 Correct 2 ms 3156 KB Output is correct
81 Correct 159 ms 3244 KB Output is correct
82 Correct 72 ms 3156 KB Output is correct
83 Correct 162 ms 3156 KB Output is correct
84 Correct 170 ms 3156 KB Output is correct
85 Correct 8 ms 3156 KB Output is correct
86 Correct 11 ms 3156 KB Output is correct
87 Correct 65 ms 3156 KB Output is correct
88 Correct 18 ms 3156 KB Output is correct
89 Correct 57 ms 3156 KB Output is correct
90 Correct 63 ms 3156 KB Output is correct
91 Correct 40 ms 3156 KB Output is correct
92 Correct 9 ms 3156 KB Output is correct
93 Correct 13 ms 3188 KB Output is correct
94 Correct 43 ms 3156 KB Output is correct
95 Correct 42 ms 3156 KB Output is correct
96 Correct 92 ms 3156 KB Output is correct
97 Correct 32 ms 3156 KB Output is correct
98 Correct 89 ms 3156 KB Output is correct
99 Correct 90 ms 3156 KB Output is correct
100 Correct 87 ms 3156 KB Output is correct
101 Correct 109 ms 3156 KB Output is correct
102 Correct 48 ms 3156 KB Output is correct
103 Correct 105 ms 3156 KB Output is correct
104 Correct 129 ms 3256 KB Output is correct
105 Correct 83 ms 3156 KB Output is correct
106 Correct 91 ms 3156 KB Output is correct
107 Correct 183 ms 3252 KB Output is correct
108 Correct 212 ms 3284 KB Output is correct
109 Correct 165 ms 3156 KB Output is correct
110 Correct 161 ms 3256 KB Output is correct
111 Correct 11 ms 3156 KB Output is correct
112 Correct 58 ms 3156 KB Output is correct
113 Correct 27 ms 3156 KB Output is correct
114 Correct 54 ms 3156 KB Output is correct
115 Correct 63 ms 3156 KB Output is correct
116 Correct 42 ms 3156 KB Output is correct
117 Correct 9 ms 3156 KB Output is correct
118 Correct 14 ms 3236 KB Output is correct
119 Correct 36 ms 3156 KB Output is correct
120 Correct 44 ms 3156 KB Output is correct
121 Correct 9 ms 3156 KB Output is correct
122 Correct 10 ms 3156 KB Output is correct
123 Correct 108 ms 3156 KB Output is correct
124 Correct 48 ms 3156 KB Output is correct
125 Correct 103 ms 3156 KB Output is correct
126 Correct 121 ms 3156 KB Output is correct
127 Correct 88 ms 3156 KB Output is correct
128 Correct 90 ms 3156 KB Output is correct
129 Correct 10 ms 3156 KB Output is correct
130 Correct 13 ms 3156 KB Output is correct
131 Correct 265 ms 3156 KB Output is correct
132 Correct 112 ms 3156 KB Output is correct
133 Correct 234 ms 3156 KB Output is correct
134 Correct 258 ms 3156 KB Output is correct
135 Correct 187 ms 3156 KB Output is correct
136 Correct 207 ms 3284 KB Output is correct
137 Correct 6 ms 3156 KB Output is correct
138 Correct 4 ms 3156 KB Output is correct
139 Correct 4 ms 3156 KB Output is correct
140 Correct 11 ms 3156 KB Output is correct
141 Correct 2 ms 3156 KB Output is correct
142 Correct 172 ms 3156 KB Output is correct
143 Correct 55 ms 3156 KB Output is correct
144 Correct 148 ms 3156 KB Output is correct
145 Correct 175 ms 3156 KB Output is correct
146 Correct 11 ms 3156 KB Output is correct
147 Correct 16 ms 3156 KB Output is correct
148 Correct 2 ms 3256 KB Output is correct
149 Correct 413 ms 3156 KB Output is correct
150 Correct 130 ms 3156 KB Output is correct
151 Correct 473 ms 3260 KB Output is correct
152 Correct 450 ms 3252 KB Output is correct
153 Correct 10 ms 3156 KB Output is correct
154 Correct 16 ms 3156 KB Output is correct
155 Correct 57 ms 3156 KB Output is correct
156 Correct 18 ms 3156 KB Output is correct
157 Correct 53 ms 3156 KB Output is correct
158 Correct 65 ms 3156 KB Output is correct
159 Correct 42 ms 3156 KB Output is correct
160 Correct 9 ms 3156 KB Output is correct
161 Correct 12 ms 3156 KB Output is correct
162 Correct 33 ms 3156 KB Output is correct
163 Correct 42 ms 3156 KB Output is correct
164 Correct 108 ms 3156 KB Output is correct
165 Correct 63 ms 3156 KB Output is correct
166 Correct 113 ms 3156 KB Output is correct
167 Correct 108 ms 3156 KB Output is correct
168 Correct 85 ms 3156 KB Output is correct
169 Correct 84 ms 3156 KB Output is correct
170 Correct 118 ms 3252 KB Output is correct
171 Correct 32 ms 3156 KB Output is correct
172 Correct 88 ms 3156 KB Output is correct
173 Correct 98 ms 3156 KB Output is correct
174 Correct 86 ms 3156 KB Output is correct
175 Correct 180 ms 3156 KB Output is correct
176 Correct 206 ms 3156 KB Output is correct
177 Correct 166 ms 3156 KB Output is correct
178 Correct 158 ms 3156 KB Output is correct
179 Correct 241 ms 3156 KB Output is correct
180 Correct 109 ms 3264 KB Output is correct
181 Correct 270 ms 3156 KB Output is correct
182 Correct 269 ms 3156 KB Output is correct
183 Correct 212 ms 3156 KB Output is correct
184 Correct 211 ms 3156 KB Output is correct
185 Correct 486 ms 3156 KB Output is correct
186 Correct 535 ms 3148 KB Output is correct
187 Correct 406 ms 3156 KB Output is correct
188 Correct 459 ms 3156 KB Output is correct
189 Correct 11 ms 3156 KB Output is correct
190 Correct 58 ms 3156 KB Output is correct
191 Correct 18 ms 3156 KB Output is correct
192 Correct 61 ms 3156 KB Output is correct
193 Correct 82 ms 3156 KB Output is correct
194 Correct 43 ms 3160 KB Output is correct
195 Correct 9 ms 3200 KB Output is correct
196 Correct 11 ms 3156 KB Output is correct
197 Correct 39 ms 3156 KB Output is correct
198 Correct 43 ms 3156 KB Output is correct
199 Correct 14 ms 3156 KB Output is correct
200 Correct 10 ms 3156 KB Output is correct
201 Correct 108 ms 3156 KB Output is correct
202 Correct 48 ms 3156 KB Output is correct
203 Correct 109 ms 3156 KB Output is correct
204 Correct 108 ms 3156 KB Output is correct
205 Correct 86 ms 3156 KB Output is correct
206 Correct 85 ms 3156 KB Output is correct
207 Correct 10 ms 3156 KB Output is correct
208 Correct 13 ms 3156 KB Output is correct
209 Correct 237 ms 3156 KB Output is correct
210 Correct 100 ms 3208 KB Output is correct
211 Correct 239 ms 3156 KB Output is correct
212 Correct 248 ms 3156 KB Output is correct
213 Correct 210 ms 3156 KB Output is correct
214 Correct 202 ms 3156 KB Output is correct
215 Correct 921 ms 3156 KB Output is correct
216 Correct 472 ms 3156 KB Output is correct
217 Correct 915 ms 3156 KB Output is correct
218 Correct 934 ms 3236 KB Output is correct
219 Correct 17 ms 3156 KB Output is correct
220 Correct 16 ms 3156 KB Output is correct
221 Correct 835 ms 3256 KB Output is correct
222 Correct 12 ms 3156 KB Output is correct
223 Correct 59 ms 3156 KB Output is correct
224 Correct 18 ms 3156 KB Output is correct
225 Correct 59 ms 3156 KB Output is correct
226 Correct 80 ms 3156 KB Output is correct
227 Correct 42 ms 3156 KB Output is correct
228 Correct 10 ms 3156 KB Output is correct
229 Correct 12 ms 3156 KB Output is correct
230 Correct 30 ms 3156 KB Output is correct
231 Correct 42 ms 3156 KB Output is correct
232 Correct 9 ms 3156 KB Output is correct
233 Correct 10 ms 3156 KB Output is correct
234 Correct 108 ms 3156 KB Output is correct
235 Correct 51 ms 3156 KB Output is correct
236 Correct 105 ms 3156 KB Output is correct
237 Correct 111 ms 3156 KB Output is correct
238 Correct 87 ms 3156 KB Output is correct
239 Correct 93 ms 3156 KB Output is correct
240 Correct 10 ms 3156 KB Output is correct
241 Correct 13 ms 3156 KB Output is correct
242 Correct 238 ms 3156 KB Output is correct
243 Correct 102 ms 3156 KB Output is correct
244 Correct 235 ms 3156 KB Output is correct
245 Correct 264 ms 3256 KB Output is correct
246 Correct 208 ms 3252 KB Output is correct
247 Correct 199 ms 3260 KB Output is correct
248 Correct 6 ms 3156 KB Output is correct
249 Correct 5 ms 3156 KB Output is correct
250 Correct 5 ms 3156 KB Output is correct
251 Correct 2 ms 3156 KB Output is correct
252 Correct 181 ms 3240 KB Output is correct
253 Correct 55 ms 3156 KB Output is correct
254 Correct 147 ms 3156 KB Output is correct
255 Correct 179 ms 3156 KB Output is correct
256 Correct 2 ms 3156 KB Output is correct
257 Correct 396 ms 3156 KB Output is correct
258 Correct 149 ms 3256 KB Output is correct
259 Correct 473 ms 3156 KB Output is correct
260 Correct 453 ms 3156 KB Output is correct
261 Correct 93 ms 3156 KB Output is correct
262 Correct 35 ms 3156 KB Output is correct
263 Correct 90 ms 3156 KB Output is correct
264 Correct 93 ms 3156 KB Output is correct
265 Correct 81 ms 3156 KB Output is correct
266 Correct 184 ms 3156 KB Output is correct
267 Correct 209 ms 3156 KB Output is correct
268 Correct 170 ms 3156 KB Output is correct
269 Correct 161 ms 3256 KB Output is correct
270 Correct 440 ms 3156 KB Output is correct
271 Correct 522 ms 3156 KB Output is correct
272 Correct 385 ms 3156 KB Output is correct
273 Correct 404 ms 3284 KB Output is correct
274 Correct 917 ms 3156 KB Output is correct
275 Correct 408 ms 3156 KB Output is correct
276 Correct 879 ms 3156 KB Output is correct
277 Correct 926 ms 3156 KB Output is correct
278 Correct 16 ms 3156 KB Output is correct
279 Correct 18 ms 3156 KB Output is correct
280 Correct 813 ms 3156 KB Output is correct
281 Correct 1693 ms 3156 KB Output is correct
282 Correct 1667 ms 3240 KB Output is correct
283 Correct 1658 ms 3240 KB Output is correct