Submission #439973

# Submission time Handle Problem Language Result Execution time Memory
439973 2021-07-01T10:19:48 Z cheeheng Fountain Parks (IOI21_parks) C++17
70 / 100
3500 ms 592556 KB
#include "parks.h"
#include <bits/stdc++.h>
using namespace std;

typedef pair<int, int> ii;
typedef tuple<int, int, int> iii;

const int dx[] = {-1,0,0,1};
const int dy[] = {0,1,-1,0};

vector<int> AdjList[200005];
ii EdgeList[800005];
ii EdgeList2[800005];
map<ii, int> indx;
map<ii, int> indxEdge;
map<ii, int> indxBench;

vector<int> AdjListBench[800005];
set<int> AdjListRoad[200005];
int degBench[800005];
ii benchXY[800005];

mt19937 rng(1);

struct Dinic{
    static const int MAX_E = 1000005;
    static const int MAX_V = 1000005;

    // Edge List
    ii EdgeList[MAX_E<<1];
    int flow[MAX_E<<1];
    int capacity[MAX_E<<1];

    vector<int> AdjList[MAX_V];
    int level[MAX_V];
    int ptr[MAX_V];

    int E = 0;

    int s, t;

    Dinic(int _s, int _t){
        s = _s;
        t = _t;
    }

    void add_edge(int u, int v, int c){
        EdgeList[E] = ii(u, v);
        EdgeList[E+1] = ii(v, u);
        flow[E] = 0;
        flow[E+1] = 0;
        capacity[E] = c;
        capacity[E+1] = 0;

        AdjList[u].push_back(E);
        AdjList[v].push_back(E+1);

        E += 2;
    }

    bool bfs(){
        memset(level, -1, sizeof(level));
        queue<int> q;
        level[s] = 0;
        q.push(s);
        while(!q.empty()){
            int u = q.front(); q.pop();
            for(int indx: AdjList[u]){
                int v = EdgeList[indx].second;
                if(level[v] == -1 && capacity[indx] > flow[indx]){
                    level[v] = level[u] + 1;
                    q.push(v);
                }
            }
        }
        return level[t] != -1;
    }

    int dfs(int u, int flowToSend){
        if(u == t){return flowToSend;}
        if(flowToSend == 0){return 0;}

        while(ptr[u] < (int)AdjList[u].size()){
            int indx = AdjList[u][ptr[u]];
            int v = EdgeList[indx].second;
            if(capacity[indx] > flow[indx] && level[v] == level[u] + 1){
                int nxtFlow = min(flowToSend, capacity[indx] - flow[indx]);
                int flowSent = dfs(v, nxtFlow);
                if(flowSent > 0){
                    flow[indx] += flowSent; // flow from u to v
                    flow[indx^1] -= flowSent; // flow from v to u
                    return flowSent;
                }
            }
            ptr[u] ++;
        }
        return 0;
    }

    int findMaxFlow(){
        int maxFlow = 0;
        while(1){
            if(!bfs()){return maxFlow;}

            memset(ptr, 0, sizeof(ptr));
            while(1){
                int temp = dfs(s, INT_MAX);
                maxFlow += temp;
                if(temp == 0){break;}
            }
        }
    }
};

struct UnionFind{
    vector<int> p;
    vector<int> rank1;
    void init(int n){
        p.assign(n, 0);
        rank1.assign(n, 0);
        for(int i = 0; i < n; i ++){
            p[i] = i;
            rank1[i] = 0;
        }
    }

    int findSet(int i){
        return (p[i] == i) ? i : (p[i] = findSet(p[i]));
    }

    bool isSameSet(int i, int j){
        return findSet(i) == findSet(j);
    }

    void unionSet(int i, int j){
        int x = findSet(i);
        int y = findSet(j);

        if(x != y){
            if(rank1[x] > rank1[y]){
                p[y] = x;
            }else{
                p[x] = y;
                if(rank1[x] == rank1[y]){
                    rank1[y] ++;
                }
            }
        }
    }
};

int p[200005];

int construct_roads(std::vector<int> x, std::vector<int> y) {
    int n = (int)x.size();
    if (n == 1) {
        build({}, {}, {}, {});
        return 1;
    }

    vector<int> U(n-1);
    vector<int> V(n-1);
    vector<int> A(n-1);
    vector<int> B(n-1);

    for(int i = 0; i < n; i ++){
        indx[ii(x[i], y[i])] = i;
    }

    int cnt3 = 0;
    for(pair<ii, int> temp: indx){
        p[cnt3 ++] = temp.second;
    }

    int m = 0;
    for(int i = 0; i < n; i ++){
        int i2 = p[i];
        for(int k = 0; k < 4; k ++){
            int nx = x[i2] + 2*dx[k];
            int ny = y[i2] + 2*dy[k];

            if(indx.find(ii(nx, ny)) != indx.end()){
                int j = indx[ii(nx, ny)];
                EdgeList[m ++] = ii(i2, j);
            }
        }
    }

    UnionFind* uf = new UnionFind();
    while(1){
        uf->init(n);

        int cnt = 0;
        for(int i = 0; i < m; i ++){
            int u, v;
            tie(u, v) = EdgeList[i];
            if(!uf->isSameSet(u, v)){
                uf->unionSet(u, v);
                AdjList[u].push_back(v);
                AdjList[v].push_back(u);
                EdgeList2[cnt] = ii(u, v);
                indxEdge[ii(u, v)] = cnt;
                cnt ++;
            }
        }

        if(cnt != n-1){
            return 0;
        }

        int benches = 0;
        memset(degBench, 0, sizeof(degBench));
        for(int i = 0; i < n-1; i ++){
            int u, v;
            tie(u, v) = EdgeList2[i];
            int x2 = (x[u] + x[v])/2;
            int y2 = (y[u] + y[v])/2;

            for(int k = 0; k < 4; k ++){
                int nx = x2 + dx[k];
                int ny = y2 + dy[k];
                if(nx%2 == 1 && ny%2 == 1){
                    int indx2 = benches;
                    if(indxBench.find(ii(nx, ny)) != indxBench.end()){
                        indx2 = indxBench[ii(nx, ny)];
                    }else{
                        benchXY[benches] = ii(nx, ny);
                        indxBench[ii(nx, ny)] = benches;
                        //printf("bench %d; (%d, %d)\n", benches, nx, ny);
                        benches ++;
                    }

                    AdjListBench[indx2].push_back(i);
                    AdjListRoad[i].insert(indx2);
                    //printf("road %d; bench %d\n", i, indx2);
                    degBench[i] ++;
                }
            }
        }

        int S = n+benches;
        int T = n+benches+1;
        Dinic* mf = new Dinic(S, T);

        for(int i = 0; i < n; i ++){
            mf->add_edge(S, i, 1);
        }

        for(int i = 0; i < benches; i ++){
            mf->add_edge(n+i, T, 1);
        }

        for(int i = 0; i < n; i ++){
            for(int j: AdjListRoad[i]){
                mf->add_edge(i, n+j, 1);
            }
        }

        int res = mf->findMaxFlow();
        //printf("res=%d\n", res);
        if(res != n-1){
            shuffle(EdgeList, EdgeList+m, rng);
            continue;
        }

        int cnt2 = 0;
        for(int i = 0; i < mf->E; i ++){
            int u, v;
            tie(u, v) = mf->EdgeList[i];
            //printf("u=%d v=%d\n", u, v);
            if(u >= n){continue;}

            if(mf->flow[i] > 0){
                tie(U[cnt2], V[cnt2]) = EdgeList2[u];
                tie(A[cnt2], B[cnt2]) = benchXY[v-n];
                cnt2 ++;
            }
        }

        if(cnt2 == n-1){
            build(U, V, A, B);
            return 1;
        }
        shuffle(EdgeList, EdgeList+m, rng);
    }
}
# Verdict Execution time Memory Grader output
1 Correct 24 ms 33192 KB Output is correct
2 Correct 43 ms 83328 KB Output is correct
3 Correct 20 ms 33100 KB Output is correct
4 Correct 45 ms 83268 KB Output is correct
5 Correct 49 ms 83236 KB Output is correct
6 Correct 22 ms 33212 KB Output is correct
7 Correct 22 ms 33188 KB Output is correct
8 Correct 22 ms 33092 KB Output is correct
9 Correct 515 ms 156852 KB Output is correct
10 Correct 80 ms 90852 KB Output is correct
11 Correct 242 ms 123136 KB Output is correct
12 Correct 90 ms 94624 KB Output is correct
13 Correct 88 ms 43044 KB Output is correct
14 Correct 25 ms 33356 KB Output is correct
15 Correct 24 ms 33612 KB Output is correct
16 Correct 533 ms 156976 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 33192 KB Output is correct
2 Correct 43 ms 83328 KB Output is correct
3 Correct 20 ms 33100 KB Output is correct
4 Correct 45 ms 83268 KB Output is correct
5 Correct 49 ms 83236 KB Output is correct
6 Correct 22 ms 33212 KB Output is correct
7 Correct 22 ms 33188 KB Output is correct
8 Correct 22 ms 33092 KB Output is correct
9 Correct 515 ms 156852 KB Output is correct
10 Correct 80 ms 90852 KB Output is correct
11 Correct 242 ms 123136 KB Output is correct
12 Correct 90 ms 94624 KB Output is correct
13 Correct 88 ms 43044 KB Output is correct
14 Correct 25 ms 33356 KB Output is correct
15 Correct 24 ms 33612 KB Output is correct
16 Correct 533 ms 156976 KB Output is correct
17 Correct 42 ms 83304 KB Output is correct
18 Correct 43 ms 83320 KB Output is correct
19 Correct 46 ms 83216 KB Output is correct
20 Correct 43 ms 83232 KB Output is correct
21 Correct 30 ms 33100 KB Output is correct
22 Correct 44 ms 83216 KB Output is correct
23 Correct 1121 ms 201540 KB Output is correct
24 Correct 68 ms 83268 KB Output is correct
25 Correct 48 ms 84012 KB Output is correct
26 Correct 26 ms 33800 KB Output is correct
27 Correct 24 ms 33988 KB Output is correct
28 Correct 360 ms 130660 KB Output is correct
29 Correct 641 ms 154240 KB Output is correct
30 Correct 836 ms 177852 KB Output is correct
31 Correct 1171 ms 201636 KB Output is correct
32 Correct 51 ms 83268 KB Output is correct
33 Correct 47 ms 83208 KB Output is correct
34 Correct 48 ms 83276 KB Output is correct
35 Correct 21 ms 33100 KB Output is correct
36 Correct 21 ms 33148 KB Output is correct
37 Correct 45 ms 83268 KB Output is correct
38 Correct 46 ms 83304 KB Output is correct
39 Correct 46 ms 83268 KB Output is correct
40 Correct 51 ms 83208 KB Output is correct
41 Correct 23 ms 33084 KB Output is correct
42 Correct 51 ms 83316 KB Output is correct
43 Correct 26 ms 33640 KB Output is correct
44 Correct 27 ms 33840 KB Output is correct
45 Correct 534 ms 147352 KB Output is correct
46 Correct 847 ms 176568 KB Output is correct
47 Correct 825 ms 176560 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 33192 KB Output is correct
2 Correct 43 ms 83328 KB Output is correct
3 Correct 20 ms 33100 KB Output is correct
4 Correct 45 ms 83268 KB Output is correct
5 Correct 49 ms 83236 KB Output is correct
6 Correct 22 ms 33212 KB Output is correct
7 Correct 22 ms 33188 KB Output is correct
8 Correct 22 ms 33092 KB Output is correct
9 Correct 515 ms 156852 KB Output is correct
10 Correct 80 ms 90852 KB Output is correct
11 Correct 242 ms 123136 KB Output is correct
12 Correct 90 ms 94624 KB Output is correct
13 Correct 88 ms 43044 KB Output is correct
14 Correct 25 ms 33356 KB Output is correct
15 Correct 24 ms 33612 KB Output is correct
16 Correct 533 ms 156976 KB Output is correct
17 Correct 42 ms 83304 KB Output is correct
18 Correct 43 ms 83320 KB Output is correct
19 Correct 46 ms 83216 KB Output is correct
20 Correct 43 ms 83232 KB Output is correct
21 Correct 30 ms 33100 KB Output is correct
22 Correct 44 ms 83216 KB Output is correct
23 Correct 1121 ms 201540 KB Output is correct
24 Correct 68 ms 83268 KB Output is correct
25 Correct 48 ms 84012 KB Output is correct
26 Correct 26 ms 33800 KB Output is correct
27 Correct 24 ms 33988 KB Output is correct
28 Correct 360 ms 130660 KB Output is correct
29 Correct 641 ms 154240 KB Output is correct
30 Correct 836 ms 177852 KB Output is correct
31 Correct 1171 ms 201636 KB Output is correct
32 Correct 51 ms 83268 KB Output is correct
33 Correct 47 ms 83208 KB Output is correct
34 Correct 48 ms 83276 KB Output is correct
35 Correct 21 ms 33100 KB Output is correct
36 Correct 21 ms 33148 KB Output is correct
37 Correct 45 ms 83268 KB Output is correct
38 Correct 46 ms 83304 KB Output is correct
39 Correct 46 ms 83268 KB Output is correct
40 Correct 51 ms 83208 KB Output is correct
41 Correct 23 ms 33084 KB Output is correct
42 Correct 51 ms 83316 KB Output is correct
43 Correct 26 ms 33640 KB Output is correct
44 Correct 27 ms 33840 KB Output is correct
45 Correct 534 ms 147352 KB Output is correct
46 Correct 847 ms 176568 KB Output is correct
47 Correct 825 ms 176560 KB Output is correct
48 Correct 71 ms 83252 KB Output is correct
49 Correct 47 ms 83280 KB Output is correct
50 Correct 44 ms 83192 KB Output is correct
51 Correct 42 ms 83256 KB Output is correct
52 Correct 44 ms 83268 KB Output is correct
53 Correct 41 ms 83196 KB Output is correct
54 Correct 40 ms 83296 KB Output is correct
55 Correct 1305 ms 202128 KB Output is correct
56 Correct 51 ms 83268 KB Output is correct
57 Correct 58 ms 84324 KB Output is correct
58 Correct 69 ms 86960 KB Output is correct
59 Correct 40 ms 35420 KB Output is correct
60 Correct 560 ms 145528 KB Output is correct
61 Correct 855 ms 163904 KB Output is correct
62 Correct 944 ms 181352 KB Output is correct
63 Correct 1135 ms 202084 KB Output is correct
64 Correct 19 ms 33200 KB Output is correct
65 Correct 46 ms 83244 KB Output is correct
66 Correct 20 ms 33100 KB Output is correct
67 Correct 1225 ms 230436 KB Output is correct
68 Correct 1141 ms 230484 KB Output is correct
69 Correct 1147 ms 229796 KB Output is correct
70 Correct 32 ms 33996 KB Output is correct
71 Correct 35 ms 34904 KB Output is correct
72 Correct 581 ms 146604 KB Output is correct
73 Correct 943 ms 178596 KB Output is correct
74 Correct 1095 ms 210088 KB Output is correct
75 Correct 1155 ms 212820 KB Output is correct
76 Correct 1092 ms 230588 KB Output is correct
77 Correct 27 ms 34252 KB Output is correct
78 Correct 33 ms 35140 KB Output is correct
79 Correct 477 ms 146612 KB Output is correct
80 Correct 898 ms 178636 KB Output is correct
81 Correct 1120 ms 210140 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 33192 KB Output is correct
2 Correct 43 ms 83328 KB Output is correct
3 Correct 20 ms 33100 KB Output is correct
4 Correct 45 ms 83268 KB Output is correct
5 Correct 49 ms 83236 KB Output is correct
6 Correct 22 ms 33212 KB Output is correct
7 Correct 22 ms 33188 KB Output is correct
8 Correct 22 ms 33092 KB Output is correct
9 Correct 515 ms 156852 KB Output is correct
10 Correct 80 ms 90852 KB Output is correct
11 Correct 242 ms 123136 KB Output is correct
12 Correct 90 ms 94624 KB Output is correct
13 Correct 88 ms 43044 KB Output is correct
14 Correct 25 ms 33356 KB Output is correct
15 Correct 24 ms 33612 KB Output is correct
16 Correct 533 ms 156976 KB Output is correct
17 Correct 41 ms 83196 KB Output is correct
18 Correct 49 ms 83244 KB Output is correct
19 Correct 24 ms 33160 KB Output is correct
20 Correct 1006 ms 200128 KB Output is correct
21 Correct 1088 ms 200028 KB Output is correct
22 Correct 1077 ms 199960 KB Output is correct
23 Correct 951 ms 208600 KB Output is correct
24 Correct 319 ms 54344 KB Output is correct
25 Correct 761 ms 77788 KB Output is correct
26 Correct 681 ms 77680 KB Output is correct
27 Correct 1091 ms 230420 KB Output is correct
28 Correct 1126 ms 230528 KB Output is correct
29 Correct 1156 ms 230364 KB Output is correct
30 Correct 1220 ms 230356 KB Output is correct
31 Correct 43 ms 83216 KB Output is correct
32 Correct 96 ms 92484 KB Output is correct
33 Correct 176 ms 43704 KB Output is correct
34 Correct 1067 ms 199996 KB Output is correct
35 Correct 39 ms 35372 KB Output is correct
36 Correct 119 ms 44276 KB Output is correct
37 Correct 277 ms 55480 KB Output is correct
38 Correct 459 ms 132668 KB Output is correct
39 Correct 608 ms 151292 KB Output is correct
40 Correct 865 ms 169704 KB Output is correct
41 Correct 1109 ms 187688 KB Output is correct
42 Correct 1210 ms 206840 KB Output is correct
43 Correct 50 ms 83320 KB Output is correct
44 Correct 50 ms 83308 KB Output is correct
45 Correct 52 ms 83232 KB Output is correct
46 Correct 26 ms 33100 KB Output is correct
47 Correct 25 ms 33100 KB Output is correct
48 Correct 49 ms 83292 KB Output is correct
49 Correct 52 ms 83304 KB Output is correct
50 Correct 50 ms 83280 KB Output is correct
51 Correct 52 ms 83276 KB Output is correct
52 Correct 24 ms 33100 KB Output is correct
53 Correct 48 ms 83316 KB Output is correct
54 Correct 27 ms 33576 KB Output is correct
55 Correct 28 ms 33844 KB Output is correct
56 Correct 506 ms 147472 KB Output is correct
57 Correct 813 ms 176712 KB Output is correct
58 Correct 765 ms 176584 KB Output is correct
59 Correct 23 ms 33100 KB Output is correct
60 Correct 47 ms 83268 KB Output is correct
61 Correct 25 ms 33168 KB Output is correct
62 Correct 1126 ms 230532 KB Output is correct
63 Correct 1195 ms 230540 KB Output is correct
64 Correct 1189 ms 229832 KB Output is correct
65 Correct 27 ms 33996 KB Output is correct
66 Correct 33 ms 34892 KB Output is correct
67 Correct 543 ms 146708 KB Output is correct
68 Correct 868 ms 178524 KB Output is correct
69 Correct 1101 ms 210088 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 33192 KB Output is correct
2 Correct 43 ms 83328 KB Output is correct
3 Correct 20 ms 33100 KB Output is correct
4 Correct 45 ms 83268 KB Output is correct
5 Correct 49 ms 83236 KB Output is correct
6 Correct 22 ms 33212 KB Output is correct
7 Correct 22 ms 33188 KB Output is correct
8 Correct 22 ms 33092 KB Output is correct
9 Correct 515 ms 156852 KB Output is correct
10 Correct 80 ms 90852 KB Output is correct
11 Correct 242 ms 123136 KB Output is correct
12 Correct 90 ms 94624 KB Output is correct
13 Correct 88 ms 43044 KB Output is correct
14 Correct 25 ms 33356 KB Output is correct
15 Correct 24 ms 33612 KB Output is correct
16 Correct 533 ms 156976 KB Output is correct
17 Correct 1127 ms 230436 KB Output is correct
18 Correct 1154 ms 230632 KB Output is correct
19 Correct 1130 ms 199968 KB Output is correct
20 Correct 1010 ms 209080 KB Output is correct
21 Correct 894 ms 206844 KB Output is correct
22 Correct 48 ms 83244 KB Output is correct
23 Correct 170 ms 103744 KB Output is correct
24 Correct 57 ms 37700 KB Output is correct
25 Correct 185 ms 49092 KB Output is correct
26 Correct 338 ms 60272 KB Output is correct
27 Correct 498 ms 146516 KB Output is correct
28 Correct 669 ms 162476 KB Output is correct
29 Correct 840 ms 178304 KB Output is correct
30 Correct 998 ms 193892 KB Output is correct
31 Correct 1207 ms 209768 KB Output is correct
32 Correct 1201 ms 213016 KB Output is correct
33 Correct 1176 ms 230596 KB Output is correct
34 Correct 29 ms 34204 KB Output is correct
35 Correct 39 ms 35164 KB Output is correct
36 Correct 477 ms 146688 KB Output is correct
37 Correct 934 ms 178740 KB Output is correct
38 Correct 1115 ms 210228 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 33192 KB Output is correct
2 Correct 43 ms 83328 KB Output is correct
3 Correct 20 ms 33100 KB Output is correct
4 Correct 45 ms 83268 KB Output is correct
5 Correct 49 ms 83236 KB Output is correct
6 Correct 22 ms 33212 KB Output is correct
7 Correct 22 ms 33188 KB Output is correct
8 Correct 22 ms 33092 KB Output is correct
9 Correct 515 ms 156852 KB Output is correct
10 Correct 80 ms 90852 KB Output is correct
11 Correct 242 ms 123136 KB Output is correct
12 Correct 90 ms 94624 KB Output is correct
13 Correct 88 ms 43044 KB Output is correct
14 Correct 25 ms 33356 KB Output is correct
15 Correct 24 ms 33612 KB Output is correct
16 Correct 533 ms 156976 KB Output is correct
17 Correct 42 ms 83304 KB Output is correct
18 Correct 43 ms 83320 KB Output is correct
19 Correct 46 ms 83216 KB Output is correct
20 Correct 43 ms 83232 KB Output is correct
21 Correct 30 ms 33100 KB Output is correct
22 Correct 44 ms 83216 KB Output is correct
23 Correct 1121 ms 201540 KB Output is correct
24 Correct 68 ms 83268 KB Output is correct
25 Correct 48 ms 84012 KB Output is correct
26 Correct 26 ms 33800 KB Output is correct
27 Correct 24 ms 33988 KB Output is correct
28 Correct 360 ms 130660 KB Output is correct
29 Correct 641 ms 154240 KB Output is correct
30 Correct 836 ms 177852 KB Output is correct
31 Correct 1171 ms 201636 KB Output is correct
32 Correct 51 ms 83268 KB Output is correct
33 Correct 47 ms 83208 KB Output is correct
34 Correct 48 ms 83276 KB Output is correct
35 Correct 21 ms 33100 KB Output is correct
36 Correct 21 ms 33148 KB Output is correct
37 Correct 45 ms 83268 KB Output is correct
38 Correct 46 ms 83304 KB Output is correct
39 Correct 46 ms 83268 KB Output is correct
40 Correct 51 ms 83208 KB Output is correct
41 Correct 23 ms 33084 KB Output is correct
42 Correct 51 ms 83316 KB Output is correct
43 Correct 26 ms 33640 KB Output is correct
44 Correct 27 ms 33840 KB Output is correct
45 Correct 534 ms 147352 KB Output is correct
46 Correct 847 ms 176568 KB Output is correct
47 Correct 825 ms 176560 KB Output is correct
48 Correct 71 ms 83252 KB Output is correct
49 Correct 47 ms 83280 KB Output is correct
50 Correct 44 ms 83192 KB Output is correct
51 Correct 42 ms 83256 KB Output is correct
52 Correct 44 ms 83268 KB Output is correct
53 Correct 41 ms 83196 KB Output is correct
54 Correct 40 ms 83296 KB Output is correct
55 Correct 1305 ms 202128 KB Output is correct
56 Correct 51 ms 83268 KB Output is correct
57 Correct 58 ms 84324 KB Output is correct
58 Correct 69 ms 86960 KB Output is correct
59 Correct 40 ms 35420 KB Output is correct
60 Correct 560 ms 145528 KB Output is correct
61 Correct 855 ms 163904 KB Output is correct
62 Correct 944 ms 181352 KB Output is correct
63 Correct 1135 ms 202084 KB Output is correct
64 Correct 19 ms 33200 KB Output is correct
65 Correct 46 ms 83244 KB Output is correct
66 Correct 20 ms 33100 KB Output is correct
67 Correct 1225 ms 230436 KB Output is correct
68 Correct 1141 ms 230484 KB Output is correct
69 Correct 1147 ms 229796 KB Output is correct
70 Correct 32 ms 33996 KB Output is correct
71 Correct 35 ms 34904 KB Output is correct
72 Correct 581 ms 146604 KB Output is correct
73 Correct 943 ms 178596 KB Output is correct
74 Correct 1095 ms 210088 KB Output is correct
75 Correct 1155 ms 212820 KB Output is correct
76 Correct 1092 ms 230588 KB Output is correct
77 Correct 27 ms 34252 KB Output is correct
78 Correct 33 ms 35140 KB Output is correct
79 Correct 477 ms 146612 KB Output is correct
80 Correct 898 ms 178636 KB Output is correct
81 Correct 1120 ms 210140 KB Output is correct
82 Correct 41 ms 83196 KB Output is correct
83 Correct 49 ms 83244 KB Output is correct
84 Correct 24 ms 33160 KB Output is correct
85 Correct 1006 ms 200128 KB Output is correct
86 Correct 1088 ms 200028 KB Output is correct
87 Correct 1077 ms 199960 KB Output is correct
88 Correct 951 ms 208600 KB Output is correct
89 Correct 319 ms 54344 KB Output is correct
90 Correct 761 ms 77788 KB Output is correct
91 Correct 681 ms 77680 KB Output is correct
92 Correct 1091 ms 230420 KB Output is correct
93 Correct 1126 ms 230528 KB Output is correct
94 Correct 1156 ms 230364 KB Output is correct
95 Correct 1220 ms 230356 KB Output is correct
96 Correct 43 ms 83216 KB Output is correct
97 Correct 96 ms 92484 KB Output is correct
98 Correct 176 ms 43704 KB Output is correct
99 Correct 1067 ms 199996 KB Output is correct
100 Correct 39 ms 35372 KB Output is correct
101 Correct 119 ms 44276 KB Output is correct
102 Correct 277 ms 55480 KB Output is correct
103 Correct 459 ms 132668 KB Output is correct
104 Correct 608 ms 151292 KB Output is correct
105 Correct 865 ms 169704 KB Output is correct
106 Correct 1109 ms 187688 KB Output is correct
107 Correct 1210 ms 206840 KB Output is correct
108 Correct 50 ms 83320 KB Output is correct
109 Correct 50 ms 83308 KB Output is correct
110 Correct 52 ms 83232 KB Output is correct
111 Correct 26 ms 33100 KB Output is correct
112 Correct 25 ms 33100 KB Output is correct
113 Correct 49 ms 83292 KB Output is correct
114 Correct 52 ms 83304 KB Output is correct
115 Correct 50 ms 83280 KB Output is correct
116 Correct 52 ms 83276 KB Output is correct
117 Correct 24 ms 33100 KB Output is correct
118 Correct 48 ms 83316 KB Output is correct
119 Correct 27 ms 33576 KB Output is correct
120 Correct 28 ms 33844 KB Output is correct
121 Correct 506 ms 147472 KB Output is correct
122 Correct 813 ms 176712 KB Output is correct
123 Correct 765 ms 176584 KB Output is correct
124 Correct 23 ms 33100 KB Output is correct
125 Correct 47 ms 83268 KB Output is correct
126 Correct 25 ms 33168 KB Output is correct
127 Correct 1126 ms 230532 KB Output is correct
128 Correct 1195 ms 230540 KB Output is correct
129 Correct 1189 ms 229832 KB Output is correct
130 Correct 27 ms 33996 KB Output is correct
131 Correct 33 ms 34892 KB Output is correct
132 Correct 543 ms 146708 KB Output is correct
133 Correct 868 ms 178524 KB Output is correct
134 Correct 1101 ms 210088 KB Output is correct
135 Correct 1127 ms 230436 KB Output is correct
136 Correct 1154 ms 230632 KB Output is correct
137 Correct 1130 ms 199968 KB Output is correct
138 Correct 1010 ms 209080 KB Output is correct
139 Correct 894 ms 206844 KB Output is correct
140 Correct 48 ms 83244 KB Output is correct
141 Correct 170 ms 103744 KB Output is correct
142 Correct 57 ms 37700 KB Output is correct
143 Correct 185 ms 49092 KB Output is correct
144 Correct 338 ms 60272 KB Output is correct
145 Correct 498 ms 146516 KB Output is correct
146 Correct 669 ms 162476 KB Output is correct
147 Correct 840 ms 178304 KB Output is correct
148 Correct 998 ms 193892 KB Output is correct
149 Correct 1207 ms 209768 KB Output is correct
150 Correct 1201 ms 213016 KB Output is correct
151 Correct 1176 ms 230596 KB Output is correct
152 Correct 29 ms 34204 KB Output is correct
153 Correct 39 ms 35164 KB Output is correct
154 Correct 477 ms 146688 KB Output is correct
155 Correct 934 ms 178740 KB Output is correct
156 Correct 1115 ms 210228 KB Output is correct
157 Correct 44 ms 83268 KB Output is correct
158 Correct 21 ms 33100 KB Output is correct
159 Correct 54 ms 83324 KB Output is correct
160 Correct 50 ms 83260 KB Output is correct
161 Correct 1056 ms 203192 KB Output is correct
162 Correct 1090 ms 200048 KB Output is correct
163 Correct 1030 ms 201292 KB Output is correct
164 Correct 1012 ms 201144 KB Output is correct
165 Correct 1157 ms 203212 KB Output is correct
166 Correct 1202 ms 203000 KB Output is correct
167 Execution timed out 3588 ms 592556 KB Time limit exceeded
168 Halted 0 ms 0 KB -