Submission #439473

# Submission time Handle Problem Language Result Execution time Memory
439473 2021-06-30T05:36:42 Z qwerasdfzxcl Fountain Parks (IOI21_parks) C++17
70 / 100
1041 ms 146852 KB
#include "parks.h"
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
struct point{
    int x, y, n;
    point(){}
    point(int _x, int _y, int _n): x(_x), y(_y), n(_n) {}
    bool operator<(const point &P) const{
        if (x==P.x) return y<P.y;
        return x<P.x;
    }
};
struct DSU{
    int path[200200];
    void init(int n){
        for (int i=0;i<n;i++) path[i] = i;
    }
    int find(int s){
        if (s==path[s]) return s;
        return path[s] = find(path[s]);
    }
    void merge(int s, int v){
        int x = find(s), y = find(v);
        if (x==y) return;
        path[x] = y;
    }
}dsu;
struct Vertex{
    int s, e, x, y;
    Vertex(){}
    Vertex(int _s, int _e, int _x, int _y): s(_s), e(_e), x(_x), y(_y) {}
};
map<int, int> mp[200200];
multimap<pair<int, int>, int> INV;
vector<Vertex> graph;
vector<int> adj[400400], inv[400400];

bool make_edge(int x, int y, int x2, int y2){
    if (mp[x].find(y)==mp[x].end() || mp[x2].find(y2)==mp[x2].end()) return 0;
    int tmp1 = mp[x][y], tmp2 = mp[x2][y2];
    if (dsu.find(tmp1)==dsu.find(tmp2)) return 0;
    if (tmp1>tmp2) swap(tmp1, tmp2);
    dsu.merge(tmp1, tmp2);

    if (x==x2){
        graph.emplace_back(tmp1, tmp2, x-1, (y+y2)/2);
        graph.emplace_back(tmp1, tmp2, x+1, (y+y2)/2);
        INV.insert(make_pair(make_pair(x-1, (y+y2)/2), (int)graph.size()-2));
        INV.insert(make_pair(make_pair(x+1, (y+y2)/2), (int)graph.size()-1));
    }
    else{
        graph.emplace_back(tmp1, tmp2, (x+x2)/2, y-1);
        graph.emplace_back(tmp1, tmp2, (x+x2)/2, y+1);
        INV.insert(make_pair(make_pair((x+x2)/2, y-1), (int)graph.size()-2));
        INV.insert(make_pair(make_pair((x+x2)/2, y+1), (int)graph.size()-1));
    }
    return 1;
}

bool valid(int n){
    bool ret = 1;
    for (int i=0;i<n-1;i++) if (dsu.find(i)!=dsu.find(i+1)) ret = 0;
    return ret;
}

int sccnum[400400], col[400400], cnt = 0;
bool visited[400400];
stack<int> st;
vector<vector<int>> scc;

void dfs1(int s){
    visited[s] = 1;
    for (auto &v:adj[s]) if (!visited[v]) dfs1(v);
    st.push(s);
}

void dfs2(int s){
    visited[s] = 1;
    sccnum[s] = cnt;
    scc.back().push_back(s);
    for (auto &v:inv[s]) if (!visited[v]) dfs2(v);
}

void getscc(int n){
    for (int i=0;i<n;i++){
        for (auto &v:adj[i]) inv[v].push_back(i);
    }
    for (int i=0;i<n;i++) if (!visited[i]) dfs1(i);
    fill(visited, visited+n, 0);
    scc.push_back(vector<int>());
    while(!st.empty()){
        int cur = st.top(); st.pop();
        if (visited[cur]) continue;
        cnt++;
        scc.push_back(vector<int>());
        dfs2(cur);
    }
}

bool cmp(point &x, point &y){
    if (x.y==y.y) return x.x<y.x;
    return x.y<y.y;
}

int construct_roads(std::vector<int> x, std::vector<int> y) {
    if (x.size() == 1) {
	build({}, {}, {}, {});
        return 1;
    }
    std::vector<int> ansu, ansv, ansa, ansb;
    vector<point> vec;
    int n = x.size();
    for (int i=0;i<n;i++){
        vec.emplace_back(x[i], y[i], i);
        mp[x[i]][y[i]] = i;
    }

    ///graph modeling
    dsu.init(n);
    sort(vec.begin(), vec.end());
    for (int i=1;i<n;i++) if (vec[i-1].x==vec[i].x){
        if (vec[i-1].y+2==vec[i].y) make_edge(vec[i-1].x, vec[i-1].y, vec[i].x, vec[i].y);
    }
    sort(vec.begin(), vec.end(), cmp);
    for (int i=0;i<n;i++) if (vec[i].x%4==2){
        make_edge(vec[i].x, vec[i].y, vec[i].x-2, vec[i].y);
        make_edge(vec[i].x, vec[i].y, vec[i].x+2, vec[i].y);
    }
    for (int i=n-1;i>=0;i--) if (vec[i].x%4==0){
        make_edge(vec[i].x, vec[i].y, vec[i].x-2, vec[i].y);
        make_edge(vec[i].x, vec[i].y, vec[i].x+2, vec[i].y);
    }
    if (!valid(n)) return 0;

    for (auto iter=INV.begin();iter!=INV.end();++iter){
        auto tmp = INV.equal_range(iter->first);
        auto iter1 = tmp.first, iter2 = tmp.second;
        for(;iter1!=iter2;++iter1){
            if (iter1==iter) continue;
            adj[iter->second].push_back((iter1->second)^1);
        }
    }
    ///

    getscc((int)graph.size());
    for (int i=0;i<(int)graph.size();i++) if (sccnum[i]==sccnum[i^1]) return 0;

    ///finding solution
    fill(col, col+(int)graph.size(), -1);
    for (auto &V:scc){
        int tmp = 0;
        for (auto &x:V) if (col[x]==1) tmp = 1;
        for (auto &x:V) col[x] = tmp, col[x^1] = tmp^1;
    }
    ///
    for (int i=0;i<(int)graph.size();i++) if (col[i]==1){
        ansu.push_back(graph[i].s);
        ansv.push_back(graph[i].e);
        ansa.push_back(graph[i].x);
        ansb.push_back(graph[i].y);
    }
    build(ansu, ansv, ansa, ansb);
    return 1;
}
# Verdict Execution time Memory Grader output
1 Correct 19 ms 28492 KB Output is correct
2 Correct 21 ms 28492 KB Output is correct
3 Correct 22 ms 28492 KB Output is correct
4 Correct 22 ms 28492 KB Output is correct
5 Correct 21 ms 28524 KB Output is correct
6 Correct 22 ms 28520 KB Output is correct
7 Correct 19 ms 28492 KB Output is correct
8 Correct 22 ms 28492 KB Output is correct
9 Correct 336 ms 70568 KB Output is correct
10 Correct 42 ms 32832 KB Output is correct
11 Correct 157 ms 51420 KB Output is correct
12 Correct 56 ms 35092 KB Output is correct
13 Correct 93 ms 39216 KB Output is correct
14 Correct 21 ms 28656 KB Output is correct
15 Correct 24 ms 28916 KB Output is correct
16 Correct 349 ms 70228 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 19 ms 28492 KB Output is correct
2 Correct 21 ms 28492 KB Output is correct
3 Correct 22 ms 28492 KB Output is correct
4 Correct 22 ms 28492 KB Output is correct
5 Correct 21 ms 28524 KB Output is correct
6 Correct 22 ms 28520 KB Output is correct
7 Correct 19 ms 28492 KB Output is correct
8 Correct 22 ms 28492 KB Output is correct
9 Correct 336 ms 70568 KB Output is correct
10 Correct 42 ms 32832 KB Output is correct
11 Correct 157 ms 51420 KB Output is correct
12 Correct 56 ms 35092 KB Output is correct
13 Correct 93 ms 39216 KB Output is correct
14 Correct 21 ms 28656 KB Output is correct
15 Correct 24 ms 28916 KB Output is correct
16 Correct 349 ms 70228 KB Output is correct
17 Correct 19 ms 28492 KB Output is correct
18 Correct 21 ms 28492 KB Output is correct
19 Correct 23 ms 28492 KB Output is correct
20 Correct 22 ms 28492 KB Output is correct
21 Correct 24 ms 28492 KB Output is correct
22 Correct 23 ms 28620 KB Output is correct
23 Correct 799 ms 124680 KB Output is correct
24 Correct 23 ms 28492 KB Output is correct
25 Correct 24 ms 29104 KB Output is correct
26 Correct 27 ms 29180 KB Output is correct
27 Correct 28 ms 29380 KB Output is correct
28 Correct 303 ms 67128 KB Output is correct
29 Correct 456 ms 85824 KB Output is correct
30 Correct 619 ms 106012 KB Output is correct
31 Correct 805 ms 124720 KB Output is correct
32 Correct 19 ms 28492 KB Output is correct
33 Correct 24 ms 28492 KB Output is correct
34 Correct 19 ms 28492 KB Output is correct
35 Correct 23 ms 28472 KB Output is correct
36 Correct 22 ms 28492 KB Output is correct
37 Correct 19 ms 28492 KB Output is correct
38 Correct 21 ms 28424 KB Output is correct
39 Correct 22 ms 28508 KB Output is correct
40 Correct 20 ms 28496 KB Output is correct
41 Correct 20 ms 28516 KB Output is correct
42 Correct 20 ms 28492 KB Output is correct
43 Correct 23 ms 28984 KB Output is correct
44 Correct 26 ms 29240 KB Output is correct
45 Correct 351 ms 77664 KB Output is correct
46 Correct 597 ms 100792 KB Output is correct
47 Correct 545 ms 100800 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 19 ms 28492 KB Output is correct
2 Correct 21 ms 28492 KB Output is correct
3 Correct 22 ms 28492 KB Output is correct
4 Correct 22 ms 28492 KB Output is correct
5 Correct 21 ms 28524 KB Output is correct
6 Correct 22 ms 28520 KB Output is correct
7 Correct 19 ms 28492 KB Output is correct
8 Correct 22 ms 28492 KB Output is correct
9 Correct 336 ms 70568 KB Output is correct
10 Correct 42 ms 32832 KB Output is correct
11 Correct 157 ms 51420 KB Output is correct
12 Correct 56 ms 35092 KB Output is correct
13 Correct 93 ms 39216 KB Output is correct
14 Correct 21 ms 28656 KB Output is correct
15 Correct 24 ms 28916 KB Output is correct
16 Correct 349 ms 70228 KB Output is correct
17 Correct 19 ms 28492 KB Output is correct
18 Correct 21 ms 28492 KB Output is correct
19 Correct 23 ms 28492 KB Output is correct
20 Correct 22 ms 28492 KB Output is correct
21 Correct 24 ms 28492 KB Output is correct
22 Correct 23 ms 28620 KB Output is correct
23 Correct 799 ms 124680 KB Output is correct
24 Correct 23 ms 28492 KB Output is correct
25 Correct 24 ms 29104 KB Output is correct
26 Correct 27 ms 29180 KB Output is correct
27 Correct 28 ms 29380 KB Output is correct
28 Correct 303 ms 67128 KB Output is correct
29 Correct 456 ms 85824 KB Output is correct
30 Correct 619 ms 106012 KB Output is correct
31 Correct 805 ms 124720 KB Output is correct
32 Correct 19 ms 28492 KB Output is correct
33 Correct 24 ms 28492 KB Output is correct
34 Correct 19 ms 28492 KB Output is correct
35 Correct 23 ms 28472 KB Output is correct
36 Correct 22 ms 28492 KB Output is correct
37 Correct 19 ms 28492 KB Output is correct
38 Correct 21 ms 28424 KB Output is correct
39 Correct 22 ms 28508 KB Output is correct
40 Correct 20 ms 28496 KB Output is correct
41 Correct 20 ms 28516 KB Output is correct
42 Correct 20 ms 28492 KB Output is correct
43 Correct 23 ms 28984 KB Output is correct
44 Correct 26 ms 29240 KB Output is correct
45 Correct 351 ms 77664 KB Output is correct
46 Correct 597 ms 100792 KB Output is correct
47 Correct 545 ms 100800 KB Output is correct
48 Correct 23 ms 28492 KB Output is correct
49 Correct 19 ms 28424 KB Output is correct
50 Correct 20 ms 28524 KB Output is correct
51 Correct 21 ms 28408 KB Output is correct
52 Correct 22 ms 28492 KB Output is correct
53 Correct 22 ms 28432 KB Output is correct
54 Correct 20 ms 28404 KB Output is correct
55 Correct 829 ms 128572 KB Output is correct
56 Correct 21 ms 28492 KB Output is correct
57 Correct 27 ms 29388 KB Output is correct
58 Correct 36 ms 31580 KB Output is correct
59 Correct 39 ms 30820 KB Output is correct
60 Correct 378 ms 78396 KB Output is correct
61 Correct 518 ms 96940 KB Output is correct
62 Correct 677 ms 111716 KB Output is correct
63 Correct 836 ms 128644 KB Output is correct
64 Correct 21 ms 28492 KB Output is correct
65 Correct 22 ms 28452 KB Output is correct
66 Correct 21 ms 28448 KB Output is correct
67 Correct 718 ms 111936 KB Output is correct
68 Correct 702 ms 112076 KB Output is correct
69 Correct 689 ms 111412 KB Output is correct
70 Correct 29 ms 29388 KB Output is correct
71 Correct 32 ms 30384 KB Output is correct
72 Correct 375 ms 77676 KB Output is correct
73 Correct 600 ms 103272 KB Output is correct
74 Correct 824 ms 127168 KB Output is correct
75 Correct 757 ms 122080 KB Output is correct
76 Correct 751 ms 112064 KB Output is correct
77 Correct 27 ms 29644 KB Output is correct
78 Correct 38 ms 30748 KB Output is correct
79 Correct 358 ms 76448 KB Output is correct
80 Correct 617 ms 101536 KB Output is correct
81 Correct 771 ms 124612 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 19 ms 28492 KB Output is correct
2 Correct 21 ms 28492 KB Output is correct
3 Correct 22 ms 28492 KB Output is correct
4 Correct 22 ms 28492 KB Output is correct
5 Correct 21 ms 28524 KB Output is correct
6 Correct 22 ms 28520 KB Output is correct
7 Correct 19 ms 28492 KB Output is correct
8 Correct 22 ms 28492 KB Output is correct
9 Correct 336 ms 70568 KB Output is correct
10 Correct 42 ms 32832 KB Output is correct
11 Correct 157 ms 51420 KB Output is correct
12 Correct 56 ms 35092 KB Output is correct
13 Correct 93 ms 39216 KB Output is correct
14 Correct 21 ms 28656 KB Output is correct
15 Correct 24 ms 28916 KB Output is correct
16 Correct 349 ms 70228 KB Output is correct
17 Correct 20 ms 28492 KB Output is correct
18 Correct 20 ms 28444 KB Output is correct
19 Correct 19 ms 28472 KB Output is correct
20 Correct 743 ms 146840 KB Output is correct
21 Correct 633 ms 141828 KB Output is correct
22 Correct 654 ms 141872 KB Output is correct
23 Correct 514 ms 99876 KB Output is correct
24 Correct 304 ms 44148 KB Output is correct
25 Correct 604 ms 75324 KB Output is correct
26 Correct 469 ms 75412 KB Output is correct
27 Correct 692 ms 111488 KB Output is correct
28 Correct 632 ms 111548 KB Output is correct
29 Correct 787 ms 111620 KB Output is correct
30 Correct 799 ms 111536 KB Output is correct
31 Correct 19 ms 28492 KB Output is correct
32 Correct 64 ms 35684 KB Output is correct
33 Correct 100 ms 36260 KB Output is correct
34 Correct 621 ms 146748 KB Output is correct
35 Correct 34 ms 30812 KB Output is correct
36 Correct 111 ms 40180 KB Output is correct
37 Correct 295 ms 51912 KB Output is correct
38 Correct 347 ms 69404 KB Output is correct
39 Correct 498 ms 84148 KB Output is correct
40 Correct 733 ms 100516 KB Output is correct
41 Correct 928 ms 115368 KB Output is correct
42 Correct 1041 ms 130116 KB Output is correct
43 Correct 19 ms 28492 KB Output is correct
44 Correct 23 ms 28492 KB Output is correct
45 Correct 19 ms 28452 KB Output is correct
46 Correct 18 ms 28492 KB Output is correct
47 Correct 17 ms 28480 KB Output is correct
48 Correct 18 ms 28492 KB Output is correct
49 Correct 17 ms 28492 KB Output is correct
50 Correct 23 ms 28488 KB Output is correct
51 Correct 17 ms 28488 KB Output is correct
52 Correct 19 ms 28492 KB Output is correct
53 Correct 18 ms 28492 KB Output is correct
54 Correct 24 ms 28876 KB Output is correct
55 Correct 30 ms 29200 KB Output is correct
56 Correct 377 ms 77676 KB Output is correct
57 Correct 577 ms 100792 KB Output is correct
58 Correct 536 ms 100804 KB Output is correct
59 Correct 20 ms 28492 KB Output is correct
60 Correct 20 ms 28536 KB Output is correct
61 Correct 19 ms 28520 KB Output is correct
62 Correct 689 ms 111932 KB Output is correct
63 Correct 714 ms 112188 KB Output is correct
64 Correct 724 ms 111616 KB Output is correct
65 Correct 25 ms 29380 KB Output is correct
66 Correct 34 ms 30332 KB Output is correct
67 Correct 373 ms 77660 KB Output is correct
68 Correct 594 ms 103432 KB Output is correct
69 Correct 788 ms 127312 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 19 ms 28492 KB Output is correct
2 Correct 21 ms 28492 KB Output is correct
3 Correct 22 ms 28492 KB Output is correct
4 Correct 22 ms 28492 KB Output is correct
5 Correct 21 ms 28524 KB Output is correct
6 Correct 22 ms 28520 KB Output is correct
7 Correct 19 ms 28492 KB Output is correct
8 Correct 22 ms 28492 KB Output is correct
9 Correct 336 ms 70568 KB Output is correct
10 Correct 42 ms 32832 KB Output is correct
11 Correct 157 ms 51420 KB Output is correct
12 Correct 56 ms 35092 KB Output is correct
13 Correct 93 ms 39216 KB Output is correct
14 Correct 21 ms 28656 KB Output is correct
15 Correct 24 ms 28916 KB Output is correct
16 Correct 349 ms 70228 KB Output is correct
17 Correct 677 ms 112148 KB Output is correct
18 Correct 693 ms 112384 KB Output is correct
19 Correct 697 ms 144492 KB Output is correct
20 Correct 895 ms 126164 KB Output is correct
21 Correct 699 ms 106468 KB Output is correct
22 Correct 23 ms 28492 KB Output is correct
23 Correct 118 ms 44176 KB Output is correct
24 Correct 63 ms 33144 KB Output is correct
25 Correct 195 ms 46200 KB Output is correct
26 Correct 380 ms 56620 KB Output is correct
27 Correct 418 ms 78656 KB Output is correct
28 Correct 543 ms 91088 KB Output is correct
29 Correct 695 ms 104880 KB Output is correct
30 Correct 837 ms 116860 KB Output is correct
31 Correct 964 ms 129080 KB Output is correct
32 Correct 779 ms 121944 KB Output is correct
33 Correct 797 ms 112136 KB Output is correct
34 Correct 30 ms 29644 KB Output is correct
35 Correct 36 ms 30664 KB Output is correct
36 Correct 385 ms 76472 KB Output is correct
37 Correct 645 ms 101348 KB Output is correct
38 Correct 815 ms 124704 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 19 ms 28492 KB Output is correct
2 Correct 21 ms 28492 KB Output is correct
3 Correct 22 ms 28492 KB Output is correct
4 Correct 22 ms 28492 KB Output is correct
5 Correct 21 ms 28524 KB Output is correct
6 Correct 22 ms 28520 KB Output is correct
7 Correct 19 ms 28492 KB Output is correct
8 Correct 22 ms 28492 KB Output is correct
9 Correct 336 ms 70568 KB Output is correct
10 Correct 42 ms 32832 KB Output is correct
11 Correct 157 ms 51420 KB Output is correct
12 Correct 56 ms 35092 KB Output is correct
13 Correct 93 ms 39216 KB Output is correct
14 Correct 21 ms 28656 KB Output is correct
15 Correct 24 ms 28916 KB Output is correct
16 Correct 349 ms 70228 KB Output is correct
17 Correct 19 ms 28492 KB Output is correct
18 Correct 21 ms 28492 KB Output is correct
19 Correct 23 ms 28492 KB Output is correct
20 Correct 22 ms 28492 KB Output is correct
21 Correct 24 ms 28492 KB Output is correct
22 Correct 23 ms 28620 KB Output is correct
23 Correct 799 ms 124680 KB Output is correct
24 Correct 23 ms 28492 KB Output is correct
25 Correct 24 ms 29104 KB Output is correct
26 Correct 27 ms 29180 KB Output is correct
27 Correct 28 ms 29380 KB Output is correct
28 Correct 303 ms 67128 KB Output is correct
29 Correct 456 ms 85824 KB Output is correct
30 Correct 619 ms 106012 KB Output is correct
31 Correct 805 ms 124720 KB Output is correct
32 Correct 19 ms 28492 KB Output is correct
33 Correct 24 ms 28492 KB Output is correct
34 Correct 19 ms 28492 KB Output is correct
35 Correct 23 ms 28472 KB Output is correct
36 Correct 22 ms 28492 KB Output is correct
37 Correct 19 ms 28492 KB Output is correct
38 Correct 21 ms 28424 KB Output is correct
39 Correct 22 ms 28508 KB Output is correct
40 Correct 20 ms 28496 KB Output is correct
41 Correct 20 ms 28516 KB Output is correct
42 Correct 20 ms 28492 KB Output is correct
43 Correct 23 ms 28984 KB Output is correct
44 Correct 26 ms 29240 KB Output is correct
45 Correct 351 ms 77664 KB Output is correct
46 Correct 597 ms 100792 KB Output is correct
47 Correct 545 ms 100800 KB Output is correct
48 Correct 23 ms 28492 KB Output is correct
49 Correct 19 ms 28424 KB Output is correct
50 Correct 20 ms 28524 KB Output is correct
51 Correct 21 ms 28408 KB Output is correct
52 Correct 22 ms 28492 KB Output is correct
53 Correct 22 ms 28432 KB Output is correct
54 Correct 20 ms 28404 KB Output is correct
55 Correct 829 ms 128572 KB Output is correct
56 Correct 21 ms 28492 KB Output is correct
57 Correct 27 ms 29388 KB Output is correct
58 Correct 36 ms 31580 KB Output is correct
59 Correct 39 ms 30820 KB Output is correct
60 Correct 378 ms 78396 KB Output is correct
61 Correct 518 ms 96940 KB Output is correct
62 Correct 677 ms 111716 KB Output is correct
63 Correct 836 ms 128644 KB Output is correct
64 Correct 21 ms 28492 KB Output is correct
65 Correct 22 ms 28452 KB Output is correct
66 Correct 21 ms 28448 KB Output is correct
67 Correct 718 ms 111936 KB Output is correct
68 Correct 702 ms 112076 KB Output is correct
69 Correct 689 ms 111412 KB Output is correct
70 Correct 29 ms 29388 KB Output is correct
71 Correct 32 ms 30384 KB Output is correct
72 Correct 375 ms 77676 KB Output is correct
73 Correct 600 ms 103272 KB Output is correct
74 Correct 824 ms 127168 KB Output is correct
75 Correct 757 ms 122080 KB Output is correct
76 Correct 751 ms 112064 KB Output is correct
77 Correct 27 ms 29644 KB Output is correct
78 Correct 38 ms 30748 KB Output is correct
79 Correct 358 ms 76448 KB Output is correct
80 Correct 617 ms 101536 KB Output is correct
81 Correct 771 ms 124612 KB Output is correct
82 Correct 20 ms 28492 KB Output is correct
83 Correct 20 ms 28444 KB Output is correct
84 Correct 19 ms 28472 KB Output is correct
85 Correct 743 ms 146840 KB Output is correct
86 Correct 633 ms 141828 KB Output is correct
87 Correct 654 ms 141872 KB Output is correct
88 Correct 514 ms 99876 KB Output is correct
89 Correct 304 ms 44148 KB Output is correct
90 Correct 604 ms 75324 KB Output is correct
91 Correct 469 ms 75412 KB Output is correct
92 Correct 692 ms 111488 KB Output is correct
93 Correct 632 ms 111548 KB Output is correct
94 Correct 787 ms 111620 KB Output is correct
95 Correct 799 ms 111536 KB Output is correct
96 Correct 19 ms 28492 KB Output is correct
97 Correct 64 ms 35684 KB Output is correct
98 Correct 100 ms 36260 KB Output is correct
99 Correct 621 ms 146748 KB Output is correct
100 Correct 34 ms 30812 KB Output is correct
101 Correct 111 ms 40180 KB Output is correct
102 Correct 295 ms 51912 KB Output is correct
103 Correct 347 ms 69404 KB Output is correct
104 Correct 498 ms 84148 KB Output is correct
105 Correct 733 ms 100516 KB Output is correct
106 Correct 928 ms 115368 KB Output is correct
107 Correct 1041 ms 130116 KB Output is correct
108 Correct 19 ms 28492 KB Output is correct
109 Correct 23 ms 28492 KB Output is correct
110 Correct 19 ms 28452 KB Output is correct
111 Correct 18 ms 28492 KB Output is correct
112 Correct 17 ms 28480 KB Output is correct
113 Correct 18 ms 28492 KB Output is correct
114 Correct 17 ms 28492 KB Output is correct
115 Correct 23 ms 28488 KB Output is correct
116 Correct 17 ms 28488 KB Output is correct
117 Correct 19 ms 28492 KB Output is correct
118 Correct 18 ms 28492 KB Output is correct
119 Correct 24 ms 28876 KB Output is correct
120 Correct 30 ms 29200 KB Output is correct
121 Correct 377 ms 77676 KB Output is correct
122 Correct 577 ms 100792 KB Output is correct
123 Correct 536 ms 100804 KB Output is correct
124 Correct 20 ms 28492 KB Output is correct
125 Correct 20 ms 28536 KB Output is correct
126 Correct 19 ms 28520 KB Output is correct
127 Correct 689 ms 111932 KB Output is correct
128 Correct 714 ms 112188 KB Output is correct
129 Correct 724 ms 111616 KB Output is correct
130 Correct 25 ms 29380 KB Output is correct
131 Correct 34 ms 30332 KB Output is correct
132 Correct 373 ms 77660 KB Output is correct
133 Correct 594 ms 103432 KB Output is correct
134 Correct 788 ms 127312 KB Output is correct
135 Correct 677 ms 112148 KB Output is correct
136 Correct 693 ms 112384 KB Output is correct
137 Correct 697 ms 144492 KB Output is correct
138 Correct 895 ms 126164 KB Output is correct
139 Correct 699 ms 106468 KB Output is correct
140 Correct 23 ms 28492 KB Output is correct
141 Correct 118 ms 44176 KB Output is correct
142 Correct 63 ms 33144 KB Output is correct
143 Correct 195 ms 46200 KB Output is correct
144 Correct 380 ms 56620 KB Output is correct
145 Correct 418 ms 78656 KB Output is correct
146 Correct 543 ms 91088 KB Output is correct
147 Correct 695 ms 104880 KB Output is correct
148 Correct 837 ms 116860 KB Output is correct
149 Correct 964 ms 129080 KB Output is correct
150 Correct 779 ms 121944 KB Output is correct
151 Correct 797 ms 112136 KB Output is correct
152 Correct 30 ms 29644 KB Output is correct
153 Correct 36 ms 30664 KB Output is correct
154 Correct 385 ms 76472 KB Output is correct
155 Correct 645 ms 101348 KB Output is correct
156 Correct 815 ms 124704 KB Output is correct
157 Correct 19 ms 28488 KB Output is correct
158 Correct 21 ms 28492 KB Output is correct
159 Correct 19 ms 28492 KB Output is correct
160 Correct 19 ms 28508 KB Output is correct
161 Correct 976 ms 136756 KB Output is correct
162 Correct 684 ms 146852 KB Output is correct
163 Correct 638 ms 139348 KB Output is correct
164 Correct 654 ms 139436 KB Output is correct
165 Correct 692 ms 137800 KB Output is correct
166 Correct 751 ms 137088 KB Output is correct
167 Incorrect 175 ms 50092 KB Solution announced impossible, but it is possible.
168 Halted 0 ms 0 KB -