Submission #446642

# Submission time Handle Problem Language Result Execution time Memory
446642 2021-07-22T22:00:55 Z LucaDantas Fountain Parks (IOI21_parks) C++17
70 / 100
1079 ms 135140 KB
#include "parks.h"
#include <bits/stdc++.h>
using namespace std;

using pii = pair<int,int>;

template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { os << '['; string sep = ""; for (const auto &x : v) os << sep << x, sep = ", "; return os << ']'; }
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }
template<typename A> ostream& operator<<(ostream &os, const set<A> &s) { os << '{'; string sep = ""; for (const auto &x : s) os << sep << x, sep = ", "; return os << '}'; }
template<typename A, typename B> ostream& operator<<(ostream &os, const map<A, B> &m) { os << '{'; string sep = ""; for (const auto &x : m) os << sep << x.first << " -> " << x.second, sep = ", "; return os << '}'; }

void debug() { cerr << endl; }
template<typename Ini, typename... Fim> void debug(Ini I, Fim... F) { cerr << I; if(sizeof...(F)) cerr << ", "; debug(F...);}
#define db(...) cerr << "DEBUG (" << #__VA_ARGS__ << ") == ", debug(__VA_ARGS__)

#define pb push_back
#define sz(a) ((int)(a).size())
#define all(a) (a).begin(),(a).end()
#define ff first
#define ss second

constexpr int inf = 0x3f3f3f3f;
constexpr int maxn = 8e5 + 10;

mt19937 rng(random_device{}());

int rnd(int x) { return (rng() % x + x) % x; }

vector<int> pt[maxn], g[maxn];

int match[maxn];
bool mark[maxn];

int t, n, qtd_ruas;

bool dfs(int u) {
	mark[u] = 1;
	if(u >= qtd_ruas) return (match[u] == -1 ? 1 : dfs(match[u]));

	for(int v : g[u]) {
		if(mark[v] || !dfs(v)) continue;
		match[u] = v; match[v] = u;
		return 1;
	}

	return 0;
}

struct Road { // todas as ruas possiveis
	int x, y, tipo; // ponto inicial da rua e se é vertical ou horizontal
} ruas[maxn];

pii conecta[maxn];

struct Banco {
	int x, y;
} bancos[maxn];

map<pair<int,int>, int> mp; // salva o id dos pontos

inline void add(int a, int b) { g[a].pb(b), g[b].pb(a); }

int get(pii p) { 
	if(mp.count(p)) return mp[p];
	bancos[t] = {p.ff, p.ss};
	return mp[p] = t++;
}

bool mark2[maxn];
int vis = 0;

void vai(int x, int y) {
	++vis;
	int id = mp[pii(x, y)];
	mark2[id] = 1;
	if(mp.count({x+2, y}) && !mark2[mp[pii(x+2, y)]]) {
		conecta[t] = {id, mp[pii(x+2, y)]};
		ruas[t++] = {x, y, 0};
		// db(x, y, x+2, y);
		vai(x+2, y);
	}
	if(mp.count({x-2, y}) && !mark2[mp[pii(x-2, y)]]) {
		conecta[t] = {mp[pii(x-2, y)], id};
		ruas[t++] = {x-2, y, 0};
		// db(x, y, x-2, y);
		vai(x-2, y);
	}
	if(mp.count({x, y+2}) && !mark2[mp[pii(x, y+2)]]) {
		conecta[t] = {id, mp[pii(x, y+2)]};
		ruas[t++] = {x, y, 1};
		// db(x, y, x, y+2);
		vai(x, y+2);
	}
	if(mp.count({x, y-2}) && !mark2[mp[pii(x, y-2)]]) {
		conecta[t] = {mp[pii(x, y-2)], id};
		ruas[t++] = {x, y-2, 1};
		// db(x, y, x, y-2);
		vai(x, y-2);
	}
}

int construct_roads(vector<int> x, vector<int> y) {
	n = sz(x);
	for(int i = 0; i < n; i++)
		mp[pii(x[i], y[i])] = i;
	int hm = rnd(n);
	vai(x[hm], y[hm]);
	// vai(x[0], y[0]);
	if(vis != n) return 0; // impossivel, o grafo completo não é conexo
	
	qtd_ruas = t;
	for(int i = 0; i < qtd_ruas; i++) {
		auto [X, Y, tipo] = ruas[i];
		if(!tipo) {
			int aq = get({X+1, Y+1});
			add(i, aq);

			aq = get({X+1, Y-1});
			add(i, aq);
		} else {
			int aq = get({X+1, Y+1});
			add(i, aq);

			aq = get({X-1, Y+1});
			add(i, aq);
		}
	}

	int ans = 0;
	memset(match, -1, sizeof match);

	vector<int> p(qtd_ruas); iota(all(p), 0);

	for(int i = 0; i < t; i++)
		shuffle(all(g[i]), rng);

	for(int antes = -1; ans != antes;) {
		antes = ans;
		memset(mark, 0, sizeof mark);
		shuffle(all(p), rng);
		for(int i = 0; i < qtd_ruas; i++)
			if(!mark[p[i]] && match[p[i]] == -1 && dfs(p[i])) ++ans;
	}

	if(ans != qtd_ruas) return 0;
	
	vector<int> u(qtd_ruas), v(qtd_ruas), a(qtd_ruas), b(qtd_ruas);

	for(int i = 0; i < qtd_ruas; i++) {
		u[i] = conecta[i].ff, v[i] = conecta[i].ss;
		a[i] = bancos[match[i]].x, b[i] = bancos[match[i]].y;
	}
	build(u, v, a, b);
	return 1;
}
# Verdict Execution time Memory Grader output
1 Correct 26 ms 41676 KB Output is correct
2 Correct 27 ms 41744 KB Output is correct
3 Correct 23 ms 37852 KB Output is correct
4 Correct 26 ms 41804 KB Output is correct
5 Correct 26 ms 41820 KB Output is correct
6 Correct 24 ms 37804 KB Output is correct
7 Correct 24 ms 37836 KB Output is correct
8 Correct 24 ms 37836 KB Output is correct
9 Correct 330 ms 86012 KB Output is correct
10 Correct 51 ms 46400 KB Output is correct
11 Correct 190 ms 64432 KB Output is correct
12 Correct 65 ms 48580 KB Output is correct
13 Correct 68 ms 44848 KB Output is correct
14 Correct 25 ms 38000 KB Output is correct
15 Correct 25 ms 38092 KB Output is correct
16 Correct 328 ms 89924 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 41676 KB Output is correct
2 Correct 27 ms 41744 KB Output is correct
3 Correct 23 ms 37852 KB Output is correct
4 Correct 26 ms 41804 KB Output is correct
5 Correct 26 ms 41820 KB Output is correct
6 Correct 24 ms 37804 KB Output is correct
7 Correct 24 ms 37836 KB Output is correct
8 Correct 24 ms 37836 KB Output is correct
9 Correct 330 ms 86012 KB Output is correct
10 Correct 51 ms 46400 KB Output is correct
11 Correct 190 ms 64432 KB Output is correct
12 Correct 65 ms 48580 KB Output is correct
13 Correct 68 ms 44848 KB Output is correct
14 Correct 25 ms 38000 KB Output is correct
15 Correct 25 ms 38092 KB Output is correct
16 Correct 328 ms 89924 KB Output is correct
17 Correct 27 ms 41780 KB Output is correct
18 Correct 26 ms 41804 KB Output is correct
19 Correct 26 ms 41780 KB Output is correct
20 Correct 26 ms 41772 KB Output is correct
21 Correct 24 ms 37812 KB Output is correct
22 Correct 26 ms 41712 KB Output is correct
23 Correct 786 ms 112540 KB Output is correct
24 Correct 25 ms 41760 KB Output is correct
25 Correct 29 ms 42188 KB Output is correct
26 Correct 26 ms 38140 KB Output is correct
27 Correct 26 ms 38220 KB Output is correct
28 Correct 292 ms 68080 KB Output is correct
29 Correct 451 ms 86940 KB Output is correct
30 Correct 602 ms 95684 KB Output is correct
31 Correct 778 ms 106404 KB Output is correct
32 Correct 27 ms 41932 KB Output is correct
33 Correct 26 ms 41756 KB Output is correct
34 Correct 26 ms 41740 KB Output is correct
35 Correct 24 ms 37836 KB Output is correct
36 Correct 23 ms 37828 KB Output is correct
37 Correct 26 ms 41792 KB Output is correct
38 Correct 25 ms 41756 KB Output is correct
39 Correct 26 ms 41792 KB Output is correct
40 Correct 27 ms 41804 KB Output is correct
41 Correct 24 ms 37888 KB Output is correct
42 Correct 26 ms 41696 KB Output is correct
43 Correct 25 ms 37988 KB Output is correct
44 Correct 25 ms 38092 KB Output is correct
45 Correct 308 ms 75936 KB Output is correct
46 Correct 484 ms 96188 KB Output is correct
47 Correct 475 ms 89976 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 41676 KB Output is correct
2 Correct 27 ms 41744 KB Output is correct
3 Correct 23 ms 37852 KB Output is correct
4 Correct 26 ms 41804 KB Output is correct
5 Correct 26 ms 41820 KB Output is correct
6 Correct 24 ms 37804 KB Output is correct
7 Correct 24 ms 37836 KB Output is correct
8 Correct 24 ms 37836 KB Output is correct
9 Correct 330 ms 86012 KB Output is correct
10 Correct 51 ms 46400 KB Output is correct
11 Correct 190 ms 64432 KB Output is correct
12 Correct 65 ms 48580 KB Output is correct
13 Correct 68 ms 44848 KB Output is correct
14 Correct 25 ms 38000 KB Output is correct
15 Correct 25 ms 38092 KB Output is correct
16 Correct 328 ms 89924 KB Output is correct
17 Correct 27 ms 41780 KB Output is correct
18 Correct 26 ms 41804 KB Output is correct
19 Correct 26 ms 41780 KB Output is correct
20 Correct 26 ms 41772 KB Output is correct
21 Correct 24 ms 37812 KB Output is correct
22 Correct 26 ms 41712 KB Output is correct
23 Correct 786 ms 112540 KB Output is correct
24 Correct 25 ms 41760 KB Output is correct
25 Correct 29 ms 42188 KB Output is correct
26 Correct 26 ms 38140 KB Output is correct
27 Correct 26 ms 38220 KB Output is correct
28 Correct 292 ms 68080 KB Output is correct
29 Correct 451 ms 86940 KB Output is correct
30 Correct 602 ms 95684 KB Output is correct
31 Correct 778 ms 106404 KB Output is correct
32 Correct 27 ms 41932 KB Output is correct
33 Correct 26 ms 41756 KB Output is correct
34 Correct 26 ms 41740 KB Output is correct
35 Correct 24 ms 37836 KB Output is correct
36 Correct 23 ms 37828 KB Output is correct
37 Correct 26 ms 41792 KB Output is correct
38 Correct 25 ms 41756 KB Output is correct
39 Correct 26 ms 41792 KB Output is correct
40 Correct 27 ms 41804 KB Output is correct
41 Correct 24 ms 37888 KB Output is correct
42 Correct 26 ms 41696 KB Output is correct
43 Correct 25 ms 37988 KB Output is correct
44 Correct 25 ms 38092 KB Output is correct
45 Correct 308 ms 75936 KB Output is correct
46 Correct 484 ms 96188 KB Output is correct
47 Correct 475 ms 89976 KB Output is correct
48 Correct 26 ms 41788 KB Output is correct
49 Correct 27 ms 41788 KB Output is correct
50 Correct 25 ms 41776 KB Output is correct
51 Correct 26 ms 41716 KB Output is correct
52 Correct 26 ms 41748 KB Output is correct
53 Correct 26 ms 41796 KB Output is correct
54 Correct 26 ms 41796 KB Output is correct
55 Correct 815 ms 107244 KB Output is correct
56 Correct 26 ms 41748 KB Output is correct
57 Correct 32 ms 42308 KB Output is correct
58 Correct 41 ms 44104 KB Output is correct
59 Correct 33 ms 38868 KB Output is correct
60 Correct 374 ms 76036 KB Output is correct
61 Correct 534 ms 93300 KB Output is correct
62 Correct 654 ms 96220 KB Output is correct
63 Correct 829 ms 113320 KB Output is correct
64 Correct 24 ms 37836 KB Output is correct
65 Correct 26 ms 41796 KB Output is correct
66 Correct 25 ms 37788 KB Output is correct
67 Correct 682 ms 120344 KB Output is correct
68 Correct 692 ms 129596 KB Output is correct
69 Correct 699 ms 129452 KB Output is correct
70 Correct 27 ms 38248 KB Output is correct
71 Correct 29 ms 38576 KB Output is correct
72 Correct 341 ms 76712 KB Output is correct
73 Correct 534 ms 93344 KB Output is correct
74 Correct 727 ms 110148 KB Output is correct
75 Correct 768 ms 121596 KB Output is correct
76 Correct 686 ms 129712 KB Output is correct
77 Correct 28 ms 38316 KB Output is correct
78 Correct 30 ms 38708 KB Output is correct
79 Correct 343 ms 78532 KB Output is correct
80 Correct 539 ms 96684 KB Output is correct
81 Correct 737 ms 115220 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 41676 KB Output is correct
2 Correct 27 ms 41744 KB Output is correct
3 Correct 23 ms 37852 KB Output is correct
4 Correct 26 ms 41804 KB Output is correct
5 Correct 26 ms 41820 KB Output is correct
6 Correct 24 ms 37804 KB Output is correct
7 Correct 24 ms 37836 KB Output is correct
8 Correct 24 ms 37836 KB Output is correct
9 Correct 330 ms 86012 KB Output is correct
10 Correct 51 ms 46400 KB Output is correct
11 Correct 190 ms 64432 KB Output is correct
12 Correct 65 ms 48580 KB Output is correct
13 Correct 68 ms 44848 KB Output is correct
14 Correct 25 ms 38000 KB Output is correct
15 Correct 25 ms 38092 KB Output is correct
16 Correct 328 ms 89924 KB Output is correct
17 Correct 26 ms 41716 KB Output is correct
18 Correct 27 ms 41748 KB Output is correct
19 Correct 24 ms 37800 KB Output is correct
20 Correct 730 ms 115484 KB Output is correct
21 Correct 788 ms 110500 KB Output is correct
22 Correct 785 ms 113616 KB Output is correct
23 Correct 603 ms 117700 KB Output is correct
24 Correct 183 ms 53444 KB Output is correct
25 Correct 185 ms 53704 KB Output is correct
26 Correct 184 ms 53716 KB Output is correct
27 Correct 649 ms 118808 KB Output is correct
28 Correct 642 ms 118724 KB Output is correct
29 Correct 933 ms 118816 KB Output is correct
30 Correct 941 ms 118852 KB Output is correct
31 Correct 26 ms 41728 KB Output is correct
32 Correct 65 ms 47052 KB Output is correct
33 Correct 88 ms 45716 KB Output is correct
34 Correct 726 ms 110532 KB Output is correct
35 Correct 32 ms 38732 KB Output is correct
36 Correct 61 ms 42056 KB Output is correct
37 Correct 99 ms 45972 KB Output is correct
38 Correct 287 ms 65968 KB Output is correct
39 Correct 413 ms 75112 KB Output is correct
40 Correct 548 ms 84044 KB Output is correct
41 Correct 659 ms 93252 KB Output is correct
42 Correct 764 ms 102300 KB Output is correct
43 Correct 26 ms 41804 KB Output is correct
44 Correct 27 ms 41696 KB Output is correct
45 Correct 26 ms 41736 KB Output is correct
46 Correct 24 ms 37836 KB Output is correct
47 Correct 24 ms 37880 KB Output is correct
48 Correct 26 ms 41788 KB Output is correct
49 Correct 26 ms 41804 KB Output is correct
50 Correct 27 ms 41804 KB Output is correct
51 Correct 27 ms 41760 KB Output is correct
52 Correct 24 ms 37836 KB Output is correct
53 Correct 26 ms 41808 KB Output is correct
54 Correct 26 ms 38092 KB Output is correct
55 Correct 26 ms 38116 KB Output is correct
56 Correct 316 ms 76996 KB Output is correct
57 Correct 481 ms 97736 KB Output is correct
58 Correct 491 ms 96196 KB Output is correct
59 Correct 24 ms 37836 KB Output is correct
60 Correct 26 ms 41740 KB Output is correct
61 Correct 24 ms 37880 KB Output is correct
62 Correct 664 ms 119844 KB Output is correct
63 Correct 703 ms 129604 KB Output is correct
64 Correct 682 ms 123748 KB Output is correct
65 Correct 27 ms 38348 KB Output is correct
66 Correct 30 ms 38604 KB Output is correct
67 Correct 338 ms 76424 KB Output is correct
68 Correct 521 ms 92636 KB Output is correct
69 Correct 735 ms 111812 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 41676 KB Output is correct
2 Correct 27 ms 41744 KB Output is correct
3 Correct 23 ms 37852 KB Output is correct
4 Correct 26 ms 41804 KB Output is correct
5 Correct 26 ms 41820 KB Output is correct
6 Correct 24 ms 37804 KB Output is correct
7 Correct 24 ms 37836 KB Output is correct
8 Correct 24 ms 37836 KB Output is correct
9 Correct 330 ms 86012 KB Output is correct
10 Correct 51 ms 46400 KB Output is correct
11 Correct 190 ms 64432 KB Output is correct
12 Correct 65 ms 48580 KB Output is correct
13 Correct 68 ms 44848 KB Output is correct
14 Correct 25 ms 38000 KB Output is correct
15 Correct 25 ms 38092 KB Output is correct
16 Correct 328 ms 89924 KB Output is correct
17 Correct 749 ms 135140 KB Output is correct
18 Correct 714 ms 135108 KB Output is correct
19 Correct 805 ms 114768 KB Output is correct
20 Correct 937 ms 116668 KB Output is correct
21 Correct 774 ms 113648 KB Output is correct
22 Correct 26 ms 41796 KB Output is correct
23 Correct 122 ms 52588 KB Output is correct
24 Correct 44 ms 39956 KB Output is correct
25 Correct 79 ms 44100 KB Output is correct
26 Correct 120 ms 48068 KB Output is correct
27 Correct 418 ms 77076 KB Output is correct
28 Correct 552 ms 85832 KB Output is correct
29 Correct 646 ms 94788 KB Output is correct
30 Correct 730 ms 103468 KB Output is correct
31 Correct 890 ms 112372 KB Output is correct
32 Correct 760 ms 115736 KB Output is correct
33 Correct 684 ms 129700 KB Output is correct
34 Correct 28 ms 38348 KB Output is correct
35 Correct 29 ms 38600 KB Output is correct
36 Correct 351 ms 79000 KB Output is correct
37 Correct 541 ms 99796 KB Output is correct
38 Correct 721 ms 110760 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 41676 KB Output is correct
2 Correct 27 ms 41744 KB Output is correct
3 Correct 23 ms 37852 KB Output is correct
4 Correct 26 ms 41804 KB Output is correct
5 Correct 26 ms 41820 KB Output is correct
6 Correct 24 ms 37804 KB Output is correct
7 Correct 24 ms 37836 KB Output is correct
8 Correct 24 ms 37836 KB Output is correct
9 Correct 330 ms 86012 KB Output is correct
10 Correct 51 ms 46400 KB Output is correct
11 Correct 190 ms 64432 KB Output is correct
12 Correct 65 ms 48580 KB Output is correct
13 Correct 68 ms 44848 KB Output is correct
14 Correct 25 ms 38000 KB Output is correct
15 Correct 25 ms 38092 KB Output is correct
16 Correct 328 ms 89924 KB Output is correct
17 Correct 27 ms 41780 KB Output is correct
18 Correct 26 ms 41804 KB Output is correct
19 Correct 26 ms 41780 KB Output is correct
20 Correct 26 ms 41772 KB Output is correct
21 Correct 24 ms 37812 KB Output is correct
22 Correct 26 ms 41712 KB Output is correct
23 Correct 786 ms 112540 KB Output is correct
24 Correct 25 ms 41760 KB Output is correct
25 Correct 29 ms 42188 KB Output is correct
26 Correct 26 ms 38140 KB Output is correct
27 Correct 26 ms 38220 KB Output is correct
28 Correct 292 ms 68080 KB Output is correct
29 Correct 451 ms 86940 KB Output is correct
30 Correct 602 ms 95684 KB Output is correct
31 Correct 778 ms 106404 KB Output is correct
32 Correct 27 ms 41932 KB Output is correct
33 Correct 26 ms 41756 KB Output is correct
34 Correct 26 ms 41740 KB Output is correct
35 Correct 24 ms 37836 KB Output is correct
36 Correct 23 ms 37828 KB Output is correct
37 Correct 26 ms 41792 KB Output is correct
38 Correct 25 ms 41756 KB Output is correct
39 Correct 26 ms 41792 KB Output is correct
40 Correct 27 ms 41804 KB Output is correct
41 Correct 24 ms 37888 KB Output is correct
42 Correct 26 ms 41696 KB Output is correct
43 Correct 25 ms 37988 KB Output is correct
44 Correct 25 ms 38092 KB Output is correct
45 Correct 308 ms 75936 KB Output is correct
46 Correct 484 ms 96188 KB Output is correct
47 Correct 475 ms 89976 KB Output is correct
48 Correct 26 ms 41788 KB Output is correct
49 Correct 27 ms 41788 KB Output is correct
50 Correct 25 ms 41776 KB Output is correct
51 Correct 26 ms 41716 KB Output is correct
52 Correct 26 ms 41748 KB Output is correct
53 Correct 26 ms 41796 KB Output is correct
54 Correct 26 ms 41796 KB Output is correct
55 Correct 815 ms 107244 KB Output is correct
56 Correct 26 ms 41748 KB Output is correct
57 Correct 32 ms 42308 KB Output is correct
58 Correct 41 ms 44104 KB Output is correct
59 Correct 33 ms 38868 KB Output is correct
60 Correct 374 ms 76036 KB Output is correct
61 Correct 534 ms 93300 KB Output is correct
62 Correct 654 ms 96220 KB Output is correct
63 Correct 829 ms 113320 KB Output is correct
64 Correct 24 ms 37836 KB Output is correct
65 Correct 26 ms 41796 KB Output is correct
66 Correct 25 ms 37788 KB Output is correct
67 Correct 682 ms 120344 KB Output is correct
68 Correct 692 ms 129596 KB Output is correct
69 Correct 699 ms 129452 KB Output is correct
70 Correct 27 ms 38248 KB Output is correct
71 Correct 29 ms 38576 KB Output is correct
72 Correct 341 ms 76712 KB Output is correct
73 Correct 534 ms 93344 KB Output is correct
74 Correct 727 ms 110148 KB Output is correct
75 Correct 768 ms 121596 KB Output is correct
76 Correct 686 ms 129712 KB Output is correct
77 Correct 28 ms 38316 KB Output is correct
78 Correct 30 ms 38708 KB Output is correct
79 Correct 343 ms 78532 KB Output is correct
80 Correct 539 ms 96684 KB Output is correct
81 Correct 737 ms 115220 KB Output is correct
82 Correct 26 ms 41716 KB Output is correct
83 Correct 27 ms 41748 KB Output is correct
84 Correct 24 ms 37800 KB Output is correct
85 Correct 730 ms 115484 KB Output is correct
86 Correct 788 ms 110500 KB Output is correct
87 Correct 785 ms 113616 KB Output is correct
88 Correct 603 ms 117700 KB Output is correct
89 Correct 183 ms 53444 KB Output is correct
90 Correct 185 ms 53704 KB Output is correct
91 Correct 184 ms 53716 KB Output is correct
92 Correct 649 ms 118808 KB Output is correct
93 Correct 642 ms 118724 KB Output is correct
94 Correct 933 ms 118816 KB Output is correct
95 Correct 941 ms 118852 KB Output is correct
96 Correct 26 ms 41728 KB Output is correct
97 Correct 65 ms 47052 KB Output is correct
98 Correct 88 ms 45716 KB Output is correct
99 Correct 726 ms 110532 KB Output is correct
100 Correct 32 ms 38732 KB Output is correct
101 Correct 61 ms 42056 KB Output is correct
102 Correct 99 ms 45972 KB Output is correct
103 Correct 287 ms 65968 KB Output is correct
104 Correct 413 ms 75112 KB Output is correct
105 Correct 548 ms 84044 KB Output is correct
106 Correct 659 ms 93252 KB Output is correct
107 Correct 764 ms 102300 KB Output is correct
108 Correct 26 ms 41804 KB Output is correct
109 Correct 27 ms 41696 KB Output is correct
110 Correct 26 ms 41736 KB Output is correct
111 Correct 24 ms 37836 KB Output is correct
112 Correct 24 ms 37880 KB Output is correct
113 Correct 26 ms 41788 KB Output is correct
114 Correct 26 ms 41804 KB Output is correct
115 Correct 27 ms 41804 KB Output is correct
116 Correct 27 ms 41760 KB Output is correct
117 Correct 24 ms 37836 KB Output is correct
118 Correct 26 ms 41808 KB Output is correct
119 Correct 26 ms 38092 KB Output is correct
120 Correct 26 ms 38116 KB Output is correct
121 Correct 316 ms 76996 KB Output is correct
122 Correct 481 ms 97736 KB Output is correct
123 Correct 491 ms 96196 KB Output is correct
124 Correct 24 ms 37836 KB Output is correct
125 Correct 26 ms 41740 KB Output is correct
126 Correct 24 ms 37880 KB Output is correct
127 Correct 664 ms 119844 KB Output is correct
128 Correct 703 ms 129604 KB Output is correct
129 Correct 682 ms 123748 KB Output is correct
130 Correct 27 ms 38348 KB Output is correct
131 Correct 30 ms 38604 KB Output is correct
132 Correct 338 ms 76424 KB Output is correct
133 Correct 521 ms 92636 KB Output is correct
134 Correct 735 ms 111812 KB Output is correct
135 Correct 749 ms 135140 KB Output is correct
136 Correct 714 ms 135108 KB Output is correct
137 Correct 805 ms 114768 KB Output is correct
138 Correct 937 ms 116668 KB Output is correct
139 Correct 774 ms 113648 KB Output is correct
140 Correct 26 ms 41796 KB Output is correct
141 Correct 122 ms 52588 KB Output is correct
142 Correct 44 ms 39956 KB Output is correct
143 Correct 79 ms 44100 KB Output is correct
144 Correct 120 ms 48068 KB Output is correct
145 Correct 418 ms 77076 KB Output is correct
146 Correct 552 ms 85832 KB Output is correct
147 Correct 646 ms 94788 KB Output is correct
148 Correct 730 ms 103468 KB Output is correct
149 Correct 890 ms 112372 KB Output is correct
150 Correct 760 ms 115736 KB Output is correct
151 Correct 684 ms 129700 KB Output is correct
152 Correct 28 ms 38348 KB Output is correct
153 Correct 29 ms 38600 KB Output is correct
154 Correct 351 ms 79000 KB Output is correct
155 Correct 541 ms 99796 KB Output is correct
156 Correct 721 ms 110760 KB Output is correct
157 Correct 27 ms 41776 KB Output is correct
158 Correct 25 ms 37836 KB Output is correct
159 Correct 26 ms 41788 KB Output is correct
160 Correct 26 ms 41808 KB Output is correct
161 Correct 1079 ms 119896 KB Output is correct
162 Correct 702 ms 105880 KB Output is correct
163 Correct 752 ms 112632 KB Output is correct
164 Correct 751 ms 107240 KB Output is correct
165 Correct 855 ms 112192 KB Output is correct
166 Correct 907 ms 118916 KB Output is correct
167 Incorrect 167 ms 53956 KB Solution announced impossible, but it is possible.
168 Halted 0 ms 0 KB -