Submission #412822

# Submission time Handle Problem Language Result Execution time Memory
412822 2021-05-27T15:50:21 Z two_sides Road Closures (APIO21_roads) C++17
100 / 100
198 ms 52156 KB
#include "roads.h"
#include <bits/stdc++.h>

using namespace std;

template <class X, class Y>
bool cmin(X &a, const Y &b) {
    return a > b ? a = b, 1 : 0;
}

const long long INF = 1e18;
const int MAXN = 200005;

struct Fenwick {
    vector <int> cnt; int N;
    vector <long long> sum;

    void init(int N) {
        this->N = N;
        cnt.assign(N + 1, 0);
        sum.assign(N + 1, 0);
    }

    void add(int i, int v) {
        for (; i <= N; i += i & -i) {
            cnt[i]++; sum[i] += v;
        }
    }

    long long get(int k) {
        if (k < 0) return 0;
        int p = 0; long long ans = 0;
        for (int l = 1 << 18; l > 0; l >>= 1)
            if (p + l <= N && k >= cnt[p + l]) {
                k -= cnt[p += l]; ans += sum[p];
            }
        return k > 0 ? INF : ans;
    }
};

int par[MAXN], val[MAXN], ord[MAXN];
vector <pair <int, int>> adj[MAXN];
long long DP[MAXN][2];
int prv[MAXN], nxt[MAXN], ptr, lim;
int tin[MAXN], tout[MAXN], ver[MAXN];
Fenwick BIT[MAXN];

void del(int i) {
    nxt[prv[i]] = nxt[i];
    prv[nxt[i]] = prv[i];
}

void DFS1(int u) {
    ver[tin[u] = ++ptr] = u;
    for (int i = 0; i < adj[u].size(); i++) {
        int v, w; tie(w, v) = adj[u][i];
        if (v != par[u]) {
            par[v] = u; val[v] = w;
            ord[v] = i + 1; DFS1(v);
        }
    }
    tout[u] = ptr;
}

void DFS2(int u) {
    vector <long long> tmp;
    long long sum = 0;
    while (nxt[ptr] <= tout[u]) {
        ptr = nxt[ptr];
        int v = ver[ptr]; DFS2(v);
        if (par[v] == u) {
            sum += DP[v][0];
            tmp.push_back(DP[v][1] - DP[v][0]);
        } else sum += min(DP[v][1], DP[v][0]);
    }
    sort(tmp.begin(), tmp.end());
    int can = adj[u].size() - lim;
    DP[u][0] = min(INF, sum + BIT[u].get(can));
    DP[u][1] = min(INF, sum + BIT[u].get(can - 1));
    for (int i = 0; i < tmp.size(); i++) {
        sum += tmp[i];
        cmin(DP[u][0], sum + BIT[u].get(can - i - 1));
        cmin(DP[u][1], sum + BIT[u].get(can - i - 2));
    }
    if (u) DP[u][1] += val[u];
    else DP[u][1] = INF;
}

long long compute() {
    ptr = 0; long long ans = 0;
    while (nxt[ptr] <= tout[0]) {
        ptr = nxt[ptr];
        int u = ver[ptr]; DFS2(u);
        ans += min(DP[u][0], DP[u][1]);
    }
    return ans;
}

vector <long long> minimum_closure_costs(int N,
vector <int> U, vector <int> V, vector <int> W) {
    vector <long long> costs(N);
    vector <int> nodes;
    for (int i = 0; i < N; i++) {
        adj[i].clear();
        prv[i + 1] = i; nxt[i + 1] = i + 2;
        nodes.push_back(i);
    }
    prv[N + 1] = N; nxt[0] = 1;
    for (int i = 0; i + 1 < N; i++) {
        adj[U[i]].emplace_back(W[i], V[i]);
        adj[V[i]].emplace_back(W[i], U[i]);
        costs[0] += W[i];
    }
    for (int i = 0; i < N; i++) {
       BIT[i].init(adj[i].size());
       sort(adj[i].begin(), adj[i].end());
    }
    DFS1(ptr = 0);
    sort(nodes.begin(), nodes.end(),
    [&](int u, int v) {
        return adj[u].size() < adj[v].size();
    });

    for  (int i = 1, j = 0; i < N; i++) {
        while (j < N && adj[nodes[j]].size() <= i) {
            int u = nodes[j++];
            if (u && adj[par[u]].size() > i)
                BIT[par[u]].add(ord[u], val[u]);
            del(tin[u]);
        }
        lim = i; costs[i] = compute();
    }
    return costs;
}

Compilation message

roads.cpp: In function 'void DFS1(int)':
roads.cpp:55:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   55 |     for (int i = 0; i < adj[u].size(); i++) {
      |                     ~~^~~~~~~~~~~~~~~
roads.cpp: In function 'void DFS2(int)':
roads.cpp:80:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   80 |     for (int i = 0; i < tmp.size(); i++) {
      |                     ~~^~~~~~~~~~~~
roads.cpp: In function 'std::vector<long long int> minimum_closure_costs(int, std::vector<int>, std::vector<int>, std::vector<int>)':
roads.cpp:125:46: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  125 |         while (j < N && adj[nodes[j]].size() <= i) {
      |                         ~~~~~~~~~~~~~~~~~~~~~^~~~
roads.cpp:127:41: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  127 |             if (u && adj[par[u]].size() > i)
      |                      ~~~~~~~~~~~~~~~~~~~^~~
# Verdict Execution time Memory Grader output
1 Correct 10 ms 15948 KB Output is correct
2 Correct 11 ms 16332 KB Output is correct
3 Correct 14 ms 16320 KB Output is correct
4 Correct 14 ms 16308 KB Output is correct
5 Correct 9 ms 15948 KB Output is correct
6 Correct 10 ms 16040 KB Output is correct
7 Correct 9 ms 16000 KB Output is correct
8 Correct 11 ms 16312 KB Output is correct
9 Correct 11 ms 16328 KB Output is correct
10 Correct 12 ms 15952 KB Output is correct
11 Correct 11 ms 15948 KB Output is correct
12 Correct 72 ms 26964 KB Output is correct
13 Correct 117 ms 34452 KB Output is correct
14 Correct 114 ms 32260 KB Output is correct
15 Correct 129 ms 33848 KB Output is correct
16 Correct 126 ms 34104 KB Output is correct
17 Correct 130 ms 34184 KB Output is correct
18 Correct 10 ms 15948 KB Output is correct
19 Correct 102 ms 32452 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 15996 KB Output is correct
2 Correct 91 ms 44852 KB Output is correct
3 Correct 111 ms 48564 KB Output is correct
4 Correct 113 ms 50856 KB Output is correct
5 Correct 112 ms 50804 KB Output is correct
6 Correct 12 ms 16588 KB Output is correct
7 Correct 12 ms 16588 KB Output is correct
8 Correct 11 ms 16628 KB Output is correct
9 Correct 10 ms 16020 KB Output is correct
10 Correct 10 ms 15976 KB Output is correct
11 Correct 10 ms 16040 KB Output is correct
12 Correct 71 ms 36888 KB Output is correct
13 Correct 104 ms 50732 KB Output is correct
14 Correct 10 ms 15948 KB Output is correct
15 Correct 97 ms 47352 KB Output is correct
16 Correct 105 ms 50708 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 15888 KB Output is correct
2 Correct 9 ms 15948 KB Output is correct
3 Correct 10 ms 15948 KB Output is correct
4 Correct 10 ms 15948 KB Output is correct
5 Correct 10 ms 15948 KB Output is correct
6 Correct 10 ms 16036 KB Output is correct
7 Correct 10 ms 16040 KB Output is correct
8 Correct 11 ms 16000 KB Output is correct
9 Correct 10 ms 16048 KB Output is correct
10 Correct 12 ms 15948 KB Output is correct
11 Correct 11 ms 15964 KB Output is correct
12 Correct 10 ms 16076 KB Output is correct
13 Correct 10 ms 15948 KB Output is correct
14 Correct 10 ms 15948 KB Output is correct
15 Correct 10 ms 15948 KB Output is correct
16 Correct 11 ms 15948 KB Output is correct
17 Correct 10 ms 15948 KB Output is correct
18 Correct 11 ms 15948 KB Output is correct
19 Correct 10 ms 15948 KB Output is correct
20 Correct 10 ms 15948 KB Output is correct
21 Correct 10 ms 15996 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 15888 KB Output is correct
2 Correct 9 ms 15948 KB Output is correct
3 Correct 10 ms 15948 KB Output is correct
4 Correct 10 ms 15948 KB Output is correct
5 Correct 10 ms 15948 KB Output is correct
6 Correct 10 ms 16036 KB Output is correct
7 Correct 10 ms 16040 KB Output is correct
8 Correct 11 ms 16000 KB Output is correct
9 Correct 10 ms 16048 KB Output is correct
10 Correct 12 ms 15948 KB Output is correct
11 Correct 11 ms 15964 KB Output is correct
12 Correct 10 ms 16076 KB Output is correct
13 Correct 10 ms 15948 KB Output is correct
14 Correct 10 ms 15948 KB Output is correct
15 Correct 10 ms 15948 KB Output is correct
16 Correct 11 ms 15948 KB Output is correct
17 Correct 10 ms 15948 KB Output is correct
18 Correct 11 ms 15948 KB Output is correct
19 Correct 10 ms 15948 KB Output is correct
20 Correct 10 ms 15948 KB Output is correct
21 Correct 10 ms 15996 KB Output is correct
22 Correct 10 ms 15992 KB Output is correct
23 Correct 12 ms 16268 KB Output is correct
24 Correct 14 ms 16288 KB Output is correct
25 Correct 14 ms 16332 KB Output is correct
26 Correct 14 ms 16332 KB Output is correct
27 Correct 12 ms 16332 KB Output is correct
28 Correct 12 ms 16388 KB Output is correct
29 Correct 12 ms 16332 KB Output is correct
30 Correct 12 ms 16332 KB Output is correct
31 Correct 12 ms 16376 KB Output is correct
32 Correct 12 ms 16332 KB Output is correct
33 Correct 12 ms 16588 KB Output is correct
34 Correct 12 ms 16636 KB Output is correct
35 Correct 11 ms 16624 KB Output is correct
36 Correct 12 ms 16332 KB Output is correct
37 Correct 13 ms 16332 KB Output is correct
38 Correct 12 ms 16332 KB Output is correct
39 Correct 11 ms 15948 KB Output is correct
40 Correct 10 ms 15948 KB Output is correct
41 Correct 10 ms 15948 KB Output is correct
42 Correct 10 ms 15948 KB Output is correct
43 Correct 10 ms 15964 KB Output is correct
44 Correct 10 ms 15948 KB Output is correct
45 Correct 9 ms 15948 KB Output is correct
46 Correct 10 ms 16048 KB Output is correct
47 Correct 10 ms 15948 KB Output is correct
48 Correct 11 ms 15948 KB Output is correct
49 Correct 11 ms 16004 KB Output is correct
50 Correct 10 ms 15948 KB Output is correct
51 Correct 10 ms 15976 KB Output is correct
52 Correct 12 ms 15948 KB Output is correct
53 Correct 11 ms 16312 KB Output is correct
54 Correct 12 ms 16332 KB Output is correct
55 Correct 12 ms 16368 KB Output is correct
56 Correct 12 ms 16204 KB Output is correct
57 Correct 12 ms 16332 KB Output is correct
58 Correct 10 ms 15948 KB Output is correct
59 Correct 12 ms 15948 KB Output is correct
60 Correct 12 ms 15948 KB Output is correct
61 Correct 11 ms 15948 KB Output is correct
62 Correct 10 ms 15948 KB Output is correct
63 Correct 11 ms 15920 KB Output is correct
64 Correct 13 ms 16376 KB Output is correct
65 Correct 13 ms 16392 KB Output is correct
66 Correct 12 ms 16332 KB Output is correct
67 Correct 12 ms 16332 KB Output is correct
68 Correct 12 ms 16372 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 164 ms 34048 KB Output is correct
2 Correct 168 ms 34300 KB Output is correct
3 Correct 146 ms 35624 KB Output is correct
4 Correct 168 ms 34548 KB Output is correct
5 Correct 143 ms 35388 KB Output is correct
6 Correct 132 ms 34504 KB Output is correct
7 Correct 155 ms 35132 KB Output is correct
8 Correct 130 ms 33156 KB Output is correct
9 Correct 153 ms 40452 KB Output is correct
10 Correct 163 ms 34720 KB Output is correct
11 Correct 140 ms 35260 KB Output is correct
12 Correct 123 ms 34236 KB Output is correct
13 Correct 11 ms 15948 KB Output is correct
14 Correct 95 ms 48460 KB Output is correct
15 Correct 110 ms 50900 KB Output is correct
16 Correct 14 ms 16312 KB Output is correct
17 Correct 12 ms 16372 KB Output is correct
18 Correct 12 ms 16384 KB Output is correct
19 Correct 12 ms 16340 KB Output is correct
20 Correct 14 ms 16376 KB Output is correct
21 Correct 105 ms 32268 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 164 ms 34048 KB Output is correct
2 Correct 168 ms 34300 KB Output is correct
3 Correct 146 ms 35624 KB Output is correct
4 Correct 168 ms 34548 KB Output is correct
5 Correct 143 ms 35388 KB Output is correct
6 Correct 132 ms 34504 KB Output is correct
7 Correct 155 ms 35132 KB Output is correct
8 Correct 130 ms 33156 KB Output is correct
9 Correct 153 ms 40452 KB Output is correct
10 Correct 163 ms 34720 KB Output is correct
11 Correct 140 ms 35260 KB Output is correct
12 Correct 123 ms 34236 KB Output is correct
13 Correct 11 ms 15948 KB Output is correct
14 Correct 95 ms 48460 KB Output is correct
15 Correct 110 ms 50900 KB Output is correct
16 Correct 14 ms 16312 KB Output is correct
17 Correct 12 ms 16372 KB Output is correct
18 Correct 12 ms 16384 KB Output is correct
19 Correct 12 ms 16340 KB Output is correct
20 Correct 14 ms 16376 KB Output is correct
21 Correct 105 ms 32268 KB Output is correct
22 Correct 10 ms 15948 KB Output is correct
23 Correct 10 ms 16000 KB Output is correct
24 Correct 9 ms 15948 KB Output is correct
25 Correct 140 ms 32008 KB Output is correct
26 Correct 120 ms 30712 KB Output is correct
27 Correct 160 ms 35156 KB Output is correct
28 Correct 147 ms 35632 KB Output is correct
29 Correct 122 ms 34516 KB Output is correct
30 Correct 128 ms 34028 KB Output is correct
31 Correct 127 ms 34644 KB Output is correct
32 Correct 177 ms 33532 KB Output is correct
33 Correct 116 ms 33516 KB Output is correct
34 Correct 154 ms 35416 KB Output is correct
35 Correct 164 ms 41256 KB Output is correct
36 Correct 141 ms 35760 KB Output is correct
37 Correct 134 ms 34284 KB Output is correct
38 Correct 69 ms 37004 KB Output is correct
39 Correct 104 ms 51068 KB Output is correct
40 Correct 11 ms 16204 KB Output is correct
41 Correct 12 ms 16300 KB Output is correct
42 Correct 12 ms 16332 KB Output is correct
43 Correct 11 ms 16204 KB Output is correct
44 Correct 12 ms 16364 KB Output is correct
45 Correct 11 ms 15948 KB Output is correct
46 Correct 10 ms 16020 KB Output is correct
47 Correct 10 ms 15948 KB Output is correct
48 Correct 11 ms 15964 KB Output is correct
49 Correct 11 ms 15948 KB Output is correct
50 Correct 85 ms 27056 KB Output is correct
51 Correct 134 ms 34572 KB Output is correct
52 Correct 159 ms 34784 KB Output is correct
53 Correct 178 ms 34416 KB Output is correct
54 Correct 144 ms 35772 KB Output is correct
55 Correct 163 ms 35124 KB Output is correct
56 Correct 124 ms 35388 KB Output is correct
57 Correct 133 ms 34320 KB Output is correct
58 Correct 179 ms 35092 KB Output is correct
59 Correct 105 ms 32560 KB Output is correct
60 Correct 147 ms 41276 KB Output is correct
61 Correct 156 ms 35524 KB Output is correct
62 Correct 140 ms 35388 KB Output is correct
63 Correct 145 ms 34204 KB Output is correct
64 Correct 12 ms 15948 KB Output is correct
65 Correct 106 ms 47352 KB Output is correct
66 Correct 114 ms 50752 KB Output is correct
67 Correct 12 ms 16332 KB Output is correct
68 Correct 12 ms 16332 KB Output is correct
69 Correct 12 ms 16332 KB Output is correct
70 Correct 13 ms 16300 KB Output is correct
71 Correct 12 ms 16332 KB Output is correct
72 Correct 104 ms 32324 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 15948 KB Output is correct
2 Correct 11 ms 16332 KB Output is correct
3 Correct 14 ms 16320 KB Output is correct
4 Correct 14 ms 16308 KB Output is correct
5 Correct 9 ms 15948 KB Output is correct
6 Correct 10 ms 16040 KB Output is correct
7 Correct 9 ms 16000 KB Output is correct
8 Correct 11 ms 16312 KB Output is correct
9 Correct 11 ms 16328 KB Output is correct
10 Correct 12 ms 15952 KB Output is correct
11 Correct 11 ms 15948 KB Output is correct
12 Correct 72 ms 26964 KB Output is correct
13 Correct 117 ms 34452 KB Output is correct
14 Correct 114 ms 32260 KB Output is correct
15 Correct 129 ms 33848 KB Output is correct
16 Correct 126 ms 34104 KB Output is correct
17 Correct 130 ms 34184 KB Output is correct
18 Correct 10 ms 15948 KB Output is correct
19 Correct 102 ms 32452 KB Output is correct
20 Correct 10 ms 15996 KB Output is correct
21 Correct 91 ms 44852 KB Output is correct
22 Correct 111 ms 48564 KB Output is correct
23 Correct 113 ms 50856 KB Output is correct
24 Correct 112 ms 50804 KB Output is correct
25 Correct 12 ms 16588 KB Output is correct
26 Correct 12 ms 16588 KB Output is correct
27 Correct 11 ms 16628 KB Output is correct
28 Correct 10 ms 16020 KB Output is correct
29 Correct 10 ms 15976 KB Output is correct
30 Correct 10 ms 16040 KB Output is correct
31 Correct 71 ms 36888 KB Output is correct
32 Correct 104 ms 50732 KB Output is correct
33 Correct 10 ms 15948 KB Output is correct
34 Correct 97 ms 47352 KB Output is correct
35 Correct 105 ms 50708 KB Output is correct
36 Correct 10 ms 15888 KB Output is correct
37 Correct 9 ms 15948 KB Output is correct
38 Correct 10 ms 15948 KB Output is correct
39 Correct 10 ms 15948 KB Output is correct
40 Correct 10 ms 15948 KB Output is correct
41 Correct 10 ms 16036 KB Output is correct
42 Correct 10 ms 16040 KB Output is correct
43 Correct 11 ms 16000 KB Output is correct
44 Correct 10 ms 16048 KB Output is correct
45 Correct 12 ms 15948 KB Output is correct
46 Correct 11 ms 15964 KB Output is correct
47 Correct 10 ms 16076 KB Output is correct
48 Correct 10 ms 15948 KB Output is correct
49 Correct 10 ms 15948 KB Output is correct
50 Correct 10 ms 15948 KB Output is correct
51 Correct 11 ms 15948 KB Output is correct
52 Correct 10 ms 15948 KB Output is correct
53 Correct 11 ms 15948 KB Output is correct
54 Correct 10 ms 15948 KB Output is correct
55 Correct 10 ms 15948 KB Output is correct
56 Correct 10 ms 15996 KB Output is correct
57 Correct 10 ms 15992 KB Output is correct
58 Correct 12 ms 16268 KB Output is correct
59 Correct 14 ms 16288 KB Output is correct
60 Correct 14 ms 16332 KB Output is correct
61 Correct 14 ms 16332 KB Output is correct
62 Correct 12 ms 16332 KB Output is correct
63 Correct 12 ms 16388 KB Output is correct
64 Correct 12 ms 16332 KB Output is correct
65 Correct 12 ms 16332 KB Output is correct
66 Correct 12 ms 16376 KB Output is correct
67 Correct 12 ms 16332 KB Output is correct
68 Correct 12 ms 16588 KB Output is correct
69 Correct 12 ms 16636 KB Output is correct
70 Correct 11 ms 16624 KB Output is correct
71 Correct 12 ms 16332 KB Output is correct
72 Correct 13 ms 16332 KB Output is correct
73 Correct 12 ms 16332 KB Output is correct
74 Correct 11 ms 15948 KB Output is correct
75 Correct 10 ms 15948 KB Output is correct
76 Correct 10 ms 15948 KB Output is correct
77 Correct 10 ms 15948 KB Output is correct
78 Correct 10 ms 15964 KB Output is correct
79 Correct 10 ms 15948 KB Output is correct
80 Correct 9 ms 15948 KB Output is correct
81 Correct 10 ms 16048 KB Output is correct
82 Correct 10 ms 15948 KB Output is correct
83 Correct 11 ms 15948 KB Output is correct
84 Correct 11 ms 16004 KB Output is correct
85 Correct 10 ms 15948 KB Output is correct
86 Correct 10 ms 15976 KB Output is correct
87 Correct 12 ms 15948 KB Output is correct
88 Correct 11 ms 16312 KB Output is correct
89 Correct 12 ms 16332 KB Output is correct
90 Correct 12 ms 16368 KB Output is correct
91 Correct 12 ms 16204 KB Output is correct
92 Correct 12 ms 16332 KB Output is correct
93 Correct 10 ms 15948 KB Output is correct
94 Correct 12 ms 15948 KB Output is correct
95 Correct 12 ms 15948 KB Output is correct
96 Correct 11 ms 15948 KB Output is correct
97 Correct 10 ms 15948 KB Output is correct
98 Correct 11 ms 15920 KB Output is correct
99 Correct 13 ms 16376 KB Output is correct
100 Correct 13 ms 16392 KB Output is correct
101 Correct 12 ms 16332 KB Output is correct
102 Correct 12 ms 16332 KB Output is correct
103 Correct 12 ms 16372 KB Output is correct
104 Correct 164 ms 34048 KB Output is correct
105 Correct 168 ms 34300 KB Output is correct
106 Correct 146 ms 35624 KB Output is correct
107 Correct 168 ms 34548 KB Output is correct
108 Correct 143 ms 35388 KB Output is correct
109 Correct 132 ms 34504 KB Output is correct
110 Correct 155 ms 35132 KB Output is correct
111 Correct 130 ms 33156 KB Output is correct
112 Correct 153 ms 40452 KB Output is correct
113 Correct 163 ms 34720 KB Output is correct
114 Correct 140 ms 35260 KB Output is correct
115 Correct 123 ms 34236 KB Output is correct
116 Correct 11 ms 15948 KB Output is correct
117 Correct 95 ms 48460 KB Output is correct
118 Correct 110 ms 50900 KB Output is correct
119 Correct 14 ms 16312 KB Output is correct
120 Correct 12 ms 16372 KB Output is correct
121 Correct 12 ms 16384 KB Output is correct
122 Correct 12 ms 16340 KB Output is correct
123 Correct 14 ms 16376 KB Output is correct
124 Correct 105 ms 32268 KB Output is correct
125 Correct 10 ms 15948 KB Output is correct
126 Correct 10 ms 16000 KB Output is correct
127 Correct 9 ms 15948 KB Output is correct
128 Correct 140 ms 32008 KB Output is correct
129 Correct 120 ms 30712 KB Output is correct
130 Correct 160 ms 35156 KB Output is correct
131 Correct 147 ms 35632 KB Output is correct
132 Correct 122 ms 34516 KB Output is correct
133 Correct 128 ms 34028 KB Output is correct
134 Correct 127 ms 34644 KB Output is correct
135 Correct 177 ms 33532 KB Output is correct
136 Correct 116 ms 33516 KB Output is correct
137 Correct 154 ms 35416 KB Output is correct
138 Correct 164 ms 41256 KB Output is correct
139 Correct 141 ms 35760 KB Output is correct
140 Correct 134 ms 34284 KB Output is correct
141 Correct 69 ms 37004 KB Output is correct
142 Correct 104 ms 51068 KB Output is correct
143 Correct 11 ms 16204 KB Output is correct
144 Correct 12 ms 16300 KB Output is correct
145 Correct 12 ms 16332 KB Output is correct
146 Correct 11 ms 16204 KB Output is correct
147 Correct 12 ms 16364 KB Output is correct
148 Correct 11 ms 15948 KB Output is correct
149 Correct 10 ms 16020 KB Output is correct
150 Correct 10 ms 15948 KB Output is correct
151 Correct 11 ms 15964 KB Output is correct
152 Correct 11 ms 15948 KB Output is correct
153 Correct 85 ms 27056 KB Output is correct
154 Correct 134 ms 34572 KB Output is correct
155 Correct 159 ms 34784 KB Output is correct
156 Correct 178 ms 34416 KB Output is correct
157 Correct 144 ms 35772 KB Output is correct
158 Correct 163 ms 35124 KB Output is correct
159 Correct 124 ms 35388 KB Output is correct
160 Correct 133 ms 34320 KB Output is correct
161 Correct 179 ms 35092 KB Output is correct
162 Correct 105 ms 32560 KB Output is correct
163 Correct 147 ms 41276 KB Output is correct
164 Correct 156 ms 35524 KB Output is correct
165 Correct 140 ms 35388 KB Output is correct
166 Correct 145 ms 34204 KB Output is correct
167 Correct 12 ms 15948 KB Output is correct
168 Correct 106 ms 47352 KB Output is correct
169 Correct 114 ms 50752 KB Output is correct
170 Correct 12 ms 16332 KB Output is correct
171 Correct 12 ms 16332 KB Output is correct
172 Correct 12 ms 16332 KB Output is correct
173 Correct 13 ms 16300 KB Output is correct
174 Correct 12 ms 16332 KB Output is correct
175 Correct 104 ms 32324 KB Output is correct
176 Correct 9 ms 15948 KB Output is correct
177 Correct 175 ms 36364 KB Output is correct
178 Correct 134 ms 30812 KB Output is correct
179 Correct 147 ms 36196 KB Output is correct
180 Correct 155 ms 35460 KB Output is correct
181 Correct 140 ms 35960 KB Output is correct
182 Correct 140 ms 35768 KB Output is correct
183 Correct 154 ms 35260 KB Output is correct
184 Correct 131 ms 33316 KB Output is correct
185 Correct 126 ms 33592 KB Output is correct
186 Correct 144 ms 33544 KB Output is correct
187 Correct 133 ms 33848 KB Output is correct
188 Correct 155 ms 33724 KB Output is correct
189 Correct 160 ms 33428 KB Output is correct
190 Correct 149 ms 35308 KB Output is correct
191 Correct 162 ms 35388 KB Output is correct
192 Correct 141 ms 34032 KB Output is correct
193 Correct 147 ms 34084 KB Output is correct
194 Correct 153 ms 35308 KB Output is correct
195 Correct 99 ms 46396 KB Output is correct
196 Correct 106 ms 49792 KB Output is correct
197 Correct 112 ms 51460 KB Output is correct
198 Correct 112 ms 51156 KB Output is correct
199 Correct 11 ms 16212 KB Output is correct
200 Correct 13 ms 16404 KB Output is correct
201 Correct 11 ms 16332 KB Output is correct
202 Correct 12 ms 16396 KB Output is correct
203 Correct 13 ms 16332 KB Output is correct
204 Correct 12 ms 16368 KB Output is correct
205 Correct 12 ms 16324 KB Output is correct
206 Correct 12 ms 16332 KB Output is correct
207 Correct 12 ms 16332 KB Output is correct
208 Correct 12 ms 16332 KB Output is correct
209 Correct 12 ms 16520 KB Output is correct
210 Correct 12 ms 16716 KB Output is correct
211 Correct 12 ms 16628 KB Output is correct
212 Correct 11 ms 16312 KB Output is correct
213 Correct 11 ms 16332 KB Output is correct
214 Correct 11 ms 16324 KB Output is correct
215 Correct 11 ms 15948 KB Output is correct
216 Correct 11 ms 15968 KB Output is correct
217 Correct 13 ms 15948 KB Output is correct
218 Correct 10 ms 15948 KB Output is correct
219 Correct 10 ms 15948 KB Output is correct
220 Correct 10 ms 15948 KB Output is correct
221 Correct 9 ms 15948 KB Output is correct
222 Correct 10 ms 15948 KB Output is correct
223 Correct 9 ms 15948 KB Output is correct
224 Correct 9 ms 16012 KB Output is correct
225 Correct 10 ms 16076 KB Output is correct
226 Correct 10 ms 15948 KB Output is correct
227 Correct 10 ms 15948 KB Output is correct
228 Correct 10 ms 15948 KB Output is correct
229 Correct 146 ms 32152 KB Output is correct
230 Correct 122 ms 30716 KB Output is correct
231 Correct 197 ms 35248 KB Output is correct
232 Correct 143 ms 35772 KB Output is correct
233 Correct 117 ms 33980 KB Output is correct
234 Correct 123 ms 33720 KB Output is correct
235 Correct 127 ms 34100 KB Output is correct
236 Correct 155 ms 34096 KB Output is correct
237 Correct 112 ms 34236 KB Output is correct
238 Correct 152 ms 36444 KB Output is correct
239 Correct 165 ms 42516 KB Output is correct
240 Correct 145 ms 36716 KB Output is correct
241 Correct 133 ms 35512 KB Output is correct
242 Correct 66 ms 37552 KB Output is correct
243 Correct 105 ms 52156 KB Output is correct
244 Correct 12 ms 16204 KB Output is correct
245 Correct 13 ms 16332 KB Output is correct
246 Correct 12 ms 16332 KB Output is correct
247 Correct 12 ms 16248 KB Output is correct
248 Correct 12 ms 16332 KB Output is correct
249 Correct 10 ms 15928 KB Output is correct
250 Correct 11 ms 15948 KB Output is correct
251 Correct 10 ms 15948 KB Output is correct
252 Correct 10 ms 15948 KB Output is correct
253 Correct 11 ms 16020 KB Output is correct
254 Correct 73 ms 26924 KB Output is correct
255 Correct 120 ms 34488 KB Output is correct
256 Correct 115 ms 32328 KB Output is correct
257 Correct 126 ms 35368 KB Output is correct
258 Correct 128 ms 35660 KB Output is correct
259 Correct 123 ms 35512 KB Output is correct
260 Correct 155 ms 35248 KB Output is correct
261 Correct 174 ms 35008 KB Output is correct
262 Correct 140 ms 36608 KB Output is correct
263 Correct 198 ms 35900 KB Output is correct
264 Correct 135 ms 36736 KB Output is correct
265 Correct 130 ms 35544 KB Output is correct
266 Correct 155 ms 36412 KB Output is correct
267 Correct 106 ms 33832 KB Output is correct
268 Correct 149 ms 41436 KB Output is correct
269 Correct 167 ms 35640 KB Output is correct
270 Correct 151 ms 36612 KB Output is correct
271 Correct 142 ms 35360 KB Output is correct
272 Correct 10 ms 15948 KB Output is correct
273 Correct 95 ms 48560 KB Output is correct
274 Correct 104 ms 52064 KB Output is correct
275 Correct 13 ms 16388 KB Output is correct
276 Correct 14 ms 16332 KB Output is correct
277 Correct 14 ms 16380 KB Output is correct
278 Correct 12 ms 16332 KB Output is correct
279 Correct 12 ms 16332 KB Output is correct
280 Correct 102 ms 33168 KB Output is correct