Submission #814388

# Submission time Handle Problem Language Result Execution time Memory
814388 2023-08-08T07:12:37 Z LittleCube Fountain Parks (IOI21_parks) C++17
70 / 100
886 ms 72184 KB
#pragma GCC optimize("Ofast,unroll-loops")
#include "parks.h"
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define F first
#define S second
using namespace std;

map<pii, int> id;
int n, m, deg[200000], dsu[200000], vis[400001], use[400001], hmm;
pii pos[400001];
vector<pair<pii, pii>> edge;
vector<pii> E[400001];
vector<int> ru, rv, bx, by;

int find(int k)
{
    return dsu[k] == k ? k : dsu[k] = find(dsu[k]);
}

void merge(int x, int y)
{
    x = find(x), y = find(y);
    dsu[x] = y;
}

int node(int x, int y)
{
    if (!id[pii(x, y)])
    {
        id[pii(x, y)] = ++m;
        pos[m] = pii(x, y);
    }
    return id[pii(x, y)];
}

void dfs(int u, int p)
{
    vis[u] = 1;
    int flag = 1;
    for (auto [v, i] : E[u])
        if (!vis[v])
            dfs(v, u);
    hmm += E[u].size();
    hmm -= 2;
    for (auto [v, i] : E[u])
        if (v != p && !use[i] && flag)
        {
            flag--;
            use[i] = 1;
            tie(bx[i], by[i]) = pos[u];
        }
    for (auto [v, i] : E[u])
        if (!use[i] && flag)
        {
            flag--;
            use[i] = 1;
            tie(bx[i], by[i]) = pos[u];
        }
}

int construct_roads(vector<int> x, vector<int> y)
{
    n = x.size();
    for (int i = 0; i < n; i++)
        dsu[i] = i;
    for (int i = 0; i < n; i++)
        id[pii(x[i], y[i])] = i + 1;

    bx.resize(n - 1), by.resize(n - 1);
    for (int i = 0; i < n; i++)
    {
        if (id.find(pii(x[i], y[i] - 2)) != id.end())
        {
            int j = id[pii(x[i], y[i] - 2)] - 1;
            merge(i, j);
            ru.emplace_back(i);
            rv.emplace_back(j);
        }
        if (id.find(pii(x[i] - 2, y[i])) != id.end())
        {
            int j = id[pii(x[i] - 2, y[i])] - 1;
            edge.emplace_back(make_pair(pii(x[i] - 1, y[i]), pii(i, j)));
        }
    }
    sort(edge.begin(), edge.end(), [&](pair<pii, pii> f, pair<pii, pii> s)
         {
        pii p = f.F, q = s.F;
        if(p.F != q.F)
            return p.F < q.F;
        if(p.F % 4 == 1)
            return p.S < q.S;
        return p.S > q.S; });
    mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
    shuffle(edge.begin(), edge.end(), rd);
    for (auto [_, p] : edge)
    {
        auto [u, v] = p;
        if (find(u) != find(v))
        {
            ru.emplace_back(u);
            rv.emplace_back(v);
            merge(u, v);
        }
    }
    if (ru.size() < n - 1)
        return 0;
    id.clear();
    for (int i = 0; i < n - 1; i++)
    {
        int u = ru[i], v = rv[i];
        if (x[u] == x[v])
        {
            int a = node(x[u] - 1, (y[u] + y[v]) / 2),
                b = node(x[u] + 1, (y[u] + y[v]) / 2);
            E[a].emplace_back(pii(b, i));
            E[b].emplace_back(pii(a, i));
        }
        else
        {
            int a = node((x[u] + x[v]) / 2, y[u] + 1),
                b = node((x[u] + x[v]) / 2, y[u] - 1);
            E[a].emplace_back(pii(b, i));
            E[b].emplace_back(pii(a, i));
        }
    }
    for (int i = 1; i <= m; i++)
        if (!vis[i])
        {
            hmm = 0;
            dfs(i, i);
        }
    for (int i = 0; i < n - 1; i++)
        if(!use[i])
            return 0;
    build(ru, rv, bx, by);
    return 1;
}

Compilation message

parks.cpp: In function 'int construct_roads(std::vector<int>, std::vector<int>)':
parks.cpp:108:19: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
  108 |     if (ru.size() < n - 1)
      |         ~~~~~~~~~~^~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 5 ms 9684 KB Output is correct
2 Correct 7 ms 9684 KB Output is correct
3 Correct 6 ms 9728 KB Output is correct
4 Correct 5 ms 9684 KB Output is correct
5 Correct 5 ms 9684 KB Output is correct
6 Correct 5 ms 9684 KB Output is correct
7 Correct 5 ms 9684 KB Output is correct
8 Correct 5 ms 9684 KB Output is correct
9 Correct 259 ms 37864 KB Output is correct
10 Correct 20 ms 12636 KB Output is correct
11 Correct 87 ms 24836 KB Output is correct
12 Correct 27 ms 14180 KB Output is correct
13 Correct 27 ms 14240 KB Output is correct
14 Correct 7 ms 9848 KB Output is correct
15 Correct 6 ms 9828 KB Output is correct
16 Correct 286 ms 37876 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 9684 KB Output is correct
2 Correct 7 ms 9684 KB Output is correct
3 Correct 6 ms 9728 KB Output is correct
4 Correct 5 ms 9684 KB Output is correct
5 Correct 5 ms 9684 KB Output is correct
6 Correct 5 ms 9684 KB Output is correct
7 Correct 5 ms 9684 KB Output is correct
8 Correct 5 ms 9684 KB Output is correct
9 Correct 259 ms 37864 KB Output is correct
10 Correct 20 ms 12636 KB Output is correct
11 Correct 87 ms 24836 KB Output is correct
12 Correct 27 ms 14180 KB Output is correct
13 Correct 27 ms 14240 KB Output is correct
14 Correct 7 ms 9848 KB Output is correct
15 Correct 6 ms 9828 KB Output is correct
16 Correct 286 ms 37876 KB Output is correct
17 Correct 6 ms 9684 KB Output is correct
18 Correct 6 ms 9684 KB Output is correct
19 Correct 6 ms 9684 KB Output is correct
20 Correct 5 ms 9684 KB Output is correct
21 Correct 5 ms 9648 KB Output is correct
22 Correct 7 ms 9684 KB Output is correct
23 Correct 886 ms 59724 KB Output is correct
24 Correct 6 ms 9684 KB Output is correct
25 Correct 7 ms 9940 KB Output is correct
26 Correct 7 ms 9952 KB Output is correct
27 Correct 9 ms 10112 KB Output is correct
28 Correct 210 ms 29512 KB Output is correct
29 Correct 367 ms 39696 KB Output is correct
30 Correct 635 ms 49744 KB Output is correct
31 Correct 801 ms 59948 KB Output is correct
32 Correct 5 ms 9684 KB Output is correct
33 Correct 5 ms 9684 KB Output is correct
34 Correct 5 ms 9684 KB Output is correct
35 Correct 5 ms 9684 KB Output is correct
36 Correct 5 ms 9684 KB Output is correct
37 Correct 5 ms 9672 KB Output is correct
38 Correct 5 ms 9684 KB Output is correct
39 Correct 7 ms 9684 KB Output is correct
40 Correct 6 ms 9684 KB Output is correct
41 Correct 6 ms 9684 KB Output is correct
42 Correct 5 ms 9684 KB Output is correct
43 Correct 7 ms 9812 KB Output is correct
44 Correct 9 ms 10036 KB Output is correct
45 Correct 271 ms 31724 KB Output is correct
46 Correct 529 ms 41680 KB Output is correct
47 Correct 447 ms 41720 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 9684 KB Output is correct
2 Correct 7 ms 9684 KB Output is correct
3 Correct 6 ms 9728 KB Output is correct
4 Correct 5 ms 9684 KB Output is correct
5 Correct 5 ms 9684 KB Output is correct
6 Correct 5 ms 9684 KB Output is correct
7 Correct 5 ms 9684 KB Output is correct
8 Correct 5 ms 9684 KB Output is correct
9 Correct 259 ms 37864 KB Output is correct
10 Correct 20 ms 12636 KB Output is correct
11 Correct 87 ms 24836 KB Output is correct
12 Correct 27 ms 14180 KB Output is correct
13 Correct 27 ms 14240 KB Output is correct
14 Correct 7 ms 9848 KB Output is correct
15 Correct 6 ms 9828 KB Output is correct
16 Correct 286 ms 37876 KB Output is correct
17 Correct 6 ms 9684 KB Output is correct
18 Correct 6 ms 9684 KB Output is correct
19 Correct 6 ms 9684 KB Output is correct
20 Correct 5 ms 9684 KB Output is correct
21 Correct 5 ms 9648 KB Output is correct
22 Correct 7 ms 9684 KB Output is correct
23 Correct 886 ms 59724 KB Output is correct
24 Correct 6 ms 9684 KB Output is correct
25 Correct 7 ms 9940 KB Output is correct
26 Correct 7 ms 9952 KB Output is correct
27 Correct 9 ms 10112 KB Output is correct
28 Correct 210 ms 29512 KB Output is correct
29 Correct 367 ms 39696 KB Output is correct
30 Correct 635 ms 49744 KB Output is correct
31 Correct 801 ms 59948 KB Output is correct
32 Correct 5 ms 9684 KB Output is correct
33 Correct 5 ms 9684 KB Output is correct
34 Correct 5 ms 9684 KB Output is correct
35 Correct 5 ms 9684 KB Output is correct
36 Correct 5 ms 9684 KB Output is correct
37 Correct 5 ms 9672 KB Output is correct
38 Correct 5 ms 9684 KB Output is correct
39 Correct 7 ms 9684 KB Output is correct
40 Correct 6 ms 9684 KB Output is correct
41 Correct 6 ms 9684 KB Output is correct
42 Correct 5 ms 9684 KB Output is correct
43 Correct 7 ms 9812 KB Output is correct
44 Correct 9 ms 10036 KB Output is correct
45 Correct 271 ms 31724 KB Output is correct
46 Correct 529 ms 41680 KB Output is correct
47 Correct 447 ms 41720 KB Output is correct
48 Correct 6 ms 9684 KB Output is correct
49 Correct 5 ms 9684 KB Output is correct
50 Correct 5 ms 9652 KB Output is correct
51 Correct 7 ms 9704 KB Output is correct
52 Correct 6 ms 9684 KB Output is correct
53 Correct 6 ms 9684 KB Output is correct
54 Correct 6 ms 9684 KB Output is correct
55 Correct 772 ms 56660 KB Output is correct
56 Correct 5 ms 9684 KB Output is correct
57 Correct 9 ms 10068 KB Output is correct
58 Correct 17 ms 11148 KB Output is correct
59 Correct 15 ms 10836 KB Output is correct
60 Correct 326 ms 33152 KB Output is correct
61 Correct 501 ms 41336 KB Output is correct
62 Correct 703 ms 49360 KB Output is correct
63 Correct 863 ms 57132 KB Output is correct
64 Correct 6 ms 9684 KB Output is correct
65 Correct 7 ms 9812 KB Output is correct
66 Correct 5 ms 9684 KB Output is correct
67 Correct 595 ms 66484 KB Output is correct
68 Correct 649 ms 66468 KB Output is correct
69 Correct 621 ms 66144 KB Output is correct
70 Correct 8 ms 10068 KB Output is correct
71 Correct 11 ms 10708 KB Output is correct
72 Correct 265 ms 33152 KB Output is correct
73 Correct 439 ms 42544 KB Output is correct
74 Correct 711 ms 56072 KB Output is correct
75 Correct 704 ms 62040 KB Output is correct
76 Correct 618 ms 66496 KB Output is correct
77 Correct 8 ms 10196 KB Output is correct
78 Correct 11 ms 10740 KB Output is correct
79 Correct 255 ms 34152 KB Output is correct
80 Correct 514 ms 44260 KB Output is correct
81 Correct 714 ms 58616 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 9684 KB Output is correct
2 Correct 7 ms 9684 KB Output is correct
3 Correct 6 ms 9728 KB Output is correct
4 Correct 5 ms 9684 KB Output is correct
5 Correct 5 ms 9684 KB Output is correct
6 Correct 5 ms 9684 KB Output is correct
7 Correct 5 ms 9684 KB Output is correct
8 Correct 5 ms 9684 KB Output is correct
9 Correct 259 ms 37864 KB Output is correct
10 Correct 20 ms 12636 KB Output is correct
11 Correct 87 ms 24836 KB Output is correct
12 Correct 27 ms 14180 KB Output is correct
13 Correct 27 ms 14240 KB Output is correct
14 Correct 7 ms 9848 KB Output is correct
15 Correct 6 ms 9828 KB Output is correct
16 Correct 286 ms 37876 KB Output is correct
17 Correct 5 ms 9684 KB Output is correct
18 Correct 5 ms 9684 KB Output is correct
19 Correct 5 ms 9700 KB Output is correct
20 Correct 652 ms 65776 KB Output is correct
21 Correct 646 ms 57028 KB Output is correct
22 Correct 665 ms 55956 KB Output is correct
23 Correct 485 ms 62676 KB Output is correct
24 Correct 207 ms 28036 KB Output is correct
25 Correct 333 ms 34144 KB Output is correct
26 Correct 275 ms 29868 KB Output is correct
27 Correct 711 ms 66408 KB Output is correct
28 Correct 678 ms 66400 KB Output is correct
29 Correct 708 ms 72172 KB Output is correct
30 Correct 681 ms 72184 KB Output is correct
31 Correct 6 ms 9704 KB Output is correct
32 Correct 38 ms 13268 KB Output is correct
33 Correct 78 ms 19044 KB Output is correct
34 Correct 646 ms 63296 KB Output is correct
35 Correct 14 ms 11012 KB Output is correct
36 Correct 55 ms 15548 KB Output is correct
37 Correct 137 ms 21024 KB Output is correct
38 Correct 196 ms 27804 KB Output is correct
39 Correct 308 ms 34472 KB Output is correct
40 Correct 407 ms 41492 KB Output is correct
41 Correct 531 ms 47740 KB Output is correct
42 Correct 686 ms 54776 KB Output is correct
43 Correct 5 ms 9684 KB Output is correct
44 Correct 5 ms 9684 KB Output is correct
45 Correct 5 ms 9684 KB Output is correct
46 Correct 5 ms 9704 KB Output is correct
47 Correct 5 ms 9684 KB Output is correct
48 Correct 5 ms 9684 KB Output is correct
49 Correct 5 ms 9684 KB Output is correct
50 Correct 5 ms 9620 KB Output is correct
51 Correct 5 ms 9700 KB Output is correct
52 Correct 6 ms 9684 KB Output is correct
53 Correct 5 ms 9684 KB Output is correct
54 Correct 7 ms 9940 KB Output is correct
55 Correct 7 ms 10068 KB Output is correct
56 Correct 269 ms 32268 KB Output is correct
57 Correct 456 ms 42180 KB Output is correct
58 Correct 414 ms 42256 KB Output is correct
59 Correct 5 ms 9684 KB Output is correct
60 Correct 7 ms 9684 KB Output is correct
61 Correct 5 ms 9700 KB Output is correct
62 Correct 591 ms 66460 KB Output is correct
63 Correct 638 ms 66420 KB Output is correct
64 Correct 666 ms 66216 KB Output is correct
65 Correct 8 ms 10196 KB Output is correct
66 Correct 9 ms 10580 KB Output is correct
67 Correct 241 ms 33064 KB Output is correct
68 Correct 411 ms 42484 KB Output is correct
69 Correct 728 ms 56080 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 9684 KB Output is correct
2 Correct 7 ms 9684 KB Output is correct
3 Correct 6 ms 9728 KB Output is correct
4 Correct 5 ms 9684 KB Output is correct
5 Correct 5 ms 9684 KB Output is correct
6 Correct 5 ms 9684 KB Output is correct
7 Correct 5 ms 9684 KB Output is correct
8 Correct 5 ms 9684 KB Output is correct
9 Correct 259 ms 37864 KB Output is correct
10 Correct 20 ms 12636 KB Output is correct
11 Correct 87 ms 24836 KB Output is correct
12 Correct 27 ms 14180 KB Output is correct
13 Correct 27 ms 14240 KB Output is correct
14 Correct 7 ms 9848 KB Output is correct
15 Correct 6 ms 9828 KB Output is correct
16 Correct 286 ms 37876 KB Output is correct
17 Correct 584 ms 71296 KB Output is correct
18 Correct 653 ms 71416 KB Output is correct
19 Correct 873 ms 64440 KB Output is correct
20 Correct 776 ms 56104 KB Output is correct
21 Correct 633 ms 57184 KB Output is correct
22 Correct 6 ms 9684 KB Output is correct
23 Correct 74 ms 17460 KB Output is correct
24 Correct 25 ms 12244 KB Output is correct
25 Correct 89 ms 18212 KB Output is correct
26 Correct 171 ms 24108 KB Output is correct
27 Correct 298 ms 33388 KB Output is correct
28 Correct 372 ms 39228 KB Output is correct
29 Correct 532 ms 45116 KB Output is correct
30 Correct 619 ms 50988 KB Output is correct
31 Correct 785 ms 56764 KB Output is correct
32 Correct 721 ms 61856 KB Output is correct
33 Correct 746 ms 66460 KB Output is correct
34 Correct 9 ms 10196 KB Output is correct
35 Correct 12 ms 10708 KB Output is correct
36 Correct 262 ms 34076 KB Output is correct
37 Correct 431 ms 44192 KB Output is correct
38 Correct 739 ms 58568 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 9684 KB Output is correct
2 Correct 7 ms 9684 KB Output is correct
3 Correct 6 ms 9728 KB Output is correct
4 Correct 5 ms 9684 KB Output is correct
5 Correct 5 ms 9684 KB Output is correct
6 Correct 5 ms 9684 KB Output is correct
7 Correct 5 ms 9684 KB Output is correct
8 Correct 5 ms 9684 KB Output is correct
9 Correct 259 ms 37864 KB Output is correct
10 Correct 20 ms 12636 KB Output is correct
11 Correct 87 ms 24836 KB Output is correct
12 Correct 27 ms 14180 KB Output is correct
13 Correct 27 ms 14240 KB Output is correct
14 Correct 7 ms 9848 KB Output is correct
15 Correct 6 ms 9828 KB Output is correct
16 Correct 286 ms 37876 KB Output is correct
17 Correct 6 ms 9684 KB Output is correct
18 Correct 6 ms 9684 KB Output is correct
19 Correct 6 ms 9684 KB Output is correct
20 Correct 5 ms 9684 KB Output is correct
21 Correct 5 ms 9648 KB Output is correct
22 Correct 7 ms 9684 KB Output is correct
23 Correct 886 ms 59724 KB Output is correct
24 Correct 6 ms 9684 KB Output is correct
25 Correct 7 ms 9940 KB Output is correct
26 Correct 7 ms 9952 KB Output is correct
27 Correct 9 ms 10112 KB Output is correct
28 Correct 210 ms 29512 KB Output is correct
29 Correct 367 ms 39696 KB Output is correct
30 Correct 635 ms 49744 KB Output is correct
31 Correct 801 ms 59948 KB Output is correct
32 Correct 5 ms 9684 KB Output is correct
33 Correct 5 ms 9684 KB Output is correct
34 Correct 5 ms 9684 KB Output is correct
35 Correct 5 ms 9684 KB Output is correct
36 Correct 5 ms 9684 KB Output is correct
37 Correct 5 ms 9672 KB Output is correct
38 Correct 5 ms 9684 KB Output is correct
39 Correct 7 ms 9684 KB Output is correct
40 Correct 6 ms 9684 KB Output is correct
41 Correct 6 ms 9684 KB Output is correct
42 Correct 5 ms 9684 KB Output is correct
43 Correct 7 ms 9812 KB Output is correct
44 Correct 9 ms 10036 KB Output is correct
45 Correct 271 ms 31724 KB Output is correct
46 Correct 529 ms 41680 KB Output is correct
47 Correct 447 ms 41720 KB Output is correct
48 Correct 6 ms 9684 KB Output is correct
49 Correct 5 ms 9684 KB Output is correct
50 Correct 5 ms 9652 KB Output is correct
51 Correct 7 ms 9704 KB Output is correct
52 Correct 6 ms 9684 KB Output is correct
53 Correct 6 ms 9684 KB Output is correct
54 Correct 6 ms 9684 KB Output is correct
55 Correct 772 ms 56660 KB Output is correct
56 Correct 5 ms 9684 KB Output is correct
57 Correct 9 ms 10068 KB Output is correct
58 Correct 17 ms 11148 KB Output is correct
59 Correct 15 ms 10836 KB Output is correct
60 Correct 326 ms 33152 KB Output is correct
61 Correct 501 ms 41336 KB Output is correct
62 Correct 703 ms 49360 KB Output is correct
63 Correct 863 ms 57132 KB Output is correct
64 Correct 6 ms 9684 KB Output is correct
65 Correct 7 ms 9812 KB Output is correct
66 Correct 5 ms 9684 KB Output is correct
67 Correct 595 ms 66484 KB Output is correct
68 Correct 649 ms 66468 KB Output is correct
69 Correct 621 ms 66144 KB Output is correct
70 Correct 8 ms 10068 KB Output is correct
71 Correct 11 ms 10708 KB Output is correct
72 Correct 265 ms 33152 KB Output is correct
73 Correct 439 ms 42544 KB Output is correct
74 Correct 711 ms 56072 KB Output is correct
75 Correct 704 ms 62040 KB Output is correct
76 Correct 618 ms 66496 KB Output is correct
77 Correct 8 ms 10196 KB Output is correct
78 Correct 11 ms 10740 KB Output is correct
79 Correct 255 ms 34152 KB Output is correct
80 Correct 514 ms 44260 KB Output is correct
81 Correct 714 ms 58616 KB Output is correct
82 Correct 5 ms 9684 KB Output is correct
83 Correct 5 ms 9684 KB Output is correct
84 Correct 5 ms 9700 KB Output is correct
85 Correct 652 ms 65776 KB Output is correct
86 Correct 646 ms 57028 KB Output is correct
87 Correct 665 ms 55956 KB Output is correct
88 Correct 485 ms 62676 KB Output is correct
89 Correct 207 ms 28036 KB Output is correct
90 Correct 333 ms 34144 KB Output is correct
91 Correct 275 ms 29868 KB Output is correct
92 Correct 711 ms 66408 KB Output is correct
93 Correct 678 ms 66400 KB Output is correct
94 Correct 708 ms 72172 KB Output is correct
95 Correct 681 ms 72184 KB Output is correct
96 Correct 6 ms 9704 KB Output is correct
97 Correct 38 ms 13268 KB Output is correct
98 Correct 78 ms 19044 KB Output is correct
99 Correct 646 ms 63296 KB Output is correct
100 Correct 14 ms 11012 KB Output is correct
101 Correct 55 ms 15548 KB Output is correct
102 Correct 137 ms 21024 KB Output is correct
103 Correct 196 ms 27804 KB Output is correct
104 Correct 308 ms 34472 KB Output is correct
105 Correct 407 ms 41492 KB Output is correct
106 Correct 531 ms 47740 KB Output is correct
107 Correct 686 ms 54776 KB Output is correct
108 Correct 5 ms 9684 KB Output is correct
109 Correct 5 ms 9684 KB Output is correct
110 Correct 5 ms 9684 KB Output is correct
111 Correct 5 ms 9704 KB Output is correct
112 Correct 5 ms 9684 KB Output is correct
113 Correct 5 ms 9684 KB Output is correct
114 Correct 5 ms 9684 KB Output is correct
115 Correct 5 ms 9620 KB Output is correct
116 Correct 5 ms 9700 KB Output is correct
117 Correct 6 ms 9684 KB Output is correct
118 Correct 5 ms 9684 KB Output is correct
119 Correct 7 ms 9940 KB Output is correct
120 Correct 7 ms 10068 KB Output is correct
121 Correct 269 ms 32268 KB Output is correct
122 Correct 456 ms 42180 KB Output is correct
123 Correct 414 ms 42256 KB Output is correct
124 Correct 5 ms 9684 KB Output is correct
125 Correct 7 ms 9684 KB Output is correct
126 Correct 5 ms 9700 KB Output is correct
127 Correct 591 ms 66460 KB Output is correct
128 Correct 638 ms 66420 KB Output is correct
129 Correct 666 ms 66216 KB Output is correct
130 Correct 8 ms 10196 KB Output is correct
131 Correct 9 ms 10580 KB Output is correct
132 Correct 241 ms 33064 KB Output is correct
133 Correct 411 ms 42484 KB Output is correct
134 Correct 728 ms 56080 KB Output is correct
135 Correct 584 ms 71296 KB Output is correct
136 Correct 653 ms 71416 KB Output is correct
137 Correct 873 ms 64440 KB Output is correct
138 Correct 776 ms 56104 KB Output is correct
139 Correct 633 ms 57184 KB Output is correct
140 Correct 6 ms 9684 KB Output is correct
141 Correct 74 ms 17460 KB Output is correct
142 Correct 25 ms 12244 KB Output is correct
143 Correct 89 ms 18212 KB Output is correct
144 Correct 171 ms 24108 KB Output is correct
145 Correct 298 ms 33388 KB Output is correct
146 Correct 372 ms 39228 KB Output is correct
147 Correct 532 ms 45116 KB Output is correct
148 Correct 619 ms 50988 KB Output is correct
149 Correct 785 ms 56764 KB Output is correct
150 Correct 721 ms 61856 KB Output is correct
151 Correct 746 ms 66460 KB Output is correct
152 Correct 9 ms 10196 KB Output is correct
153 Correct 12 ms 10708 KB Output is correct
154 Correct 262 ms 34076 KB Output is correct
155 Correct 431 ms 44192 KB Output is correct
156 Correct 739 ms 58568 KB Output is correct
157 Correct 5 ms 9684 KB Output is correct
158 Correct 5 ms 9712 KB Output is correct
159 Correct 5 ms 9612 KB Output is correct
160 Correct 6 ms 9700 KB Output is correct
161 Incorrect 775 ms 42260 KB Solution announced impossible, but it is possible.
162 Halted 0 ms 0 KB -