Submission #229728

# Submission time Handle Problem Language Result Execution time Memory
229728 2020-05-06T06:24:59 Z lyc Duathlon (APIO18_duathlon) C++14
100 / 100
173 ms 39412 KB
#include <bits/stdc++.h>
using namespace std;

#define TRACE(x) cerr << #x << " :: " << x << endl
#define _ << " " <<
#define SZ(x) (int)(x).size()
#define ALL(x) (x).begin(),(x).end()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define RFOR(i,a,b) for (int i=(a);i>=(b);--i)

const int MX_N = 1e5+5;
int N, M;
vector<int> al[MX_N];

namespace BCT {
    int pre[MX_N], low[MX_N], cnt, root, rootChildren;

    vector<int> stk;
    int comp[MX_N], sz[2*MX_N]; // ~N blocks + ~N ap
    int nap, nv;

    vector<int> tree[2*MX_N];

    void dfs(int u, int p) {
        pre[u] = low[u] = ++cnt;
        for (int v : al[u]) if (v != p) {
            if (pre[v] == -1) {
                dfs(v,u);
                if (u == root) ++rootChildren;
                else if (comp[u] == -1 && low[v] >= pre[u]) comp[u] = ++nv, sz[nv] = 1;
                low[u] = min(low[u],low[v]);
            } else {
                low[u] = min(low[u],pre[v]);
            }
        }
    }

    void addEdge(int u, int v) {
        tree[u].push_back(v);
        tree[v].push_back(u);
    }

    void decomp(int u, int p) {
        pre[u] = ++cnt;
        stk.push_back(u);
        for (int v : al[u]) if (v != p) {
            if (pre[v] == -1) {
                int st = stk.back();
                decomp(v,u);

                if (comp[u] != -1 && low[v] >= pre[u]) {
                    sz[++nv] = 1;
                    addEdge(comp[u],nv);
                    while (stk.back() != st) {
                        int& w = stk.back(); stk.pop_back();
                        ++sz[nv];
                        if (comp[w] == -1) comp[w] = nv;
                        else addEdge(comp[w],nv);
                    }
                }
            }
        }
    }

    void run() {
        fill_n(comp,N+1,-1); nv = 0;

        fill_n(pre,N+1,-1); cnt = 0;
        FOR(u,1,N) if (pre[u] == -1) {
            root = u, rootChildren = 0;
            dfs(u,0);
            if (rootChildren > 1) comp[u] = ++nv, sz[nv] = 1;
        }
        nap = nv;

        fill_n(pre,N+1,-1); cnt = 0;
        FOR(u,1,N) if (pre[u] == -1) {
            stk.clear();
            decomp(u,0);
            if (comp[u] == -1) {
                sz[++nv] = 0;
                while (!stk.empty()) {
                    int& w = stk.back(); stk.pop_back();
                    ++sz[nv];
                    if (comp[w] == -1) comp[w] = nv;
                    else addEdge(comp[w],nv);
                }
            }
        }
    }

    void dbg() {
        FOR(i,1,N){ TRACE(i _ pre[i] _ low[i] _ comp[i]); }
        TRACE(nv);
        cout << "APs: "; FOR(i,1,N){ if (comp[i] <= nap) cout << i << ' '; } cout << endl;
        FOR(i,1,nv){ cout << i << " (" << sz[i] << "): "; for(int v : tree[i]) { cout << v << ' '; } cout << endl; }
    }

    long long ans;
    int sub[2*MX_N];

    void precomp(int u, int p) {
        sub[u] = sz[u];
        for (int v : tree[u]) if (v != p) {
            precomp(v,u);
            sub[u] += sub[v];
            --sub[u];
        }
        //TRACE(u _ sz[u] _ u _ sub[u]);
    }

    void trav(int u, int p, int all) {
        //TRACE("trav" _ u _ p _ all);
        if (u <= nap) {
            int other = all - 1;
            for (int v : tree[u]) {
                int cur;
                if (v == p) {
                    cur = all-sub[u];
                } else {
                    cur = sub[v]-1;
                    trav(v,u,all);
                }
                //long long two = 1LL * cur * (other-cur);
                //long long one = 1LL * (sz[v]-1) * (sz[v]-2);
                //long long snk = 2LL * (cur+1-sz[v]) * (sz[v]-2);
                //TRACE(u _ v _ "add" _ cur _ (other-cur) _ "res" _ two _ one _ snk);
                assert(cur >= 0 && other-cur >= 0 && sz[v] >= 2);
                ans += 1LL * cur * (other-cur);     // ep in diff
                ans += 1LL * (sz[v]-1) * (sz[v]-2); // ep in same
                ans += 2LL * (cur+1-sz[v]) * (sz[v]-2); // ep in same subtree
            }
        } else {
            int inside = (sz[u] - SZ(tree[u]));
            int other = all - inside;
            for (int v : tree[u]) {
                other -= sz[v];
            }
            for (int v : tree[u]) {
                int cur;
                if (v == p) {
                    cur = all-sub[u]-(sz[p]-1);
                } else {
                    cur = sub[v]-sz[v];
                    trav(v,u,all);
                }
                //long long two = inside * cur * (other-cur);
                //long long one = 2LL * inside * cur * (sz[u]-2);
                //long long snk = 1LL * (SZ(tree[u])-2) * cur * (other-cur);
                //TRACE(u _ v _ "add" _ cur _ (other-cur) _ "res" _ two _ one _ snk);
                ans += 1LL * inside * cur * (other-cur);// both ep outside
                ans += 2LL * inside * cur * (sz[u]-2);  // one ep outside
                if (SZ(tree[u]) >= 2) ans += 1LL * (SZ(tree[u])-2) * cur * (other-cur); // both ep outside, mid is ap
            }
            //long long zero = 1LL * inside * (sz[u]-1) * (sz[u]-2);
            //TRACE(u _ zero);
            ans += 1LL * inside * (sz[u]-1) * (sz[u]-2);
        }
    }

    long long solve() {
        ans = 0;
        fill_n(sub,nv+1,-1);
        FOR(i,1,nv) if (sub[i] == -1) {
            precomp(i,0);
            trav(i,0,sub[i]);
        }
        return ans;
    }
};

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

    cin >> N >> M;
    FOR(i,1,M){
        int U, V; cin >> U >> V;
        al[U].push_back(V);
        al[V].push_back(U);
    }

    BCT::run();
    //BCT::dbg();
    cout << BCT::solve() << '\n';
}

# Verdict Execution time Memory Grader output
1 Correct 10 ms 7424 KB Output is correct
2 Correct 9 ms 7424 KB Output is correct
3 Correct 10 ms 7424 KB Output is correct
4 Correct 9 ms 7424 KB Output is correct
5 Correct 9 ms 7424 KB Output is correct
6 Correct 10 ms 7424 KB Output is correct
7 Correct 10 ms 7424 KB Output is correct
8 Correct 9 ms 7424 KB Output is correct
9 Correct 9 ms 7424 KB Output is correct
10 Correct 9 ms 7424 KB Output is correct
11 Correct 9 ms 7424 KB Output is correct
12 Correct 9 ms 7424 KB Output is correct
13 Correct 9 ms 7424 KB Output is correct
14 Correct 9 ms 7424 KB Output is correct
15 Correct 9 ms 7424 KB Output is correct
16 Correct 9 ms 7424 KB Output is correct
17 Correct 9 ms 7424 KB Output is correct
18 Correct 10 ms 7424 KB Output is correct
19 Correct 12 ms 7424 KB Output is correct
20 Correct 9 ms 7424 KB Output is correct
21 Correct 15 ms 7424 KB Output is correct
22 Correct 9 ms 7424 KB Output is correct
23 Correct 9 ms 7424 KB Output is correct
24 Correct 9 ms 7424 KB Output is correct
25 Correct 9 ms 7424 KB Output is correct
26 Correct 9 ms 7424 KB Output is correct
27 Correct 10 ms 7424 KB Output is correct
28 Correct 9 ms 7424 KB Output is correct
29 Correct 10 ms 7400 KB Output is correct
30 Correct 9 ms 7424 KB Output is correct
31 Correct 9 ms 7424 KB Output is correct
32 Correct 9 ms 7424 KB Output is correct
33 Correct 10 ms 7424 KB Output is correct
34 Correct 9 ms 7424 KB Output is correct
35 Correct 9 ms 7424 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 7424 KB Output is correct
2 Correct 9 ms 7424 KB Output is correct
3 Correct 10 ms 7424 KB Output is correct
4 Correct 9 ms 7424 KB Output is correct
5 Correct 9 ms 7424 KB Output is correct
6 Correct 10 ms 7424 KB Output is correct
7 Correct 10 ms 7424 KB Output is correct
8 Correct 9 ms 7424 KB Output is correct
9 Correct 9 ms 7424 KB Output is correct
10 Correct 9 ms 7424 KB Output is correct
11 Correct 9 ms 7424 KB Output is correct
12 Correct 9 ms 7424 KB Output is correct
13 Correct 9 ms 7424 KB Output is correct
14 Correct 9 ms 7424 KB Output is correct
15 Correct 9 ms 7424 KB Output is correct
16 Correct 9 ms 7424 KB Output is correct
17 Correct 9 ms 7424 KB Output is correct
18 Correct 10 ms 7424 KB Output is correct
19 Correct 12 ms 7424 KB Output is correct
20 Correct 9 ms 7424 KB Output is correct
21 Correct 15 ms 7424 KB Output is correct
22 Correct 9 ms 7424 KB Output is correct
23 Correct 9 ms 7424 KB Output is correct
24 Correct 9 ms 7424 KB Output is correct
25 Correct 9 ms 7424 KB Output is correct
26 Correct 9 ms 7424 KB Output is correct
27 Correct 10 ms 7424 KB Output is correct
28 Correct 9 ms 7424 KB Output is correct
29 Correct 10 ms 7400 KB Output is correct
30 Correct 9 ms 7424 KB Output is correct
31 Correct 9 ms 7424 KB Output is correct
32 Correct 9 ms 7424 KB Output is correct
33 Correct 10 ms 7424 KB Output is correct
34 Correct 9 ms 7424 KB Output is correct
35 Correct 9 ms 7424 KB Output is correct
36 Correct 10 ms 7424 KB Output is correct
37 Correct 9 ms 7424 KB Output is correct
38 Correct 9 ms 7424 KB Output is correct
39 Correct 9 ms 7424 KB Output is correct
40 Correct 10 ms 7424 KB Output is correct
41 Correct 10 ms 7424 KB Output is correct
42 Correct 9 ms 7424 KB Output is correct
43 Correct 10 ms 7552 KB Output is correct
44 Correct 10 ms 7424 KB Output is correct
45 Correct 9 ms 7424 KB Output is correct
46 Correct 10 ms 7424 KB Output is correct
47 Correct 9 ms 7424 KB Output is correct
48 Correct 9 ms 7424 KB Output is correct
49 Correct 9 ms 7424 KB Output is correct
50 Correct 9 ms 7424 KB Output is correct
51 Correct 10 ms 7424 KB Output is correct
52 Correct 10 ms 7424 KB Output is correct
53 Correct 9 ms 7424 KB Output is correct
54 Correct 9 ms 7424 KB Output is correct
55 Correct 9 ms 7424 KB Output is correct
56 Correct 10 ms 7424 KB Output is correct
57 Correct 9 ms 7424 KB Output is correct
58 Correct 9 ms 7424 KB Output is correct
59 Correct 10 ms 7424 KB Output is correct
60 Correct 9 ms 7424 KB Output is correct
61 Correct 9 ms 7424 KB Output is correct
62 Correct 9 ms 7424 KB Output is correct
63 Correct 9 ms 7424 KB Output is correct
64 Correct 9 ms 7424 KB Output is correct
65 Correct 9 ms 7424 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 115 ms 22264 KB Output is correct
2 Correct 97 ms 22256 KB Output is correct
3 Correct 126 ms 25848 KB Output is correct
4 Correct 133 ms 21872 KB Output is correct
5 Correct 111 ms 21436 KB Output is correct
6 Correct 125 ms 27380 KB Output is correct
7 Correct 125 ms 20600 KB Output is correct
8 Correct 136 ms 23672 KB Output is correct
9 Correct 111 ms 18680 KB Output is correct
10 Correct 110 ms 19244 KB Output is correct
11 Correct 85 ms 14712 KB Output is correct
12 Correct 87 ms 14520 KB Output is correct
13 Correct 79 ms 13952 KB Output is correct
14 Correct 69 ms 13944 KB Output is correct
15 Correct 54 ms 12796 KB Output is correct
16 Correct 56 ms 12792 KB Output is correct
17 Correct 14 ms 9344 KB Output is correct
18 Correct 13 ms 9344 KB Output is correct
19 Correct 14 ms 9344 KB Output is correct
20 Correct 14 ms 9344 KB Output is correct
21 Correct 13 ms 9344 KB Output is correct
22 Correct 14 ms 9344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 7552 KB Output is correct
2 Correct 10 ms 7552 KB Output is correct
3 Correct 10 ms 7552 KB Output is correct
4 Correct 10 ms 7808 KB Output is correct
5 Correct 10 ms 7680 KB Output is correct
6 Correct 10 ms 7552 KB Output is correct
7 Correct 10 ms 7680 KB Output is correct
8 Correct 9 ms 7552 KB Output is correct
9 Correct 10 ms 7552 KB Output is correct
10 Correct 10 ms 7552 KB Output is correct
11 Correct 10 ms 7552 KB Output is correct
12 Correct 10 ms 7552 KB Output is correct
13 Correct 9 ms 7552 KB Output is correct
14 Correct 10 ms 7552 KB Output is correct
15 Correct 10 ms 7552 KB Output is correct
16 Correct 9 ms 7424 KB Output is correct
17 Correct 9 ms 7552 KB Output is correct
18 Correct 9 ms 7552 KB Output is correct
19 Correct 10 ms 7552 KB Output is correct
20 Correct 10 ms 7552 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 126 ms 18424 KB Output is correct
2 Correct 116 ms 18552 KB Output is correct
3 Correct 146 ms 18552 KB Output is correct
4 Correct 131 ms 18552 KB Output is correct
5 Correct 114 ms 18552 KB Output is correct
6 Correct 173 ms 39412 KB Output is correct
7 Correct 132 ms 26356 KB Output is correct
8 Correct 139 ms 24456 KB Output is correct
9 Correct 132 ms 22520 KB Output is correct
10 Correct 139 ms 18512 KB Output is correct
11 Correct 114 ms 18552 KB Output is correct
12 Correct 111 ms 18552 KB Output is correct
13 Correct 113 ms 18552 KB Output is correct
14 Correct 112 ms 18040 KB Output is correct
15 Correct 98 ms 16888 KB Output is correct
16 Correct 56 ms 13816 KB Output is correct
17 Correct 73 ms 17132 KB Output is correct
18 Correct 64 ms 17136 KB Output is correct
19 Correct 79 ms 17388 KB Output is correct
20 Correct 73 ms 17144 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 7552 KB Output is correct
2 Correct 9 ms 7552 KB Output is correct
3 Correct 12 ms 7552 KB Output is correct
4 Correct 10 ms 7552 KB Output is correct
5 Correct 10 ms 7424 KB Output is correct
6 Correct 10 ms 7424 KB Output is correct
7 Correct 11 ms 7552 KB Output is correct
8 Correct 9 ms 7424 KB Output is correct
9 Correct 10 ms 7424 KB Output is correct
10 Correct 9 ms 7552 KB Output is correct
11 Correct 10 ms 7424 KB Output is correct
12 Correct 10 ms 7552 KB Output is correct
13 Correct 11 ms 7552 KB Output is correct
14 Correct 10 ms 7552 KB Output is correct
15 Correct 10 ms 7552 KB Output is correct
16 Correct 10 ms 7552 KB Output is correct
17 Correct 10 ms 7552 KB Output is correct
18 Correct 10 ms 7552 KB Output is correct
19 Correct 10 ms 7424 KB Output is correct
20 Correct 10 ms 7552 KB Output is correct
21 Correct 10 ms 7552 KB Output is correct
22 Correct 10 ms 7552 KB Output is correct
23 Correct 10 ms 7552 KB Output is correct
24 Correct 10 ms 7552 KB Output is correct
25 Correct 9 ms 7424 KB Output is correct
26 Correct 9 ms 7424 KB Output is correct
27 Correct 9 ms 7424 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 132 ms 18552 KB Output is correct
2 Correct 153 ms 18936 KB Output is correct
3 Correct 138 ms 17912 KB Output is correct
4 Correct 120 ms 16632 KB Output is correct
5 Correct 120 ms 14980 KB Output is correct
6 Correct 104 ms 14328 KB Output is correct
7 Correct 110 ms 13796 KB Output is correct
8 Correct 96 ms 13432 KB Output is correct
9 Correct 101 ms 13176 KB Output is correct
10 Correct 94 ms 13176 KB Output is correct
11 Correct 91 ms 12792 KB Output is correct
12 Correct 85 ms 12792 KB Output is correct
13 Correct 83 ms 12920 KB Output is correct
14 Correct 108 ms 15352 KB Output is correct
15 Correct 150 ms 25764 KB Output is correct
16 Correct 140 ms 23036 KB Output is correct
17 Correct 139 ms 23796 KB Output is correct
18 Correct 151 ms 21624 KB Output is correct
19 Correct 135 ms 16612 KB Output is correct
20 Correct 126 ms 16632 KB Output is correct
21 Correct 124 ms 16632 KB Output is correct
22 Correct 111 ms 15608 KB Output is correct
23 Correct 92 ms 14584 KB Output is correct
24 Correct 118 ms 17424 KB Output is correct
25 Correct 99 ms 17528 KB Output is correct
26 Correct 106 ms 16756 KB Output is correct
27 Correct 101 ms 16632 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 7424 KB Output is correct
2 Correct 9 ms 7424 KB Output is correct
3 Correct 10 ms 7424 KB Output is correct
4 Correct 9 ms 7424 KB Output is correct
5 Correct 9 ms 7424 KB Output is correct
6 Correct 10 ms 7424 KB Output is correct
7 Correct 10 ms 7424 KB Output is correct
8 Correct 9 ms 7424 KB Output is correct
9 Correct 9 ms 7424 KB Output is correct
10 Correct 9 ms 7424 KB Output is correct
11 Correct 9 ms 7424 KB Output is correct
12 Correct 9 ms 7424 KB Output is correct
13 Correct 9 ms 7424 KB Output is correct
14 Correct 9 ms 7424 KB Output is correct
15 Correct 9 ms 7424 KB Output is correct
16 Correct 9 ms 7424 KB Output is correct
17 Correct 9 ms 7424 KB Output is correct
18 Correct 10 ms 7424 KB Output is correct
19 Correct 12 ms 7424 KB Output is correct
20 Correct 9 ms 7424 KB Output is correct
21 Correct 15 ms 7424 KB Output is correct
22 Correct 9 ms 7424 KB Output is correct
23 Correct 9 ms 7424 KB Output is correct
24 Correct 9 ms 7424 KB Output is correct
25 Correct 9 ms 7424 KB Output is correct
26 Correct 9 ms 7424 KB Output is correct
27 Correct 10 ms 7424 KB Output is correct
28 Correct 9 ms 7424 KB Output is correct
29 Correct 10 ms 7400 KB Output is correct
30 Correct 9 ms 7424 KB Output is correct
31 Correct 9 ms 7424 KB Output is correct
32 Correct 9 ms 7424 KB Output is correct
33 Correct 10 ms 7424 KB Output is correct
34 Correct 9 ms 7424 KB Output is correct
35 Correct 9 ms 7424 KB Output is correct
36 Correct 10 ms 7424 KB Output is correct
37 Correct 9 ms 7424 KB Output is correct
38 Correct 9 ms 7424 KB Output is correct
39 Correct 9 ms 7424 KB Output is correct
40 Correct 10 ms 7424 KB Output is correct
41 Correct 10 ms 7424 KB Output is correct
42 Correct 9 ms 7424 KB Output is correct
43 Correct 10 ms 7552 KB Output is correct
44 Correct 10 ms 7424 KB Output is correct
45 Correct 9 ms 7424 KB Output is correct
46 Correct 10 ms 7424 KB Output is correct
47 Correct 9 ms 7424 KB Output is correct
48 Correct 9 ms 7424 KB Output is correct
49 Correct 9 ms 7424 KB Output is correct
50 Correct 9 ms 7424 KB Output is correct
51 Correct 10 ms 7424 KB Output is correct
52 Correct 10 ms 7424 KB Output is correct
53 Correct 9 ms 7424 KB Output is correct
54 Correct 9 ms 7424 KB Output is correct
55 Correct 9 ms 7424 KB Output is correct
56 Correct 10 ms 7424 KB Output is correct
57 Correct 9 ms 7424 KB Output is correct
58 Correct 9 ms 7424 KB Output is correct
59 Correct 10 ms 7424 KB Output is correct
60 Correct 9 ms 7424 KB Output is correct
61 Correct 9 ms 7424 KB Output is correct
62 Correct 9 ms 7424 KB Output is correct
63 Correct 9 ms 7424 KB Output is correct
64 Correct 9 ms 7424 KB Output is correct
65 Correct 9 ms 7424 KB Output is correct
66 Correct 9 ms 7424 KB Output is correct
67 Correct 10 ms 7552 KB Output is correct
68 Correct 9 ms 7552 KB Output is correct
69 Correct 9 ms 7552 KB Output is correct
70 Correct 10 ms 7552 KB Output is correct
71 Correct 9 ms 7424 KB Output is correct
72 Correct 10 ms 7424 KB Output is correct
73 Correct 10 ms 7424 KB Output is correct
74 Correct 11 ms 7552 KB Output is correct
75 Correct 10 ms 7424 KB Output is correct
76 Correct 9 ms 7424 KB Output is correct
77 Correct 10 ms 7552 KB Output is correct
78 Correct 10 ms 7424 KB Output is correct
79 Correct 9 ms 7424 KB Output is correct
80 Correct 11 ms 7424 KB Output is correct
81 Correct 10 ms 7456 KB Output is correct
82 Correct 10 ms 7552 KB Output is correct
83 Correct 9 ms 7552 KB Output is correct
84 Correct 10 ms 7552 KB Output is correct
85 Correct 10 ms 7552 KB Output is correct
86 Correct 9 ms 7552 KB Output is correct
87 Correct 10 ms 7552 KB Output is correct
88 Correct 10 ms 7552 KB Output is correct
89 Correct 10 ms 7424 KB Output is correct
90 Correct 9 ms 7424 KB Output is correct
91 Correct 9 ms 7424 KB Output is correct
92 Correct 9 ms 7424 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 7424 KB Output is correct
2 Correct 9 ms 7424 KB Output is correct
3 Correct 10 ms 7424 KB Output is correct
4 Correct 9 ms 7424 KB Output is correct
5 Correct 9 ms 7424 KB Output is correct
6 Correct 10 ms 7424 KB Output is correct
7 Correct 10 ms 7424 KB Output is correct
8 Correct 9 ms 7424 KB Output is correct
9 Correct 9 ms 7424 KB Output is correct
10 Correct 9 ms 7424 KB Output is correct
11 Correct 9 ms 7424 KB Output is correct
12 Correct 9 ms 7424 KB Output is correct
13 Correct 9 ms 7424 KB Output is correct
14 Correct 9 ms 7424 KB Output is correct
15 Correct 9 ms 7424 KB Output is correct
16 Correct 9 ms 7424 KB Output is correct
17 Correct 9 ms 7424 KB Output is correct
18 Correct 10 ms 7424 KB Output is correct
19 Correct 12 ms 7424 KB Output is correct
20 Correct 9 ms 7424 KB Output is correct
21 Correct 15 ms 7424 KB Output is correct
22 Correct 9 ms 7424 KB Output is correct
23 Correct 9 ms 7424 KB Output is correct
24 Correct 9 ms 7424 KB Output is correct
25 Correct 9 ms 7424 KB Output is correct
26 Correct 9 ms 7424 KB Output is correct
27 Correct 10 ms 7424 KB Output is correct
28 Correct 9 ms 7424 KB Output is correct
29 Correct 10 ms 7400 KB Output is correct
30 Correct 9 ms 7424 KB Output is correct
31 Correct 9 ms 7424 KB Output is correct
32 Correct 9 ms 7424 KB Output is correct
33 Correct 10 ms 7424 KB Output is correct
34 Correct 9 ms 7424 KB Output is correct
35 Correct 9 ms 7424 KB Output is correct
36 Correct 10 ms 7424 KB Output is correct
37 Correct 9 ms 7424 KB Output is correct
38 Correct 9 ms 7424 KB Output is correct
39 Correct 9 ms 7424 KB Output is correct
40 Correct 10 ms 7424 KB Output is correct
41 Correct 10 ms 7424 KB Output is correct
42 Correct 9 ms 7424 KB Output is correct
43 Correct 10 ms 7552 KB Output is correct
44 Correct 10 ms 7424 KB Output is correct
45 Correct 9 ms 7424 KB Output is correct
46 Correct 10 ms 7424 KB Output is correct
47 Correct 9 ms 7424 KB Output is correct
48 Correct 9 ms 7424 KB Output is correct
49 Correct 9 ms 7424 KB Output is correct
50 Correct 9 ms 7424 KB Output is correct
51 Correct 10 ms 7424 KB Output is correct
52 Correct 10 ms 7424 KB Output is correct
53 Correct 9 ms 7424 KB Output is correct
54 Correct 9 ms 7424 KB Output is correct
55 Correct 9 ms 7424 KB Output is correct
56 Correct 10 ms 7424 KB Output is correct
57 Correct 9 ms 7424 KB Output is correct
58 Correct 9 ms 7424 KB Output is correct
59 Correct 10 ms 7424 KB Output is correct
60 Correct 9 ms 7424 KB Output is correct
61 Correct 9 ms 7424 KB Output is correct
62 Correct 9 ms 7424 KB Output is correct
63 Correct 9 ms 7424 KB Output is correct
64 Correct 9 ms 7424 KB Output is correct
65 Correct 9 ms 7424 KB Output is correct
66 Correct 115 ms 22264 KB Output is correct
67 Correct 97 ms 22256 KB Output is correct
68 Correct 126 ms 25848 KB Output is correct
69 Correct 133 ms 21872 KB Output is correct
70 Correct 111 ms 21436 KB Output is correct
71 Correct 125 ms 27380 KB Output is correct
72 Correct 125 ms 20600 KB Output is correct
73 Correct 136 ms 23672 KB Output is correct
74 Correct 111 ms 18680 KB Output is correct
75 Correct 110 ms 19244 KB Output is correct
76 Correct 85 ms 14712 KB Output is correct
77 Correct 87 ms 14520 KB Output is correct
78 Correct 79 ms 13952 KB Output is correct
79 Correct 69 ms 13944 KB Output is correct
80 Correct 54 ms 12796 KB Output is correct
81 Correct 56 ms 12792 KB Output is correct
82 Correct 14 ms 9344 KB Output is correct
83 Correct 13 ms 9344 KB Output is correct
84 Correct 14 ms 9344 KB Output is correct
85 Correct 14 ms 9344 KB Output is correct
86 Correct 13 ms 9344 KB Output is correct
87 Correct 14 ms 9344 KB Output is correct
88 Correct 10 ms 7552 KB Output is correct
89 Correct 10 ms 7552 KB Output is correct
90 Correct 10 ms 7552 KB Output is correct
91 Correct 10 ms 7808 KB Output is correct
92 Correct 10 ms 7680 KB Output is correct
93 Correct 10 ms 7552 KB Output is correct
94 Correct 10 ms 7680 KB Output is correct
95 Correct 9 ms 7552 KB Output is correct
96 Correct 10 ms 7552 KB Output is correct
97 Correct 10 ms 7552 KB Output is correct
98 Correct 10 ms 7552 KB Output is correct
99 Correct 10 ms 7552 KB Output is correct
100 Correct 9 ms 7552 KB Output is correct
101 Correct 10 ms 7552 KB Output is correct
102 Correct 10 ms 7552 KB Output is correct
103 Correct 9 ms 7424 KB Output is correct
104 Correct 9 ms 7552 KB Output is correct
105 Correct 9 ms 7552 KB Output is correct
106 Correct 10 ms 7552 KB Output is correct
107 Correct 10 ms 7552 KB Output is correct
108 Correct 126 ms 18424 KB Output is correct
109 Correct 116 ms 18552 KB Output is correct
110 Correct 146 ms 18552 KB Output is correct
111 Correct 131 ms 18552 KB Output is correct
112 Correct 114 ms 18552 KB Output is correct
113 Correct 173 ms 39412 KB Output is correct
114 Correct 132 ms 26356 KB Output is correct
115 Correct 139 ms 24456 KB Output is correct
116 Correct 132 ms 22520 KB Output is correct
117 Correct 139 ms 18512 KB Output is correct
118 Correct 114 ms 18552 KB Output is correct
119 Correct 111 ms 18552 KB Output is correct
120 Correct 113 ms 18552 KB Output is correct
121 Correct 112 ms 18040 KB Output is correct
122 Correct 98 ms 16888 KB Output is correct
123 Correct 56 ms 13816 KB Output is correct
124 Correct 73 ms 17132 KB Output is correct
125 Correct 64 ms 17136 KB Output is correct
126 Correct 79 ms 17388 KB Output is correct
127 Correct 73 ms 17144 KB Output is correct
128 Correct 10 ms 7552 KB Output is correct
129 Correct 9 ms 7552 KB Output is correct
130 Correct 12 ms 7552 KB Output is correct
131 Correct 10 ms 7552 KB Output is correct
132 Correct 10 ms 7424 KB Output is correct
133 Correct 10 ms 7424 KB Output is correct
134 Correct 11 ms 7552 KB Output is correct
135 Correct 9 ms 7424 KB Output is correct
136 Correct 10 ms 7424 KB Output is correct
137 Correct 9 ms 7552 KB Output is correct
138 Correct 10 ms 7424 KB Output is correct
139 Correct 10 ms 7552 KB Output is correct
140 Correct 11 ms 7552 KB Output is correct
141 Correct 10 ms 7552 KB Output is correct
142 Correct 10 ms 7552 KB Output is correct
143 Correct 10 ms 7552 KB Output is correct
144 Correct 10 ms 7552 KB Output is correct
145 Correct 10 ms 7552 KB Output is correct
146 Correct 10 ms 7424 KB Output is correct
147 Correct 10 ms 7552 KB Output is correct
148 Correct 10 ms 7552 KB Output is correct
149 Correct 10 ms 7552 KB Output is correct
150 Correct 10 ms 7552 KB Output is correct
151 Correct 10 ms 7552 KB Output is correct
152 Correct 9 ms 7424 KB Output is correct
153 Correct 9 ms 7424 KB Output is correct
154 Correct 9 ms 7424 KB Output is correct
155 Correct 132 ms 18552 KB Output is correct
156 Correct 153 ms 18936 KB Output is correct
157 Correct 138 ms 17912 KB Output is correct
158 Correct 120 ms 16632 KB Output is correct
159 Correct 120 ms 14980 KB Output is correct
160 Correct 104 ms 14328 KB Output is correct
161 Correct 110 ms 13796 KB Output is correct
162 Correct 96 ms 13432 KB Output is correct
163 Correct 101 ms 13176 KB Output is correct
164 Correct 94 ms 13176 KB Output is correct
165 Correct 91 ms 12792 KB Output is correct
166 Correct 85 ms 12792 KB Output is correct
167 Correct 83 ms 12920 KB Output is correct
168 Correct 108 ms 15352 KB Output is correct
169 Correct 150 ms 25764 KB Output is correct
170 Correct 140 ms 23036 KB Output is correct
171 Correct 139 ms 23796 KB Output is correct
172 Correct 151 ms 21624 KB Output is correct
173 Correct 135 ms 16612 KB Output is correct
174 Correct 126 ms 16632 KB Output is correct
175 Correct 124 ms 16632 KB Output is correct
176 Correct 111 ms 15608 KB Output is correct
177 Correct 92 ms 14584 KB Output is correct
178 Correct 118 ms 17424 KB Output is correct
179 Correct 99 ms 17528 KB Output is correct
180 Correct 106 ms 16756 KB Output is correct
181 Correct 101 ms 16632 KB Output is correct
182 Correct 9 ms 7424 KB Output is correct
183 Correct 10 ms 7552 KB Output is correct
184 Correct 9 ms 7552 KB Output is correct
185 Correct 9 ms 7552 KB Output is correct
186 Correct 10 ms 7552 KB Output is correct
187 Correct 9 ms 7424 KB Output is correct
188 Correct 10 ms 7424 KB Output is correct
189 Correct 10 ms 7424 KB Output is correct
190 Correct 11 ms 7552 KB Output is correct
191 Correct 10 ms 7424 KB Output is correct
192 Correct 9 ms 7424 KB Output is correct
193 Correct 10 ms 7552 KB Output is correct
194 Correct 10 ms 7424 KB Output is correct
195 Correct 9 ms 7424 KB Output is correct
196 Correct 11 ms 7424 KB Output is correct
197 Correct 10 ms 7456 KB Output is correct
198 Correct 10 ms 7552 KB Output is correct
199 Correct 9 ms 7552 KB Output is correct
200 Correct 10 ms 7552 KB Output is correct
201 Correct 10 ms 7552 KB Output is correct
202 Correct 9 ms 7552 KB Output is correct
203 Correct 10 ms 7552 KB Output is correct
204 Correct 10 ms 7552 KB Output is correct
205 Correct 10 ms 7424 KB Output is correct
206 Correct 9 ms 7424 KB Output is correct
207 Correct 9 ms 7424 KB Output is correct
208 Correct 9 ms 7424 KB Output is correct
209 Correct 13 ms 9344 KB Output is correct
210 Correct 57 ms 14072 KB Output is correct
211 Correct 110 ms 17076 KB Output is correct
212 Correct 119 ms 18428 KB Output is correct
213 Correct 143 ms 19312 KB Output is correct
214 Correct 61 ms 14104 KB Output is correct
215 Correct 62 ms 13320 KB Output is correct
216 Correct 111 ms 16248 KB Output is correct
217 Correct 111 ms 14712 KB Output is correct
218 Correct 89 ms 13048 KB Output is correct
219 Correct 106 ms 12664 KB Output is correct
220 Correct 82 ms 12408 KB Output is correct
221 Correct 76 ms 12280 KB Output is correct
222 Correct 83 ms 13688 KB Output is correct
223 Correct 120 ms 17912 KB Output is correct
224 Correct 120 ms 16864 KB Output is correct
225 Correct 108 ms 14328 KB Output is correct
226 Correct 109 ms 14332 KB Output is correct
227 Correct 110 ms 14328 KB Output is correct
228 Correct 112 ms 13944 KB Output is correct
229 Correct 83 ms 13048 KB Output is correct
230 Correct 96 ms 14072 KB Output is correct
231 Correct 95 ms 14200 KB Output is correct