Submission #828846

# Submission time Handle Problem Language Result Execution time Memory
828846 2023-08-17T17:31:39 Z fatemetmhr Fountain Parks (IOI21_parks) C++17
70 / 100
507 ms 91148 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++)
        assert(cnt[i + n - 1] < 3);
    //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 13 ms 23764 KB Output is correct
2 Correct 14 ms 23736 KB Output is correct
3 Correct 14 ms 23764 KB Output is correct
4 Correct 12 ms 23812 KB Output is correct
5 Correct 12 ms 23764 KB Output is correct
6 Correct 14 ms 23772 KB Output is correct
7 Correct 14 ms 23764 KB Output is correct
8 Correct 12 ms 23764 KB Output is correct
9 Correct 138 ms 56452 KB Output is correct
10 Correct 23 ms 27328 KB Output is correct
11 Correct 78 ms 41892 KB Output is correct
12 Correct 29 ms 28992 KB Output is correct
13 Correct 39 ms 30940 KB Output is correct
14 Correct 12 ms 23892 KB Output is correct
15 Correct 13 ms 23944 KB Output is correct
16 Correct 129 ms 50876 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 13 ms 23764 KB Output is correct
2 Correct 14 ms 23736 KB Output is correct
3 Correct 14 ms 23764 KB Output is correct
4 Correct 12 ms 23812 KB Output is correct
5 Correct 12 ms 23764 KB Output is correct
6 Correct 14 ms 23772 KB Output is correct
7 Correct 14 ms 23764 KB Output is correct
8 Correct 12 ms 23764 KB Output is correct
9 Correct 138 ms 56452 KB Output is correct
10 Correct 23 ms 27328 KB Output is correct
11 Correct 78 ms 41892 KB Output is correct
12 Correct 29 ms 28992 KB Output is correct
13 Correct 39 ms 30940 KB Output is correct
14 Correct 12 ms 23892 KB Output is correct
15 Correct 13 ms 23944 KB Output is correct
16 Correct 129 ms 50876 KB Output is correct
17 Correct 12 ms 23764 KB Output is correct
18 Correct 14 ms 23764 KB Output is correct
19 Correct 11 ms 23780 KB Output is correct
20 Correct 13 ms 23764 KB Output is correct
21 Correct 13 ms 23764 KB Output is correct
22 Correct 14 ms 23764 KB Output is correct
23 Correct 283 ms 80252 KB Output is correct
24 Correct 13 ms 23752 KB Output is correct
25 Correct 13 ms 24148 KB Output is correct
26 Correct 13 ms 24148 KB Output is correct
27 Correct 13 ms 24148 KB Output is correct
28 Correct 107 ms 47016 KB Output is correct
29 Correct 163 ms 55488 KB Output is correct
30 Correct 225 ms 69052 KB Output is correct
31 Correct 295 ms 77964 KB Output is correct
32 Correct 12 ms 23764 KB Output is correct
33 Correct 12 ms 23776 KB Output is correct
34 Correct 12 ms 23764 KB Output is correct
35 Correct 12 ms 23708 KB Output is correct
36 Correct 12 ms 23712 KB Output is correct
37 Correct 12 ms 23704 KB Output is correct
38 Correct 12 ms 23820 KB Output is correct
39 Correct 12 ms 23764 KB Output is correct
40 Correct 12 ms 23720 KB Output is correct
41 Correct 12 ms 23764 KB Output is correct
42 Correct 12 ms 23764 KB Output is correct
43 Correct 13 ms 23964 KB Output is correct
44 Correct 13 ms 24020 KB Output is correct
45 Correct 149 ms 49712 KB Output is correct
46 Correct 210 ms 62128 KB Output is correct
47 Correct 229 ms 61268 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 13 ms 23764 KB Output is correct
2 Correct 14 ms 23736 KB Output is correct
3 Correct 14 ms 23764 KB Output is correct
4 Correct 12 ms 23812 KB Output is correct
5 Correct 12 ms 23764 KB Output is correct
6 Correct 14 ms 23772 KB Output is correct
7 Correct 14 ms 23764 KB Output is correct
8 Correct 12 ms 23764 KB Output is correct
9 Correct 138 ms 56452 KB Output is correct
10 Correct 23 ms 27328 KB Output is correct
11 Correct 78 ms 41892 KB Output is correct
12 Correct 29 ms 28992 KB Output is correct
13 Correct 39 ms 30940 KB Output is correct
14 Correct 12 ms 23892 KB Output is correct
15 Correct 13 ms 23944 KB Output is correct
16 Correct 129 ms 50876 KB Output is correct
17 Correct 12 ms 23764 KB Output is correct
18 Correct 14 ms 23764 KB Output is correct
19 Correct 11 ms 23780 KB Output is correct
20 Correct 13 ms 23764 KB Output is correct
21 Correct 13 ms 23764 KB Output is correct
22 Correct 14 ms 23764 KB Output is correct
23 Correct 283 ms 80252 KB Output is correct
24 Correct 13 ms 23752 KB Output is correct
25 Correct 13 ms 24148 KB Output is correct
26 Correct 13 ms 24148 KB Output is correct
27 Correct 13 ms 24148 KB Output is correct
28 Correct 107 ms 47016 KB Output is correct
29 Correct 163 ms 55488 KB Output is correct
30 Correct 225 ms 69052 KB Output is correct
31 Correct 295 ms 77964 KB Output is correct
32 Correct 12 ms 23764 KB Output is correct
33 Correct 12 ms 23776 KB Output is correct
34 Correct 12 ms 23764 KB Output is correct
35 Correct 12 ms 23708 KB Output is correct
36 Correct 12 ms 23712 KB Output is correct
37 Correct 12 ms 23704 KB Output is correct
38 Correct 12 ms 23820 KB Output is correct
39 Correct 12 ms 23764 KB Output is correct
40 Correct 12 ms 23720 KB Output is correct
41 Correct 12 ms 23764 KB Output is correct
42 Correct 12 ms 23764 KB Output is correct
43 Correct 13 ms 23964 KB Output is correct
44 Correct 13 ms 24020 KB Output is correct
45 Correct 149 ms 49712 KB Output is correct
46 Correct 210 ms 62128 KB Output is correct
47 Correct 229 ms 61268 KB Output is correct
48 Correct 12 ms 23724 KB Output is correct
49 Correct 11 ms 23764 KB Output is correct
50 Correct 12 ms 23764 KB Output is correct
51 Correct 12 ms 23752 KB Output is correct
52 Correct 12 ms 23688 KB Output is correct
53 Correct 11 ms 23736 KB Output is correct
54 Correct 12 ms 23700 KB Output is correct
55 Correct 289 ms 75892 KB Output is correct
56 Correct 12 ms 23764 KB Output is correct
57 Correct 19 ms 24276 KB Output is correct
58 Correct 22 ms 25536 KB Output is correct
59 Correct 19 ms 24768 KB Output is correct
60 Correct 141 ms 52264 KB Output is correct
61 Correct 208 ms 61628 KB Output is correct
62 Correct 239 ms 68312 KB Output is correct
63 Correct 293 ms 75008 KB Output is correct
64 Correct 12 ms 23764 KB Output is correct
65 Correct 12 ms 23764 KB Output is correct
66 Correct 12 ms 23764 KB Output is correct
67 Correct 280 ms 83860 KB Output is correct
68 Correct 291 ms 83248 KB Output is correct
69 Correct 278 ms 86708 KB Output is correct
70 Correct 13 ms 24148 KB Output is correct
71 Correct 15 ms 24532 KB Output is correct
72 Correct 160 ms 46336 KB Output is correct
73 Correct 259 ms 60024 KB Output is correct
74 Correct 345 ms 69212 KB Output is correct
75 Correct 305 ms 80696 KB Output is correct
76 Correct 292 ms 91148 KB Output is correct
77 Correct 15 ms 24328 KB Output is correct
78 Correct 16 ms 24792 KB Output is correct
79 Correct 157 ms 48304 KB Output is correct
80 Correct 289 ms 61436 KB Output is correct
81 Correct 331 ms 74272 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 13 ms 23764 KB Output is correct
2 Correct 14 ms 23736 KB Output is correct
3 Correct 14 ms 23764 KB Output is correct
4 Correct 12 ms 23812 KB Output is correct
5 Correct 12 ms 23764 KB Output is correct
6 Correct 14 ms 23772 KB Output is correct
7 Correct 14 ms 23764 KB Output is correct
8 Correct 12 ms 23764 KB Output is correct
9 Correct 138 ms 56452 KB Output is correct
10 Correct 23 ms 27328 KB Output is correct
11 Correct 78 ms 41892 KB Output is correct
12 Correct 29 ms 28992 KB Output is correct
13 Correct 39 ms 30940 KB Output is correct
14 Correct 12 ms 23892 KB Output is correct
15 Correct 13 ms 23944 KB Output is correct
16 Correct 129 ms 50876 KB Output is correct
17 Correct 12 ms 23764 KB Output is correct
18 Correct 14 ms 23764 KB Output is correct
19 Correct 12 ms 23796 KB Output is correct
20 Correct 324 ms 82960 KB Output is correct
21 Correct 331 ms 77980 KB Output is correct
22 Correct 333 ms 75096 KB Output is correct
23 Correct 259 ms 72516 KB Output is correct
24 Correct 123 ms 39580 KB Output is correct
25 Correct 118 ms 39436 KB Output is correct
26 Correct 129 ms 39436 KB Output is correct
27 Correct 331 ms 66200 KB Output is correct
28 Correct 302 ms 66112 KB Output is correct
29 Correct 444 ms 66192 KB Output is correct
30 Correct 507 ms 65256 KB Output is correct
31 Correct 13 ms 23764 KB Output is correct
32 Correct 35 ms 27376 KB Output is correct
33 Correct 55 ms 31524 KB Output is correct
34 Correct 356 ms 78120 KB Output is correct
35 Correct 18 ms 24660 KB Output is correct
36 Correct 40 ms 27860 KB Output is correct
37 Correct 74 ms 31716 KB Output is correct
38 Correct 144 ms 37908 KB Output is correct
39 Correct 210 ms 43456 KB Output is correct
40 Correct 295 ms 48384 KB Output is correct
41 Correct 367 ms 53752 KB Output is correct
42 Correct 403 ms 60020 KB Output is correct
43 Correct 12 ms 23764 KB Output is correct
44 Correct 11 ms 23764 KB Output is correct
45 Correct 12 ms 23708 KB Output is correct
46 Correct 13 ms 23680 KB Output is correct
47 Correct 12 ms 23764 KB Output is correct
48 Correct 12 ms 23740 KB Output is correct
49 Correct 12 ms 23764 KB Output is correct
50 Correct 13 ms 23740 KB Output is correct
51 Correct 12 ms 23816 KB Output is correct
52 Correct 12 ms 23756 KB Output is correct
53 Correct 13 ms 23704 KB Output is correct
54 Correct 13 ms 24008 KB Output is correct
55 Correct 12 ms 24020 KB Output is correct
56 Correct 158 ms 49636 KB Output is correct
57 Correct 224 ms 62040 KB Output is correct
58 Correct 234 ms 61400 KB Output is correct
59 Correct 13 ms 23764 KB Output is correct
60 Correct 12 ms 23800 KB Output is correct
61 Correct 13 ms 23688 KB Output is correct
62 Correct 302 ms 83808 KB Output is correct
63 Correct 294 ms 83252 KB Output is correct
64 Correct 325 ms 86792 KB Output is correct
65 Correct 15 ms 24148 KB Output is correct
66 Correct 16 ms 24488 KB Output is correct
67 Correct 161 ms 46312 KB Output is correct
68 Correct 242 ms 60056 KB Output is correct
69 Correct 376 ms 69284 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 13 ms 23764 KB Output is correct
2 Correct 14 ms 23736 KB Output is correct
3 Correct 14 ms 23764 KB Output is correct
4 Correct 12 ms 23812 KB Output is correct
5 Correct 12 ms 23764 KB Output is correct
6 Correct 14 ms 23772 KB Output is correct
7 Correct 14 ms 23764 KB Output is correct
8 Correct 12 ms 23764 KB Output is correct
9 Correct 138 ms 56452 KB Output is correct
10 Correct 23 ms 27328 KB Output is correct
11 Correct 78 ms 41892 KB Output is correct
12 Correct 29 ms 28992 KB Output is correct
13 Correct 39 ms 30940 KB Output is correct
14 Correct 12 ms 23892 KB Output is correct
15 Correct 13 ms 23944 KB Output is correct
16 Correct 129 ms 50876 KB Output is correct
17 Correct 315 ms 91088 KB Output is correct
18 Correct 343 ms 88748 KB Output is correct
19 Correct 355 ms 83384 KB Output is correct
20 Correct 446 ms 73048 KB Output is correct
21 Correct 398 ms 69192 KB Output is correct
22 Correct 15 ms 23824 KB Output is correct
23 Correct 65 ms 30800 KB Output is correct
24 Correct 26 ms 26016 KB Output is correct
25 Correct 49 ms 29908 KB Output is correct
26 Correct 76 ms 34008 KB Output is correct
27 Correct 199 ms 47040 KB Output is correct
28 Correct 256 ms 53172 KB Output is correct
29 Correct 331 ms 58752 KB Output is correct
30 Correct 368 ms 66024 KB Output is correct
31 Correct 464 ms 71460 KB Output is correct
32 Correct 318 ms 80768 KB Output is correct
33 Correct 331 ms 91108 KB Output is correct
34 Correct 17 ms 24320 KB Output is correct
35 Correct 16 ms 24764 KB Output is correct
36 Correct 153 ms 48268 KB Output is correct
37 Correct 261 ms 61468 KB Output is correct
38 Correct 407 ms 74296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 13 ms 23764 KB Output is correct
2 Correct 14 ms 23736 KB Output is correct
3 Correct 14 ms 23764 KB Output is correct
4 Correct 12 ms 23812 KB Output is correct
5 Correct 12 ms 23764 KB Output is correct
6 Correct 14 ms 23772 KB Output is correct
7 Correct 14 ms 23764 KB Output is correct
8 Correct 12 ms 23764 KB Output is correct
9 Correct 138 ms 56452 KB Output is correct
10 Correct 23 ms 27328 KB Output is correct
11 Correct 78 ms 41892 KB Output is correct
12 Correct 29 ms 28992 KB Output is correct
13 Correct 39 ms 30940 KB Output is correct
14 Correct 12 ms 23892 KB Output is correct
15 Correct 13 ms 23944 KB Output is correct
16 Correct 129 ms 50876 KB Output is correct
17 Correct 12 ms 23764 KB Output is correct
18 Correct 14 ms 23764 KB Output is correct
19 Correct 11 ms 23780 KB Output is correct
20 Correct 13 ms 23764 KB Output is correct
21 Correct 13 ms 23764 KB Output is correct
22 Correct 14 ms 23764 KB Output is correct
23 Correct 283 ms 80252 KB Output is correct
24 Correct 13 ms 23752 KB Output is correct
25 Correct 13 ms 24148 KB Output is correct
26 Correct 13 ms 24148 KB Output is correct
27 Correct 13 ms 24148 KB Output is correct
28 Correct 107 ms 47016 KB Output is correct
29 Correct 163 ms 55488 KB Output is correct
30 Correct 225 ms 69052 KB Output is correct
31 Correct 295 ms 77964 KB Output is correct
32 Correct 12 ms 23764 KB Output is correct
33 Correct 12 ms 23776 KB Output is correct
34 Correct 12 ms 23764 KB Output is correct
35 Correct 12 ms 23708 KB Output is correct
36 Correct 12 ms 23712 KB Output is correct
37 Correct 12 ms 23704 KB Output is correct
38 Correct 12 ms 23820 KB Output is correct
39 Correct 12 ms 23764 KB Output is correct
40 Correct 12 ms 23720 KB Output is correct
41 Correct 12 ms 23764 KB Output is correct
42 Correct 12 ms 23764 KB Output is correct
43 Correct 13 ms 23964 KB Output is correct
44 Correct 13 ms 24020 KB Output is correct
45 Correct 149 ms 49712 KB Output is correct
46 Correct 210 ms 62128 KB Output is correct
47 Correct 229 ms 61268 KB Output is correct
48 Correct 12 ms 23724 KB Output is correct
49 Correct 11 ms 23764 KB Output is correct
50 Correct 12 ms 23764 KB Output is correct
51 Correct 12 ms 23752 KB Output is correct
52 Correct 12 ms 23688 KB Output is correct
53 Correct 11 ms 23736 KB Output is correct
54 Correct 12 ms 23700 KB Output is correct
55 Correct 289 ms 75892 KB Output is correct
56 Correct 12 ms 23764 KB Output is correct
57 Correct 19 ms 24276 KB Output is correct
58 Correct 22 ms 25536 KB Output is correct
59 Correct 19 ms 24768 KB Output is correct
60 Correct 141 ms 52264 KB Output is correct
61 Correct 208 ms 61628 KB Output is correct
62 Correct 239 ms 68312 KB Output is correct
63 Correct 293 ms 75008 KB Output is correct
64 Correct 12 ms 23764 KB Output is correct
65 Correct 12 ms 23764 KB Output is correct
66 Correct 12 ms 23764 KB Output is correct
67 Correct 280 ms 83860 KB Output is correct
68 Correct 291 ms 83248 KB Output is correct
69 Correct 278 ms 86708 KB Output is correct
70 Correct 13 ms 24148 KB Output is correct
71 Correct 15 ms 24532 KB Output is correct
72 Correct 160 ms 46336 KB Output is correct
73 Correct 259 ms 60024 KB Output is correct
74 Correct 345 ms 69212 KB Output is correct
75 Correct 305 ms 80696 KB Output is correct
76 Correct 292 ms 91148 KB Output is correct
77 Correct 15 ms 24328 KB Output is correct
78 Correct 16 ms 24792 KB Output is correct
79 Correct 157 ms 48304 KB Output is correct
80 Correct 289 ms 61436 KB Output is correct
81 Correct 331 ms 74272 KB Output is correct
82 Correct 12 ms 23764 KB Output is correct
83 Correct 14 ms 23764 KB Output is correct
84 Correct 12 ms 23796 KB Output is correct
85 Correct 324 ms 82960 KB Output is correct
86 Correct 331 ms 77980 KB Output is correct
87 Correct 333 ms 75096 KB Output is correct
88 Correct 259 ms 72516 KB Output is correct
89 Correct 123 ms 39580 KB Output is correct
90 Correct 118 ms 39436 KB Output is correct
91 Correct 129 ms 39436 KB Output is correct
92 Correct 331 ms 66200 KB Output is correct
93 Correct 302 ms 66112 KB Output is correct
94 Correct 444 ms 66192 KB Output is correct
95 Correct 507 ms 65256 KB Output is correct
96 Correct 13 ms 23764 KB Output is correct
97 Correct 35 ms 27376 KB Output is correct
98 Correct 55 ms 31524 KB Output is correct
99 Correct 356 ms 78120 KB Output is correct
100 Correct 18 ms 24660 KB Output is correct
101 Correct 40 ms 27860 KB Output is correct
102 Correct 74 ms 31716 KB Output is correct
103 Correct 144 ms 37908 KB Output is correct
104 Correct 210 ms 43456 KB Output is correct
105 Correct 295 ms 48384 KB Output is correct
106 Correct 367 ms 53752 KB Output is correct
107 Correct 403 ms 60020 KB Output is correct
108 Correct 12 ms 23764 KB Output is correct
109 Correct 11 ms 23764 KB Output is correct
110 Correct 12 ms 23708 KB Output is correct
111 Correct 13 ms 23680 KB Output is correct
112 Correct 12 ms 23764 KB Output is correct
113 Correct 12 ms 23740 KB Output is correct
114 Correct 12 ms 23764 KB Output is correct
115 Correct 13 ms 23740 KB Output is correct
116 Correct 12 ms 23816 KB Output is correct
117 Correct 12 ms 23756 KB Output is correct
118 Correct 13 ms 23704 KB Output is correct
119 Correct 13 ms 24008 KB Output is correct
120 Correct 12 ms 24020 KB Output is correct
121 Correct 158 ms 49636 KB Output is correct
122 Correct 224 ms 62040 KB Output is correct
123 Correct 234 ms 61400 KB Output is correct
124 Correct 13 ms 23764 KB Output is correct
125 Correct 12 ms 23800 KB Output is correct
126 Correct 13 ms 23688 KB Output is correct
127 Correct 302 ms 83808 KB Output is correct
128 Correct 294 ms 83252 KB Output is correct
129 Correct 325 ms 86792 KB Output is correct
130 Correct 15 ms 24148 KB Output is correct
131 Correct 16 ms 24488 KB Output is correct
132 Correct 161 ms 46312 KB Output is correct
133 Correct 242 ms 60056 KB Output is correct
134 Correct 376 ms 69284 KB Output is correct
135 Correct 315 ms 91088 KB Output is correct
136 Correct 343 ms 88748 KB Output is correct
137 Correct 355 ms 83384 KB Output is correct
138 Correct 446 ms 73048 KB Output is correct
139 Correct 398 ms 69192 KB Output is correct
140 Correct 15 ms 23824 KB Output is correct
141 Correct 65 ms 30800 KB Output is correct
142 Correct 26 ms 26016 KB Output is correct
143 Correct 49 ms 29908 KB Output is correct
144 Correct 76 ms 34008 KB Output is correct
145 Correct 199 ms 47040 KB Output is correct
146 Correct 256 ms 53172 KB Output is correct
147 Correct 331 ms 58752 KB Output is correct
148 Correct 368 ms 66024 KB Output is correct
149 Correct 464 ms 71460 KB Output is correct
150 Correct 318 ms 80768 KB Output is correct
151 Correct 331 ms 91108 KB Output is correct
152 Correct 17 ms 24320 KB Output is correct
153 Correct 16 ms 24764 KB Output is correct
154 Correct 153 ms 48268 KB Output is correct
155 Correct 261 ms 61468 KB Output is correct
156 Correct 407 ms 74296 KB Output is correct
157 Correct 12 ms 23764 KB Output is correct
158 Correct 12 ms 23780 KB Output is correct
159 Correct 15 ms 23756 KB Output is correct
160 Correct 16 ms 23704 KB Output is correct
161 Correct 397 ms 73036 KB Output is correct
162 Correct 268 ms 74456 KB Output is correct
163 Correct 314 ms 68884 KB Output is correct
164 Correct 289 ms 67356 KB Output is correct
165 Correct 378 ms 79760 KB Output is correct
166 Correct 353 ms 82240 KB Output is correct
167 Runtime error 101 ms 64668 KB Execution killed with signal 6
168 Halted 0 ms 0 KB -