Submission #828848

# Submission time Handle Problem Language Result Execution time Memory
828848 2023-08-17T17:34:12 Z fatemetmhr Fountain Parks (IOI21_parks) C++17
70 / 100
445 ms 91128 KB
// Be Name Khoda //

//#pragma GCC optimize ("O3")
//#pragma GCC target("avx2")
//#pragma GCC optimize("unroll-loops,O3")

#include "parks.h"
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define debug(x)  cerr << "(" << (#x) << "): " << (x) << endl;
#define all(x)    x.begin(), x.end()
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define fi        first
#define se        second
#define pb        push_back
#define mp        make_pair

const int maxn5 = 1e6 + 10;


int n, q[maxn5], cnt[maxn5];
bool mark[maxn5];
vector <int> ret[2], ed[2], edg[maxn5];
vector <pair<int, int>> ver;
pair<pair <int, int>, pair<int, int>> adj[maxn5];
map <pair<int, int>, int> av;

void dfs(int v, int x, int y){
    av.erase(mp(x, y));
    if(av.find(mp(x - 2, y)) != av.end()){
        int u = av[mp(x - 2, y)];
        ed[0].pb(v);
        ed[1].pb(u);
        dfs(u, x - 2, y);
    }
    if(av.find(mp(x + 2, y)) != av.end()){
        int u = av[mp(x + 2, y)];
        ed[0].pb(v);
        ed[1].pb(u);
        dfs(u, x + 2, y);
    }
    if(av.find(mp(x, y - 2)) != av.end()){
        int u = av[mp(x, y - 2)];
        ed[0].pb(v);
        ed[1].pb(u);
        dfs(u, x, y - 2);
    }
    if(av.find(mp(x, y + 2)) != av.end()){
        int u = av[mp(x, y + 2)];
        ed[0].pb(v);
        ed[1].pb(u);
        dfs(u, x, y + 2);
    }
}

void dfs2(int v){
    mark[v] = true;
    for(auto u : edg[v]) if(!mark[u]){
        mark[u] = true;
        //debug(v);
        //debug(u);
        ret[0][v] = ver[u - (n - 1)].fi;
        ret[1][v] = ver[u - (n - 1)].se;
        for(auto z : edg[u]) if(!mark[z])
            dfs2(z);
        return;
    }
}


int construct_roads(std::vector<int> x, std::vector<int> y) {
    n = x.size();
    for(int i = 0; i < n; i++)
        av[mp(x[i], y[i])] = i;
    dfs(0, x[0], y[0]);
    if(av.size())
        return 0;

    for(int i = 0; i < n - 1; i++){
        if(x[ed[0][i]] == x[ed[1][i]]){
            adj[i].fi = mp(x[ed[0][i]] - 1, (y[ed[0][i]] + y[ed[1][i]]) / 2);
            adj[i].se = mp(x[ed[0][i]] + 1, (y[ed[0][i]] + y[ed[1][i]]) / 2);
        }
        else{
            adj[i].fi = mp((x[ed[0][i]] + x[ed[1][i]]) / 2, y[ed[0][i]] - 1);
            adj[i].se = mp((x[ed[0][i]] + x[ed[1][i]]) / 2, y[ed[0][i]] + 1);
        }
        ver.pb(adj[i].fi);
        ver.pb(adj[i].se);
    }

    sort(all(ver));
    ver.resize(unique(all(ver)) - ver.begin());
    for(int i = 0; i < n - 1; i++){
        int pt = lower_bound(all(ver), adj[i].fi) - ver.begin();
        edg[i].pb(pt + n - 1);
        pt = lower_bound(all(ver), adj[i].se) - ver.begin();
        edg[i].pb(pt + n - 1);
        edg[edg[i][0]].pb(i);
        edg[edg[i][1]].pb(i);
        cnt[edg[i][0]]++;
        cnt[edg[i][1]]++;
    }
    /*
    for(int i = 0; i < int(ver.size()) + n - 1; i++){
        //debug(i);
        for(auto u : edg[i])
            cout << u << ' ';
        cout << endl;
    }
    //*/
    int l = 0, r = 0;
    for(int i = 0; i < int(ver.size()); i++) if(edg[i + n - 1].size() == 1){
        q[r++] = i + n - 1;
        mark[i + n - 1] = true;
    }
    ret[0].resize(n - 1);
    ret[1].resize(n - 1);
    //debug(r);
    while(l < r){
        int v = q[l++];
        for(auto u : edg[v]) if(!mark[u]){
            mark[u] = true;
            for(auto z : edg[u]){
                cnt[z]--;
                if(!mark[z] && cnt[z] == 1){
                    q[r++] = z;
                    mark[z] = true;
                }
            }
            ret[0][u] = ver[v - (n - 1)].fi;
            ret[1][u] = ver[v - (n - 1)].se;
        }
    }
    for(int i = 0; i < int(ver.size()); i++)
        if(cnt[i + n - 1] > 2)
            return 0;
    //return 0;
    //cout << ed[0].size() << ' ' << ed[1].size() << ' ' << ret[0].size() << ' ' << ret[1].size() << endl;
    for(int i = 0; i < n - 1; i++) if(!mark[i])
        dfs2(i);
    build(ed[0], ed[1], ret[0], ret[1]);
    return 1;
}


















# Verdict Execution time Memory Grader output
1 Correct 14 ms 23764 KB Output is correct
2 Correct 12 ms 23764 KB Output is correct
3 Correct 15 ms 23716 KB Output is correct
4 Correct 12 ms 23724 KB Output is correct
5 Correct 12 ms 23764 KB Output is correct
6 Correct 16 ms 23764 KB Output is correct
7 Correct 12 ms 23764 KB Output is correct
8 Correct 12 ms 23680 KB Output is correct
9 Correct 136 ms 56416 KB Output is correct
10 Correct 22 ms 27320 KB Output is correct
11 Correct 78 ms 41892 KB Output is correct
12 Correct 28 ms 28972 KB Output is correct
13 Correct 35 ms 30952 KB Output is correct
14 Correct 12 ms 23800 KB Output is correct
15 Correct 12 ms 23892 KB Output is correct
16 Correct 135 ms 50896 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 14 ms 23764 KB Output is correct
2 Correct 12 ms 23764 KB Output is correct
3 Correct 15 ms 23716 KB Output is correct
4 Correct 12 ms 23724 KB Output is correct
5 Correct 12 ms 23764 KB Output is correct
6 Correct 16 ms 23764 KB Output is correct
7 Correct 12 ms 23764 KB Output is correct
8 Correct 12 ms 23680 KB Output is correct
9 Correct 136 ms 56416 KB Output is correct
10 Correct 22 ms 27320 KB Output is correct
11 Correct 78 ms 41892 KB Output is correct
12 Correct 28 ms 28972 KB Output is correct
13 Correct 35 ms 30952 KB Output is correct
14 Correct 12 ms 23800 KB Output is correct
15 Correct 12 ms 23892 KB Output is correct
16 Correct 135 ms 50896 KB Output is correct
17 Correct 11 ms 23764 KB Output is correct
18 Correct 12 ms 23768 KB Output is correct
19 Correct 11 ms 23764 KB Output is correct
20 Correct 12 ms 23764 KB Output is correct
21 Correct 12 ms 23764 KB Output is correct
22 Correct 11 ms 23756 KB Output is correct
23 Correct 294 ms 80228 KB Output is correct
24 Correct 12 ms 23764 KB Output is correct
25 Correct 13 ms 24132 KB Output is correct
26 Correct 13 ms 24148 KB Output is correct
27 Correct 14 ms 24112 KB Output is correct
28 Correct 112 ms 47112 KB Output is correct
29 Correct 173 ms 55556 KB Output is correct
30 Correct 225 ms 69108 KB Output is correct
31 Correct 295 ms 78052 KB Output is correct
32 Correct 11 ms 23696 KB Output is correct
33 Correct 12 ms 23712 KB Output is correct
34 Correct 12 ms 23764 KB Output is correct
35 Correct 12 ms 23764 KB Output is correct
36 Correct 14 ms 23712 KB Output is correct
37 Correct 11 ms 23764 KB Output is correct
38 Correct 12 ms 23764 KB Output is correct
39 Correct 12 ms 23728 KB Output is correct
40 Correct 12 ms 23892 KB Output is correct
41 Correct 12 ms 23748 KB Output is correct
42 Correct 12 ms 23764 KB Output is correct
43 Correct 12 ms 24056 KB Output is correct
44 Correct 13 ms 24020 KB Output is correct
45 Correct 143 ms 49708 KB Output is correct
46 Correct 221 ms 62184 KB Output is correct
47 Correct 230 ms 61336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 14 ms 23764 KB Output is correct
2 Correct 12 ms 23764 KB Output is correct
3 Correct 15 ms 23716 KB Output is correct
4 Correct 12 ms 23724 KB Output is correct
5 Correct 12 ms 23764 KB Output is correct
6 Correct 16 ms 23764 KB Output is correct
7 Correct 12 ms 23764 KB Output is correct
8 Correct 12 ms 23680 KB Output is correct
9 Correct 136 ms 56416 KB Output is correct
10 Correct 22 ms 27320 KB Output is correct
11 Correct 78 ms 41892 KB Output is correct
12 Correct 28 ms 28972 KB Output is correct
13 Correct 35 ms 30952 KB Output is correct
14 Correct 12 ms 23800 KB Output is correct
15 Correct 12 ms 23892 KB Output is correct
16 Correct 135 ms 50896 KB Output is correct
17 Correct 11 ms 23764 KB Output is correct
18 Correct 12 ms 23768 KB Output is correct
19 Correct 11 ms 23764 KB Output is correct
20 Correct 12 ms 23764 KB Output is correct
21 Correct 12 ms 23764 KB Output is correct
22 Correct 11 ms 23756 KB Output is correct
23 Correct 294 ms 80228 KB Output is correct
24 Correct 12 ms 23764 KB Output is correct
25 Correct 13 ms 24132 KB Output is correct
26 Correct 13 ms 24148 KB Output is correct
27 Correct 14 ms 24112 KB Output is correct
28 Correct 112 ms 47112 KB Output is correct
29 Correct 173 ms 55556 KB Output is correct
30 Correct 225 ms 69108 KB Output is correct
31 Correct 295 ms 78052 KB Output is correct
32 Correct 11 ms 23696 KB Output is correct
33 Correct 12 ms 23712 KB Output is correct
34 Correct 12 ms 23764 KB Output is correct
35 Correct 12 ms 23764 KB Output is correct
36 Correct 14 ms 23712 KB Output is correct
37 Correct 11 ms 23764 KB Output is correct
38 Correct 12 ms 23764 KB Output is correct
39 Correct 12 ms 23728 KB Output is correct
40 Correct 12 ms 23892 KB Output is correct
41 Correct 12 ms 23748 KB Output is correct
42 Correct 12 ms 23764 KB Output is correct
43 Correct 12 ms 24056 KB Output is correct
44 Correct 13 ms 24020 KB Output is correct
45 Correct 143 ms 49708 KB Output is correct
46 Correct 221 ms 62184 KB Output is correct
47 Correct 230 ms 61336 KB Output is correct
48 Correct 12 ms 23764 KB Output is correct
49 Correct 12 ms 23764 KB Output is correct
50 Correct 12 ms 23784 KB Output is correct
51 Correct 12 ms 23764 KB Output is correct
52 Correct 14 ms 23800 KB Output is correct
53 Correct 12 ms 23716 KB Output is correct
54 Correct 11 ms 23764 KB Output is correct
55 Correct 297 ms 75884 KB Output is correct
56 Correct 12 ms 23816 KB Output is correct
57 Correct 14 ms 24276 KB Output is correct
58 Correct 19 ms 25620 KB Output is correct
59 Correct 18 ms 24788 KB Output is correct
60 Correct 147 ms 52296 KB Output is correct
61 Correct 193 ms 61524 KB Output is correct
62 Correct 266 ms 68320 KB Output is correct
63 Correct 310 ms 74960 KB Output is correct
64 Correct 11 ms 23764 KB Output is correct
65 Correct 12 ms 23752 KB Output is correct
66 Correct 12 ms 23764 KB Output is correct
67 Correct 281 ms 83836 KB Output is correct
68 Correct 281 ms 83256 KB Output is correct
69 Correct 281 ms 86812 KB Output is correct
70 Correct 13 ms 24148 KB Output is correct
71 Correct 15 ms 24464 KB Output is correct
72 Correct 153 ms 46328 KB Output is correct
73 Correct 242 ms 60216 KB Output is correct
74 Correct 336 ms 69304 KB Output is correct
75 Correct 308 ms 80696 KB Output is correct
76 Correct 300 ms 91080 KB Output is correct
77 Correct 14 ms 24404 KB Output is correct
78 Correct 15 ms 24760 KB Output is correct
79 Correct 154 ms 48324 KB Output is correct
80 Correct 272 ms 61408 KB Output is correct
81 Correct 362 ms 74352 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 14 ms 23764 KB Output is correct
2 Correct 12 ms 23764 KB Output is correct
3 Correct 15 ms 23716 KB Output is correct
4 Correct 12 ms 23724 KB Output is correct
5 Correct 12 ms 23764 KB Output is correct
6 Correct 16 ms 23764 KB Output is correct
7 Correct 12 ms 23764 KB Output is correct
8 Correct 12 ms 23680 KB Output is correct
9 Correct 136 ms 56416 KB Output is correct
10 Correct 22 ms 27320 KB Output is correct
11 Correct 78 ms 41892 KB Output is correct
12 Correct 28 ms 28972 KB Output is correct
13 Correct 35 ms 30952 KB Output is correct
14 Correct 12 ms 23800 KB Output is correct
15 Correct 12 ms 23892 KB Output is correct
16 Correct 135 ms 50896 KB Output is correct
17 Correct 10 ms 23764 KB Output is correct
18 Correct 11 ms 23808 KB Output is correct
19 Correct 11 ms 23764 KB Output is correct
20 Correct 292 ms 82956 KB Output is correct
21 Correct 343 ms 77876 KB Output is correct
22 Correct 335 ms 75160 KB Output is correct
23 Correct 270 ms 72456 KB Output is correct
24 Correct 119 ms 39396 KB Output is correct
25 Correct 116 ms 39452 KB Output is correct
26 Correct 127 ms 39456 KB Output is correct
27 Correct 294 ms 66232 KB Output is correct
28 Correct 293 ms 66168 KB Output is correct
29 Correct 445 ms 66232 KB Output is correct
30 Correct 443 ms 65308 KB Output is correct
31 Correct 12 ms 23812 KB Output is correct
32 Correct 34 ms 27392 KB Output is correct
33 Correct 54 ms 31496 KB Output is correct
34 Correct 290 ms 78108 KB Output is correct
35 Correct 18 ms 24660 KB Output is correct
36 Correct 38 ms 27912 KB Output is correct
37 Correct 64 ms 31796 KB Output is correct
38 Correct 139 ms 37888 KB Output is correct
39 Correct 205 ms 43344 KB Output is correct
40 Correct 259 ms 48464 KB Output is correct
41 Correct 326 ms 53792 KB Output is correct
42 Correct 401 ms 59992 KB Output is correct
43 Correct 11 ms 23772 KB Output is correct
44 Correct 10 ms 23772 KB Output is correct
45 Correct 10 ms 23764 KB Output is correct
46 Correct 10 ms 23784 KB Output is correct
47 Correct 13 ms 23752 KB Output is correct
48 Correct 11 ms 23764 KB Output is correct
49 Correct 12 ms 23736 KB Output is correct
50 Correct 14 ms 23740 KB Output is correct
51 Correct 14 ms 23812 KB Output is correct
52 Correct 15 ms 23764 KB Output is correct
53 Correct 12 ms 23764 KB Output is correct
54 Correct 13 ms 24000 KB Output is correct
55 Correct 14 ms 24048 KB Output is correct
56 Correct 145 ms 49720 KB Output is correct
57 Correct 217 ms 62176 KB Output is correct
58 Correct 239 ms 61344 KB Output is correct
59 Correct 12 ms 23764 KB Output is correct
60 Correct 12 ms 23764 KB Output is correct
61 Correct 12 ms 23744 KB Output is correct
62 Correct 338 ms 83796 KB Output is correct
63 Correct 332 ms 83328 KB Output is correct
64 Correct 310 ms 86792 KB Output is correct
65 Correct 13 ms 24148 KB Output is correct
66 Correct 15 ms 24532 KB Output is correct
67 Correct 167 ms 46304 KB Output is correct
68 Correct 256 ms 60076 KB Output is correct
69 Correct 343 ms 69208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 14 ms 23764 KB Output is correct
2 Correct 12 ms 23764 KB Output is correct
3 Correct 15 ms 23716 KB Output is correct
4 Correct 12 ms 23724 KB Output is correct
5 Correct 12 ms 23764 KB Output is correct
6 Correct 16 ms 23764 KB Output is correct
7 Correct 12 ms 23764 KB Output is correct
8 Correct 12 ms 23680 KB Output is correct
9 Correct 136 ms 56416 KB Output is correct
10 Correct 22 ms 27320 KB Output is correct
11 Correct 78 ms 41892 KB Output is correct
12 Correct 28 ms 28972 KB Output is correct
13 Correct 35 ms 30952 KB Output is correct
14 Correct 12 ms 23800 KB Output is correct
15 Correct 12 ms 23892 KB Output is correct
16 Correct 135 ms 50896 KB Output is correct
17 Correct 316 ms 91128 KB Output is correct
18 Correct 320 ms 88800 KB Output is correct
19 Correct 384 ms 83372 KB Output is correct
20 Correct 411 ms 73144 KB Output is correct
21 Correct 346 ms 69188 KB Output is correct
22 Correct 12 ms 23776 KB Output is correct
23 Correct 66 ms 30744 KB Output is correct
24 Correct 26 ms 26044 KB Output is correct
25 Correct 62 ms 29824 KB Output is correct
26 Correct 86 ms 33900 KB Output is correct
27 Correct 209 ms 47004 KB Output is correct
28 Correct 267 ms 53068 KB Output is correct
29 Correct 329 ms 58780 KB Output is correct
30 Correct 375 ms 66024 KB Output is correct
31 Correct 427 ms 71452 KB Output is correct
32 Correct 325 ms 80696 KB Output is correct
33 Correct 291 ms 91128 KB Output is correct
34 Correct 14 ms 24404 KB Output is correct
35 Correct 19 ms 24788 KB Output is correct
36 Correct 157 ms 48320 KB Output is correct
37 Correct 265 ms 61464 KB Output is correct
38 Correct 340 ms 74324 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 14 ms 23764 KB Output is correct
2 Correct 12 ms 23764 KB Output is correct
3 Correct 15 ms 23716 KB Output is correct
4 Correct 12 ms 23724 KB Output is correct
5 Correct 12 ms 23764 KB Output is correct
6 Correct 16 ms 23764 KB Output is correct
7 Correct 12 ms 23764 KB Output is correct
8 Correct 12 ms 23680 KB Output is correct
9 Correct 136 ms 56416 KB Output is correct
10 Correct 22 ms 27320 KB Output is correct
11 Correct 78 ms 41892 KB Output is correct
12 Correct 28 ms 28972 KB Output is correct
13 Correct 35 ms 30952 KB Output is correct
14 Correct 12 ms 23800 KB Output is correct
15 Correct 12 ms 23892 KB Output is correct
16 Correct 135 ms 50896 KB Output is correct
17 Correct 11 ms 23764 KB Output is correct
18 Correct 12 ms 23768 KB Output is correct
19 Correct 11 ms 23764 KB Output is correct
20 Correct 12 ms 23764 KB Output is correct
21 Correct 12 ms 23764 KB Output is correct
22 Correct 11 ms 23756 KB Output is correct
23 Correct 294 ms 80228 KB Output is correct
24 Correct 12 ms 23764 KB Output is correct
25 Correct 13 ms 24132 KB Output is correct
26 Correct 13 ms 24148 KB Output is correct
27 Correct 14 ms 24112 KB Output is correct
28 Correct 112 ms 47112 KB Output is correct
29 Correct 173 ms 55556 KB Output is correct
30 Correct 225 ms 69108 KB Output is correct
31 Correct 295 ms 78052 KB Output is correct
32 Correct 11 ms 23696 KB Output is correct
33 Correct 12 ms 23712 KB Output is correct
34 Correct 12 ms 23764 KB Output is correct
35 Correct 12 ms 23764 KB Output is correct
36 Correct 14 ms 23712 KB Output is correct
37 Correct 11 ms 23764 KB Output is correct
38 Correct 12 ms 23764 KB Output is correct
39 Correct 12 ms 23728 KB Output is correct
40 Correct 12 ms 23892 KB Output is correct
41 Correct 12 ms 23748 KB Output is correct
42 Correct 12 ms 23764 KB Output is correct
43 Correct 12 ms 24056 KB Output is correct
44 Correct 13 ms 24020 KB Output is correct
45 Correct 143 ms 49708 KB Output is correct
46 Correct 221 ms 62184 KB Output is correct
47 Correct 230 ms 61336 KB Output is correct
48 Correct 12 ms 23764 KB Output is correct
49 Correct 12 ms 23764 KB Output is correct
50 Correct 12 ms 23784 KB Output is correct
51 Correct 12 ms 23764 KB Output is correct
52 Correct 14 ms 23800 KB Output is correct
53 Correct 12 ms 23716 KB Output is correct
54 Correct 11 ms 23764 KB Output is correct
55 Correct 297 ms 75884 KB Output is correct
56 Correct 12 ms 23816 KB Output is correct
57 Correct 14 ms 24276 KB Output is correct
58 Correct 19 ms 25620 KB Output is correct
59 Correct 18 ms 24788 KB Output is correct
60 Correct 147 ms 52296 KB Output is correct
61 Correct 193 ms 61524 KB Output is correct
62 Correct 266 ms 68320 KB Output is correct
63 Correct 310 ms 74960 KB Output is correct
64 Correct 11 ms 23764 KB Output is correct
65 Correct 12 ms 23752 KB Output is correct
66 Correct 12 ms 23764 KB Output is correct
67 Correct 281 ms 83836 KB Output is correct
68 Correct 281 ms 83256 KB Output is correct
69 Correct 281 ms 86812 KB Output is correct
70 Correct 13 ms 24148 KB Output is correct
71 Correct 15 ms 24464 KB Output is correct
72 Correct 153 ms 46328 KB Output is correct
73 Correct 242 ms 60216 KB Output is correct
74 Correct 336 ms 69304 KB Output is correct
75 Correct 308 ms 80696 KB Output is correct
76 Correct 300 ms 91080 KB Output is correct
77 Correct 14 ms 24404 KB Output is correct
78 Correct 15 ms 24760 KB Output is correct
79 Correct 154 ms 48324 KB Output is correct
80 Correct 272 ms 61408 KB Output is correct
81 Correct 362 ms 74352 KB Output is correct
82 Correct 10 ms 23764 KB Output is correct
83 Correct 11 ms 23808 KB Output is correct
84 Correct 11 ms 23764 KB Output is correct
85 Correct 292 ms 82956 KB Output is correct
86 Correct 343 ms 77876 KB Output is correct
87 Correct 335 ms 75160 KB Output is correct
88 Correct 270 ms 72456 KB Output is correct
89 Correct 119 ms 39396 KB Output is correct
90 Correct 116 ms 39452 KB Output is correct
91 Correct 127 ms 39456 KB Output is correct
92 Correct 294 ms 66232 KB Output is correct
93 Correct 293 ms 66168 KB Output is correct
94 Correct 445 ms 66232 KB Output is correct
95 Correct 443 ms 65308 KB Output is correct
96 Correct 12 ms 23812 KB Output is correct
97 Correct 34 ms 27392 KB Output is correct
98 Correct 54 ms 31496 KB Output is correct
99 Correct 290 ms 78108 KB Output is correct
100 Correct 18 ms 24660 KB Output is correct
101 Correct 38 ms 27912 KB Output is correct
102 Correct 64 ms 31796 KB Output is correct
103 Correct 139 ms 37888 KB Output is correct
104 Correct 205 ms 43344 KB Output is correct
105 Correct 259 ms 48464 KB Output is correct
106 Correct 326 ms 53792 KB Output is correct
107 Correct 401 ms 59992 KB Output is correct
108 Correct 11 ms 23772 KB Output is correct
109 Correct 10 ms 23772 KB Output is correct
110 Correct 10 ms 23764 KB Output is correct
111 Correct 10 ms 23784 KB Output is correct
112 Correct 13 ms 23752 KB Output is correct
113 Correct 11 ms 23764 KB Output is correct
114 Correct 12 ms 23736 KB Output is correct
115 Correct 14 ms 23740 KB Output is correct
116 Correct 14 ms 23812 KB Output is correct
117 Correct 15 ms 23764 KB Output is correct
118 Correct 12 ms 23764 KB Output is correct
119 Correct 13 ms 24000 KB Output is correct
120 Correct 14 ms 24048 KB Output is correct
121 Correct 145 ms 49720 KB Output is correct
122 Correct 217 ms 62176 KB Output is correct
123 Correct 239 ms 61344 KB Output is correct
124 Correct 12 ms 23764 KB Output is correct
125 Correct 12 ms 23764 KB Output is correct
126 Correct 12 ms 23744 KB Output is correct
127 Correct 338 ms 83796 KB Output is correct
128 Correct 332 ms 83328 KB Output is correct
129 Correct 310 ms 86792 KB Output is correct
130 Correct 13 ms 24148 KB Output is correct
131 Correct 15 ms 24532 KB Output is correct
132 Correct 167 ms 46304 KB Output is correct
133 Correct 256 ms 60076 KB Output is correct
134 Correct 343 ms 69208 KB Output is correct
135 Correct 316 ms 91128 KB Output is correct
136 Correct 320 ms 88800 KB Output is correct
137 Correct 384 ms 83372 KB Output is correct
138 Correct 411 ms 73144 KB Output is correct
139 Correct 346 ms 69188 KB Output is correct
140 Correct 12 ms 23776 KB Output is correct
141 Correct 66 ms 30744 KB Output is correct
142 Correct 26 ms 26044 KB Output is correct
143 Correct 62 ms 29824 KB Output is correct
144 Correct 86 ms 33900 KB Output is correct
145 Correct 209 ms 47004 KB Output is correct
146 Correct 267 ms 53068 KB Output is correct
147 Correct 329 ms 58780 KB Output is correct
148 Correct 375 ms 66024 KB Output is correct
149 Correct 427 ms 71452 KB Output is correct
150 Correct 325 ms 80696 KB Output is correct
151 Correct 291 ms 91128 KB Output is correct
152 Correct 14 ms 24404 KB Output is correct
153 Correct 19 ms 24788 KB Output is correct
154 Correct 157 ms 48320 KB Output is correct
155 Correct 265 ms 61464 KB Output is correct
156 Correct 340 ms 74324 KB Output is correct
157 Correct 13 ms 23764 KB Output is correct
158 Correct 12 ms 23764 KB Output is correct
159 Correct 11 ms 23792 KB Output is correct
160 Correct 15 ms 23764 KB Output is correct
161 Correct 388 ms 72740 KB Output is correct
162 Correct 305 ms 74448 KB Output is correct
163 Correct 288 ms 68908 KB Output is correct
164 Correct 288 ms 67224 KB Output is correct
165 Correct 379 ms 79796 KB Output is correct
166 Correct 364 ms 82420 KB Output is correct
167 Incorrect 74 ms 31984 KB Solution announced impossible, but it is possible.
168 Halted 0 ms 0 KB -