답안 #715654

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
715654 2023-03-27T12:12:18 Z Sorting 분수 공원 (IOI21_parks) C++17
70 / 100
1244 ms 128576 KB
#include "parks.h"
#include <bits/stdc++.h>

using namespace std;

const int N = 2e5 + 3;

map<pair<int, int>, int> f;
vector<pair<int, int>> adj[N];
bool vis[2 * N];
vector<int> active_edges;

map<pair<int, int>, vector<pair<int, int>>> for_2sat;
array<pair<int, int>, 2> pts[N];

vector<int> adj_2sat[2 * N], rev_adj_2sat[2 * N];
int cnt_out[2 * N];
vector<int> topsort;

void dfs_topsort(int u){
    vis[u] = true;

    for(auto to: adj_2sat[u]){
        if(vis[to]) continue;
        dfs_topsort(to);
    }
    topsort.push_back(u);
}

int dfs(int u){
    vis[u] = true;
    int cnt = 0;
    for(auto [to, idx_e]: adj[u]){
        if(vis[to]) continue;
        cnt += dfs(to);
        active_edges.push_back(idx_e);
        // cerr << idx_e << " idx_e" << endl;
        ++cnt;   
    }
    return cnt;
}

int construct_roads(std::vector<int> x, std::vector<int> y) {
    int n = x.size();
    for(int i = 0; i < n; ++i)
        f[{x[i], y[i]}] = i;

    vector<array<int, 2>> edges;
    for(int i = 0; i < n; ++i){
        array<int, 2> adj_dir[2]{{2, 0}, {0, 2}};
        for(auto [dx, dy]: adj_dir){
            auto [to_x, to_y] = pair{dx + x[i], dy + y[i]};
            if(f.count({to_x, to_y})){
                int idx = f[{to_x, to_y}];
                edges.push_back({i, idx});
                adj[i].push_back({idx, edges.size() - 1});
                adj[idx].push_back({i, edges.size() - 1});
            }
        }
    }

    int cnt = dfs(0);
    // cerr << cnt << " cnt" << endl;
    if(cnt != n - 1)
        return 0;


    for(int i = 0; i < n - 1; ++i){
        int idx_e = active_edges[i];

        pair<int, int> p1, p2;
        int f1 = edges[idx_e][0];
        int f2 = edges[idx_e][1];
        // cerr << f1 << " " << f2 << " edge" << endl;

        auto [sx, sy] = pair{x[f1], y[f1]};
        auto [dx, dy] = pair{x[f2] - x[f1], y[f2] - y[f1]};
        dx /= 2;
        dy /= 2;

        if(dx < 0 || dy < 0){
            sx += dx;
            dy += dy;
            dx = -dx;
            dy = -dy;
        }

        if(dx == 1){
            p1 = {sx + 1, sy + 1};
            p2 = {sx + 1, sy - 1};
        }
        else{
            p1 = {sx + 1, sy + 1};
            p2 = {sx - 1, sy + 1};
        }

        // cerr << p1.first << " " << p1.second << " p1" << endl;
        // cerr << p2.first << " " << p2.second << " p2" << endl;

        pts[i] = {p1, p2};
        for_2sat[p1].push_back({2 * i, 2 * i + 1});
        for_2sat[p2].push_back({2 * i + 1, 2 * i});
    }

    for(auto [p, v]: for_2sat){
        for(int i = 0; i < v.size(); ++i){
            for(int j = 0; j < v.size(); ++j){
                if(i == j) continue;
                // cerr << "edge " << v[i].first << " " << v[j].second << endl;
                adj_2sat[v[i].first].push_back(v[j].second);
                rev_adj_2sat[v[j].second].push_back(v[i].first);
            }
        }
    }

    for(int i = 0; i < 2 * (n - 1); ++i)
        vis[i] = false;

    for(int i = 0; i < 2 * (n - 1); ++i)
        if(!vis[i])
            dfs_topsort(i);

    // cerr << topsort.size() << " topsort size" << endl;
    // for(int x: topsort)
        // cerr << x << " ";
    // cerr << endl;
    
    if(topsort.size() != 2 * (n - 1))
        return 0;

    static int loc[2 * N];
    reverse(topsort.begin(), topsort.end());
    for(int i = 0; i < 2 * (n - 1); ++i)
        loc[topsort[i]] = i;

    vector<pair<int, int>> benches;
    for(int i = 0; i < (n - 1); ++i){
        if(loc[2 * i] > loc[2 * i + 1])
            benches.push_back(pts[i][0]);
        else
            benches.push_back(pts[i][1]);
    }

    vector<int> u, v, a, b;
    for(int i = 0; i < n - 1; ++i){
        int idx_e = active_edges[i];
        u.push_back(edges[idx_e][0]);
        v.push_back(edges[idx_e][1]);
        a.push_back(benches[i].first);
        b.push_back(benches[i].second);
    }

    build(u, v, a, b);
    return 1;
}

Compilation message

parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:106:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  106 |         for(int i = 0; i < v.size(); ++i){
      |                        ~~^~~~~~~~~~
parks.cpp:107:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  107 |             for(int j = 0; j < v.size(); ++j){
      |                            ~~^~~~~~~~~~
parks.cpp:128:23: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  128 |     if(topsort.size() != 2 * (n - 1))
      |        ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 23764 KB Output is correct
2 Correct 13 ms 23704 KB Output is correct
3 Correct 12 ms 23740 KB Output is correct
4 Correct 14 ms 23764 KB Output is correct
5 Correct 13 ms 23764 KB Output is correct
6 Correct 12 ms 23776 KB Output is correct
7 Correct 16 ms 23768 KB Output is correct
8 Correct 13 ms 23764 KB Output is correct
9 Correct 325 ms 72716 KB Output is correct
10 Correct 30 ms 28748 KB Output is correct
11 Correct 123 ms 50428 KB Output is correct
12 Correct 41 ms 31196 KB Output is correct
13 Correct 46 ms 31044 KB Output is correct
14 Correct 14 ms 23892 KB Output is correct
15 Correct 17 ms 23988 KB Output is correct
16 Correct 285 ms 70152 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 23764 KB Output is correct
2 Correct 13 ms 23704 KB Output is correct
3 Correct 12 ms 23740 KB Output is correct
4 Correct 14 ms 23764 KB Output is correct
5 Correct 13 ms 23764 KB Output is correct
6 Correct 12 ms 23776 KB Output is correct
7 Correct 16 ms 23768 KB Output is correct
8 Correct 13 ms 23764 KB Output is correct
9 Correct 325 ms 72716 KB Output is correct
10 Correct 30 ms 28748 KB Output is correct
11 Correct 123 ms 50428 KB Output is correct
12 Correct 41 ms 31196 KB Output is correct
13 Correct 46 ms 31044 KB Output is correct
14 Correct 14 ms 23892 KB Output is correct
15 Correct 17 ms 23988 KB Output is correct
16 Correct 285 ms 70152 KB Output is correct
17 Correct 12 ms 23764 KB Output is correct
18 Correct 14 ms 23784 KB Output is correct
19 Correct 12 ms 23764 KB Output is correct
20 Correct 12 ms 23804 KB Output is correct
21 Correct 15 ms 23764 KB Output is correct
22 Correct 14 ms 23812 KB Output is correct
23 Correct 894 ms 125656 KB Output is correct
24 Correct 13 ms 23764 KB Output is correct
25 Correct 15 ms 24328 KB Output is correct
26 Correct 15 ms 24332 KB Output is correct
27 Correct 15 ms 24328 KB Output is correct
28 Correct 265 ms 64708 KB Output is correct
29 Correct 463 ms 84196 KB Output is correct
30 Correct 595 ms 105816 KB Output is correct
31 Correct 770 ms 124744 KB Output is correct
32 Correct 12 ms 23764 KB Output is correct
33 Correct 12 ms 23756 KB Output is correct
34 Correct 12 ms 23764 KB Output is correct
35 Correct 12 ms 23744 KB Output is correct
36 Correct 12 ms 23792 KB Output is correct
37 Correct 12 ms 23764 KB Output is correct
38 Correct 12 ms 23704 KB Output is correct
39 Correct 12 ms 23764 KB Output is correct
40 Correct 13 ms 23764 KB Output is correct
41 Correct 13 ms 23808 KB Output is correct
42 Correct 14 ms 23720 KB Output is correct
43 Correct 14 ms 24084 KB Output is correct
44 Correct 16 ms 24160 KB Output is correct
45 Correct 331 ms 73080 KB Output is correct
46 Correct 451 ms 96412 KB Output is correct
47 Correct 450 ms 96060 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 23764 KB Output is correct
2 Correct 13 ms 23704 KB Output is correct
3 Correct 12 ms 23740 KB Output is correct
4 Correct 14 ms 23764 KB Output is correct
5 Correct 13 ms 23764 KB Output is correct
6 Correct 12 ms 23776 KB Output is correct
7 Correct 16 ms 23768 KB Output is correct
8 Correct 13 ms 23764 KB Output is correct
9 Correct 325 ms 72716 KB Output is correct
10 Correct 30 ms 28748 KB Output is correct
11 Correct 123 ms 50428 KB Output is correct
12 Correct 41 ms 31196 KB Output is correct
13 Correct 46 ms 31044 KB Output is correct
14 Correct 14 ms 23892 KB Output is correct
15 Correct 17 ms 23988 KB Output is correct
16 Correct 285 ms 70152 KB Output is correct
17 Correct 12 ms 23764 KB Output is correct
18 Correct 14 ms 23784 KB Output is correct
19 Correct 12 ms 23764 KB Output is correct
20 Correct 12 ms 23804 KB Output is correct
21 Correct 15 ms 23764 KB Output is correct
22 Correct 14 ms 23812 KB Output is correct
23 Correct 894 ms 125656 KB Output is correct
24 Correct 13 ms 23764 KB Output is correct
25 Correct 15 ms 24328 KB Output is correct
26 Correct 15 ms 24332 KB Output is correct
27 Correct 15 ms 24328 KB Output is correct
28 Correct 265 ms 64708 KB Output is correct
29 Correct 463 ms 84196 KB Output is correct
30 Correct 595 ms 105816 KB Output is correct
31 Correct 770 ms 124744 KB Output is correct
32 Correct 12 ms 23764 KB Output is correct
33 Correct 12 ms 23756 KB Output is correct
34 Correct 12 ms 23764 KB Output is correct
35 Correct 12 ms 23744 KB Output is correct
36 Correct 12 ms 23792 KB Output is correct
37 Correct 12 ms 23764 KB Output is correct
38 Correct 12 ms 23704 KB Output is correct
39 Correct 12 ms 23764 KB Output is correct
40 Correct 13 ms 23764 KB Output is correct
41 Correct 13 ms 23808 KB Output is correct
42 Correct 14 ms 23720 KB Output is correct
43 Correct 14 ms 24084 KB Output is correct
44 Correct 16 ms 24160 KB Output is correct
45 Correct 331 ms 73080 KB Output is correct
46 Correct 451 ms 96412 KB Output is correct
47 Correct 450 ms 96060 KB Output is correct
48 Correct 12 ms 23764 KB Output is correct
49 Correct 12 ms 23804 KB Output is correct
50 Correct 12 ms 23700 KB Output is correct
51 Correct 12 ms 23764 KB Output is correct
52 Correct 12 ms 23792 KB Output is correct
53 Correct 15 ms 23808 KB Output is correct
54 Correct 12 ms 23764 KB Output is correct
55 Correct 853 ms 123300 KB Output is correct
56 Correct 13 ms 23736 KB Output is correct
57 Correct 16 ms 24660 KB Output is correct
58 Correct 25 ms 26848 KB Output is correct
59 Correct 23 ms 25352 KB Output is correct
60 Correct 359 ms 74628 KB Output is correct
61 Correct 582 ms 92604 KB Output is correct
62 Correct 723 ms 107072 KB Output is correct
63 Correct 882 ms 123692 KB Output is correct
64 Correct 12 ms 23808 KB Output is correct
65 Correct 12 ms 23764 KB Output is correct
66 Correct 13 ms 23884 KB Output is correct
67 Correct 690 ms 120748 KB Output is correct
68 Correct 663 ms 120956 KB Output is correct
69 Correct 654 ms 121856 KB Output is correct
70 Correct 16 ms 24252 KB Output is correct
71 Correct 20 ms 24840 KB Output is correct
72 Correct 321 ms 71284 KB Output is correct
73 Correct 531 ms 97472 KB Output is correct
74 Correct 820 ms 119052 KB Output is correct
75 Correct 824 ms 123344 KB Output is correct
76 Correct 648 ms 124372 KB Output is correct
77 Correct 16 ms 24540 KB Output is correct
78 Correct 23 ms 25072 KB Output is correct
79 Correct 348 ms 72240 KB Output is correct
80 Correct 549 ms 97572 KB Output is correct
81 Correct 909 ms 121924 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 23764 KB Output is correct
2 Correct 13 ms 23704 KB Output is correct
3 Correct 12 ms 23740 KB Output is correct
4 Correct 14 ms 23764 KB Output is correct
5 Correct 13 ms 23764 KB Output is correct
6 Correct 12 ms 23776 KB Output is correct
7 Correct 16 ms 23768 KB Output is correct
8 Correct 13 ms 23764 KB Output is correct
9 Correct 325 ms 72716 KB Output is correct
10 Correct 30 ms 28748 KB Output is correct
11 Correct 123 ms 50428 KB Output is correct
12 Correct 41 ms 31196 KB Output is correct
13 Correct 46 ms 31044 KB Output is correct
14 Correct 14 ms 23892 KB Output is correct
15 Correct 17 ms 23988 KB Output is correct
16 Correct 285 ms 70152 KB Output is correct
17 Correct 20 ms 23764 KB Output is correct
18 Correct 20 ms 23784 KB Output is correct
19 Correct 18 ms 23764 KB Output is correct
20 Correct 895 ms 128500 KB Output is correct
21 Correct 736 ms 125792 KB Output is correct
22 Correct 692 ms 124308 KB Output is correct
23 Correct 515 ms 106328 KB Output is correct
24 Correct 293 ms 41252 KB Output is correct
25 Correct 500 ms 49036 KB Output is correct
26 Correct 370 ms 49076 KB Output is correct
27 Correct 623 ms 112004 KB Output is correct
28 Correct 739 ms 111956 KB Output is correct
29 Correct 866 ms 111984 KB Output is correct
30 Correct 734 ms 112060 KB Output is correct
31 Correct 13 ms 23764 KB Output is correct
32 Correct 45 ms 30828 KB Output is correct
33 Correct 107 ms 32888 KB Output is correct
34 Correct 657 ms 126556 KB Output is correct
35 Correct 23 ms 25188 KB Output is correct
36 Correct 75 ms 30592 KB Output is correct
37 Correct 178 ms 37408 KB Output is correct
38 Correct 252 ms 61272 KB Output is correct
39 Correct 391 ms 74644 KB Output is correct
40 Correct 531 ms 89684 KB Output is correct
41 Correct 713 ms 103156 KB Output is correct
42 Correct 828 ms 116660 KB Output is correct
43 Correct 13 ms 23764 KB Output is correct
44 Correct 13 ms 23832 KB Output is correct
45 Correct 13 ms 23752 KB Output is correct
46 Correct 13 ms 23808 KB Output is correct
47 Correct 13 ms 23808 KB Output is correct
48 Correct 14 ms 23764 KB Output is correct
49 Correct 13 ms 23764 KB Output is correct
50 Correct 13 ms 23804 KB Output is correct
51 Correct 14 ms 23812 KB Output is correct
52 Correct 14 ms 23764 KB Output is correct
53 Correct 14 ms 23760 KB Output is correct
54 Correct 14 ms 24020 KB Output is correct
55 Correct 19 ms 24108 KB Output is correct
56 Correct 325 ms 73036 KB Output is correct
57 Correct 529 ms 96584 KB Output is correct
58 Correct 474 ms 95956 KB Output is correct
59 Correct 15 ms 23764 KB Output is correct
60 Correct 14 ms 23764 KB Output is correct
61 Correct 13 ms 23764 KB Output is correct
62 Correct 679 ms 120692 KB Output is correct
63 Correct 663 ms 120988 KB Output is correct
64 Correct 671 ms 121888 KB Output is correct
65 Correct 17 ms 24276 KB Output is correct
66 Correct 21 ms 24784 KB Output is correct
67 Correct 319 ms 71404 KB Output is correct
68 Correct 561 ms 97468 KB Output is correct
69 Correct 735 ms 119036 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 23764 KB Output is correct
2 Correct 13 ms 23704 KB Output is correct
3 Correct 12 ms 23740 KB Output is correct
4 Correct 14 ms 23764 KB Output is correct
5 Correct 13 ms 23764 KB Output is correct
6 Correct 12 ms 23776 KB Output is correct
7 Correct 16 ms 23768 KB Output is correct
8 Correct 13 ms 23764 KB Output is correct
9 Correct 325 ms 72716 KB Output is correct
10 Correct 30 ms 28748 KB Output is correct
11 Correct 123 ms 50428 KB Output is correct
12 Correct 41 ms 31196 KB Output is correct
13 Correct 46 ms 31044 KB Output is correct
14 Correct 14 ms 23892 KB Output is correct
15 Correct 17 ms 23988 KB Output is correct
16 Correct 285 ms 70152 KB Output is correct
17 Correct 667 ms 122748 KB Output is correct
18 Correct 730 ms 120124 KB Output is correct
19 Correct 749 ms 128576 KB Output is correct
20 Correct 818 ms 117704 KB Output is correct
21 Correct 689 ms 105932 KB Output is correct
22 Correct 13 ms 23764 KB Output is correct
23 Correct 89 ms 39020 KB Output is correct
24 Correct 34 ms 26884 KB Output is correct
25 Correct 132 ms 33952 KB Output is correct
26 Correct 226 ms 41160 KB Output is correct
27 Correct 378 ms 72224 KB Output is correct
28 Correct 479 ms 85028 KB Output is correct
29 Correct 613 ms 97684 KB Output is correct
30 Correct 772 ms 108932 KB Output is correct
31 Correct 810 ms 120144 KB Output is correct
32 Correct 830 ms 123252 KB Output is correct
33 Correct 664 ms 124356 KB Output is correct
34 Correct 17 ms 24532 KB Output is correct
35 Correct 20 ms 25096 KB Output is correct
36 Correct 334 ms 72360 KB Output is correct
37 Correct 567 ms 97692 KB Output is correct
38 Correct 794 ms 121768 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 23764 KB Output is correct
2 Correct 13 ms 23704 KB Output is correct
3 Correct 12 ms 23740 KB Output is correct
4 Correct 14 ms 23764 KB Output is correct
5 Correct 13 ms 23764 KB Output is correct
6 Correct 12 ms 23776 KB Output is correct
7 Correct 16 ms 23768 KB Output is correct
8 Correct 13 ms 23764 KB Output is correct
9 Correct 325 ms 72716 KB Output is correct
10 Correct 30 ms 28748 KB Output is correct
11 Correct 123 ms 50428 KB Output is correct
12 Correct 41 ms 31196 KB Output is correct
13 Correct 46 ms 31044 KB Output is correct
14 Correct 14 ms 23892 KB Output is correct
15 Correct 17 ms 23988 KB Output is correct
16 Correct 285 ms 70152 KB Output is correct
17 Correct 12 ms 23764 KB Output is correct
18 Correct 14 ms 23784 KB Output is correct
19 Correct 12 ms 23764 KB Output is correct
20 Correct 12 ms 23804 KB Output is correct
21 Correct 15 ms 23764 KB Output is correct
22 Correct 14 ms 23812 KB Output is correct
23 Correct 894 ms 125656 KB Output is correct
24 Correct 13 ms 23764 KB Output is correct
25 Correct 15 ms 24328 KB Output is correct
26 Correct 15 ms 24332 KB Output is correct
27 Correct 15 ms 24328 KB Output is correct
28 Correct 265 ms 64708 KB Output is correct
29 Correct 463 ms 84196 KB Output is correct
30 Correct 595 ms 105816 KB Output is correct
31 Correct 770 ms 124744 KB Output is correct
32 Correct 12 ms 23764 KB Output is correct
33 Correct 12 ms 23756 KB Output is correct
34 Correct 12 ms 23764 KB Output is correct
35 Correct 12 ms 23744 KB Output is correct
36 Correct 12 ms 23792 KB Output is correct
37 Correct 12 ms 23764 KB Output is correct
38 Correct 12 ms 23704 KB Output is correct
39 Correct 12 ms 23764 KB Output is correct
40 Correct 13 ms 23764 KB Output is correct
41 Correct 13 ms 23808 KB Output is correct
42 Correct 14 ms 23720 KB Output is correct
43 Correct 14 ms 24084 KB Output is correct
44 Correct 16 ms 24160 KB Output is correct
45 Correct 331 ms 73080 KB Output is correct
46 Correct 451 ms 96412 KB Output is correct
47 Correct 450 ms 96060 KB Output is correct
48 Correct 12 ms 23764 KB Output is correct
49 Correct 12 ms 23804 KB Output is correct
50 Correct 12 ms 23700 KB Output is correct
51 Correct 12 ms 23764 KB Output is correct
52 Correct 12 ms 23792 KB Output is correct
53 Correct 15 ms 23808 KB Output is correct
54 Correct 12 ms 23764 KB Output is correct
55 Correct 853 ms 123300 KB Output is correct
56 Correct 13 ms 23736 KB Output is correct
57 Correct 16 ms 24660 KB Output is correct
58 Correct 25 ms 26848 KB Output is correct
59 Correct 23 ms 25352 KB Output is correct
60 Correct 359 ms 74628 KB Output is correct
61 Correct 582 ms 92604 KB Output is correct
62 Correct 723 ms 107072 KB Output is correct
63 Correct 882 ms 123692 KB Output is correct
64 Correct 12 ms 23808 KB Output is correct
65 Correct 12 ms 23764 KB Output is correct
66 Correct 13 ms 23884 KB Output is correct
67 Correct 690 ms 120748 KB Output is correct
68 Correct 663 ms 120956 KB Output is correct
69 Correct 654 ms 121856 KB Output is correct
70 Correct 16 ms 24252 KB Output is correct
71 Correct 20 ms 24840 KB Output is correct
72 Correct 321 ms 71284 KB Output is correct
73 Correct 531 ms 97472 KB Output is correct
74 Correct 820 ms 119052 KB Output is correct
75 Correct 824 ms 123344 KB Output is correct
76 Correct 648 ms 124372 KB Output is correct
77 Correct 16 ms 24540 KB Output is correct
78 Correct 23 ms 25072 KB Output is correct
79 Correct 348 ms 72240 KB Output is correct
80 Correct 549 ms 97572 KB Output is correct
81 Correct 909 ms 121924 KB Output is correct
82 Correct 20 ms 23764 KB Output is correct
83 Correct 20 ms 23784 KB Output is correct
84 Correct 18 ms 23764 KB Output is correct
85 Correct 895 ms 128500 KB Output is correct
86 Correct 736 ms 125792 KB Output is correct
87 Correct 692 ms 124308 KB Output is correct
88 Correct 515 ms 106328 KB Output is correct
89 Correct 293 ms 41252 KB Output is correct
90 Correct 500 ms 49036 KB Output is correct
91 Correct 370 ms 49076 KB Output is correct
92 Correct 623 ms 112004 KB Output is correct
93 Correct 739 ms 111956 KB Output is correct
94 Correct 866 ms 111984 KB Output is correct
95 Correct 734 ms 112060 KB Output is correct
96 Correct 13 ms 23764 KB Output is correct
97 Correct 45 ms 30828 KB Output is correct
98 Correct 107 ms 32888 KB Output is correct
99 Correct 657 ms 126556 KB Output is correct
100 Correct 23 ms 25188 KB Output is correct
101 Correct 75 ms 30592 KB Output is correct
102 Correct 178 ms 37408 KB Output is correct
103 Correct 252 ms 61272 KB Output is correct
104 Correct 391 ms 74644 KB Output is correct
105 Correct 531 ms 89684 KB Output is correct
106 Correct 713 ms 103156 KB Output is correct
107 Correct 828 ms 116660 KB Output is correct
108 Correct 13 ms 23764 KB Output is correct
109 Correct 13 ms 23832 KB Output is correct
110 Correct 13 ms 23752 KB Output is correct
111 Correct 13 ms 23808 KB Output is correct
112 Correct 13 ms 23808 KB Output is correct
113 Correct 14 ms 23764 KB Output is correct
114 Correct 13 ms 23764 KB Output is correct
115 Correct 13 ms 23804 KB Output is correct
116 Correct 14 ms 23812 KB Output is correct
117 Correct 14 ms 23764 KB Output is correct
118 Correct 14 ms 23760 KB Output is correct
119 Correct 14 ms 24020 KB Output is correct
120 Correct 19 ms 24108 KB Output is correct
121 Correct 325 ms 73036 KB Output is correct
122 Correct 529 ms 96584 KB Output is correct
123 Correct 474 ms 95956 KB Output is correct
124 Correct 15 ms 23764 KB Output is correct
125 Correct 14 ms 23764 KB Output is correct
126 Correct 13 ms 23764 KB Output is correct
127 Correct 679 ms 120692 KB Output is correct
128 Correct 663 ms 120988 KB Output is correct
129 Correct 671 ms 121888 KB Output is correct
130 Correct 17 ms 24276 KB Output is correct
131 Correct 21 ms 24784 KB Output is correct
132 Correct 319 ms 71404 KB Output is correct
133 Correct 561 ms 97468 KB Output is correct
134 Correct 735 ms 119036 KB Output is correct
135 Correct 667 ms 122748 KB Output is correct
136 Correct 730 ms 120124 KB Output is correct
137 Correct 749 ms 128576 KB Output is correct
138 Correct 818 ms 117704 KB Output is correct
139 Correct 689 ms 105932 KB Output is correct
140 Correct 13 ms 23764 KB Output is correct
141 Correct 89 ms 39020 KB Output is correct
142 Correct 34 ms 26884 KB Output is correct
143 Correct 132 ms 33952 KB Output is correct
144 Correct 226 ms 41160 KB Output is correct
145 Correct 378 ms 72224 KB Output is correct
146 Correct 479 ms 85028 KB Output is correct
147 Correct 613 ms 97684 KB Output is correct
148 Correct 772 ms 108932 KB Output is correct
149 Correct 810 ms 120144 KB Output is correct
150 Correct 830 ms 123252 KB Output is correct
151 Correct 664 ms 124356 KB Output is correct
152 Correct 17 ms 24532 KB Output is correct
153 Correct 20 ms 25096 KB Output is correct
154 Correct 334 ms 72360 KB Output is correct
155 Correct 567 ms 97692 KB Output is correct
156 Correct 794 ms 121768 KB Output is correct
157 Correct 12 ms 23764 KB Output is correct
158 Correct 11 ms 23808 KB Output is correct
159 Correct 12 ms 23764 KB Output is correct
160 Correct 13 ms 23808 KB Output is correct
161 Incorrect 1244 ms 123692 KB Tree @(1759, 1961) appears more than once: for edges on positions 71 and 73
162 Halted 0 ms 0 KB -