답안 #459577

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
459577 2021-08-08T16:59:05 Z valerikk Iqea (innopolis2018_final_C) C++17
100 / 100
1788 ms 103996 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N = 100010;
const int L = 20;
const int INF = 0x3f3f3f3f;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};

struct Point {
	int x;
	int y;
};

struct Segment {
	int x;
	int ly;
	int ry;
};

struct Item {
	int dist;
	int best;
	int v;
};

struct SegTree {
	int n;
	vector<int> mn;

	void upd(int pos, int val) {
		int i = pos + n;
		mn[i] = min(mn[i], val);
		for (; i > 1; i >>= 1) {
			mn[i >> 1] = min(mn[i], mn[i ^ 1]);
		} 
	}

	int get(int l, int r) {
		l += n, r += n;
		int res = INF;
		while (l < r) {
			if (l & 1) {
				res = min(res, mn[l]);
				++l;
			}
			if (r & 1) {
				--r;
				res = min(res, mn[r]);
			}
			l >>= 1, r >>= 1;
		}
		return res;
	}

	SegTree() = default;
	SegTree(int n_) : n(n_) {
		mn.assign(2 * n, INF);
	}
};

struct SegTree2 {
	int n;
	SegTree t1, t2;
	vector<int> mn;

	void upd(int pos, int val) {
		mn[pos] = min(mn[pos], val);
		t1.upd(pos, mn[pos] - pos);
		t2.upd(pos, mn[pos] + pos);
	}

	int get(int pos) {
		return min(t1.get(0, pos + 1) + pos, t2.get(pos, n) - pos);
	}

	SegTree2() = default;
	SegTree2(int n_) : n(n_), t1(n_), t2(n_) {
		mn.assign(n, INF);
	}
};

int n;
Point p[N];
map<pair<int, int>, int> who;
vector<int> by_x[N];
Segment s[N];
int scnt;
int id[N];
vector<int> g[N];
bool dead[N];
int sz[N];
vector<int> e[N];
bool fl[N];
pair<int, int> d[N];
int cp[N][L];
pair<int, int> cd[N][L];
vector<Item> have[N];
int lvl[N];
SegTree2 st[N];

int calc_sz(int u, int par = -1) {
	sz[u] = 1;
	for (int v : g[u]) {
		if (v != par && !dead[v]) {
			sz[u] += calc_sz(v, u);
		}
	}
	return sz[u];
}

int centroid(int u, int n, int par = -1) {
	for (int v : g[u]) {
		if (v != par && !dead[v] && 2 * sz[v] > n) {
			return centroid(v, n, u);
		}
	}
	return u;
}

void dfs(int u, vector<int> &vs, int par = -1) {
	for (int y = s[u].ly; y < s[u].ry; ++y) {
		vs.push_back(who[{s[u].x, y}]);
	}
	for (int v : g[u]) {
		if (v != par && !dead[v]) {
			dfs(v, vs, u);
		}
	}	
}

void go(int c) {
	vector<int> vs;
	dfs(c, vs);
	
	for (int u : vs) {
		fl[u] = true;
	}
	for (int u : vs) {
		for (int t = 0; t < 4; ++t) {
			auto it = who.find({p[u].x + dx[t], p[u].y + dy[t]});
			if (it != who.end()) {
				int v = it->second;
				if (fl[v]) {
					e[u].push_back(v);
					e[v].push_back(u);
				}
			}
		}
	}

	for (int u : vs) {
		d[u] = {INF, -1};
	}
	queue<int> q;
	for (int u : vs) {
		if (id[u] == c) {
			d[u] = {0, u};
			q.push(u);
		}
	}
	while (!q.empty()) {
		int u = q.front();
		q.pop();
		for (int v : e[u]) {
			if (d[u].first + 1 < d[v].first) {
				d[v] = {d[u].first + 1, d[u].second};
				q.push(v);
			}
		}
	}
	for (int u : vs) {
		have[c].push_back({d[u].first, d[u].second, u});
	}

	for (int u : vs) {
		fl[u] = false;
		e[u].clear();
	}


	dead[c] = true;
	for (int u : g[c]) {
		if (!dead[u]) {
			int nc = centroid(u, calc_sz(u));
			lvl[nc] = lvl[c] + 1;
			go(nc);
		}
	}
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> p[i].x >> p[i].y;
		who[{p[i].x, p[i].y}] = i;
		by_x[p[i].x].push_back(i);
	}

	for (int x = 0; x < N; ++x) {
		sort(by_x[x].begin(), by_x[x].end(), [&](const int &i, const int &j) {
			return p[i].y < p[j].y;
		});
		int l = -1, r = -1;
		for (int i : by_x[x]) {
			if (p[i].y == r) {
				++r; 
			} else {
				if (r != -1) {
					s[scnt++] = {x, l, r};
				}
				l = p[i].y, r = p[i].y + 1;
			}
		}
		if (r != -1) {
			s[scnt++] = {x, l, r};
		}
	}

	for (int i = 0; i < scnt; ++i) {
		for (int y = s[i].ly; y < s[i].ry; ++y) {
			id[who[{s[i].x, y}]] = i;
		}
	}
	for (int i = 0; i < n; ++i) {
		for (int t = 0; t < 4; ++t) {
			int nx = p[i].x + dx[t], ny = p[i].y + dy[t];
			if (who.count({nx, ny})) {
				int j = who[{nx, ny}];
				int u = id[i], v = id[j];
				if (u != v) {
					g[u].push_back(v);
					g[v].push_back(u);
				}
			}
		}
	}

	for (int i = 0; i < scnt; ++i) {
		sort(g[i].begin(), g[i].end());
		g[i].erase(unique(g[i].begin(), g[i].end()), g[i].end());
	}

	go(centroid(0, calc_sz(0)));

	memset(cp, 255, sizeof(cp));
	for (int i = 0; i < scnt; ++i) {
		for (auto it : have[i]) {
			int v = it.v;
			int h = lvl[id[v]] - lvl[i];
			cp[v][h] = i;
			cd[v][h] = {it.dist, it.best};
		}
	}

	for (int i = 0; i < scnt; ++i) {
		st[i] = SegTree2(s[i].ry - s[i].ly);
	}

	int q;
	cin >> q;
	while (q--) {
		int t, x, y;
		cin >> t >> x >> y;
		int v = who[{x, y}];
		if (t == 1) {
			for (int i = 0; cp[v][i] != -1; ++i) {
				int u = cp[v][i];
				auto [dist, best] = cd[v][i];
				int pos = p[best].y - s[u].ly;
				st[u].upd(pos, dist);
			}
		} else {
			int ans = INF;
			for (int i = 0; cp[v][i] != -1; ++i) {
				int u = cp[v][i];
				auto [dist, best] = cd[v][i];
				int pos = p[best].y - s[u].ly;
				ans = min(ans, dist + st[u].get(pos));
			}
			cout << (ans > n ? -1 : ans) << "\n";
		}
	}	
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 26868 KB Output is correct
2 Correct 15 ms 26956 KB Output is correct
3 Correct 15 ms 26988 KB Output is correct
4 Correct 39 ms 28760 KB Output is correct
5 Correct 41 ms 28960 KB Output is correct
6 Correct 44 ms 29124 KB Output is correct
7 Correct 51 ms 29508 KB Output is correct
8 Correct 57 ms 29540 KB Output is correct
9 Correct 51 ms 29596 KB Output is correct
10 Correct 43 ms 29144 KB Output is correct
11 Correct 44 ms 29272 KB Output is correct
12 Correct 47 ms 29252 KB Output is correct
13 Correct 47 ms 29492 KB Output is correct
14 Correct 47 ms 29404 KB Output is correct
15 Correct 49 ms 29440 KB Output is correct
16 Correct 51 ms 29508 KB Output is correct
17 Correct 50 ms 29728 KB Output is correct
18 Correct 43 ms 29180 KB Output is correct
19 Correct 45 ms 29080 KB Output is correct
20 Correct 50 ms 29508 KB Output is correct
21 Correct 50 ms 29464 KB Output is correct
22 Correct 64 ms 29940 KB Output is correct
23 Correct 52 ms 29916 KB Output is correct
24 Correct 52 ms 30096 KB Output is correct
25 Correct 53 ms 30364 KB Output is correct
26 Correct 33 ms 28948 KB Output is correct
27 Correct 26 ms 28560 KB Output is correct
28 Correct 52 ms 30000 KB Output is correct
29 Correct 54 ms 30104 KB Output is correct
30 Correct 52 ms 30148 KB Output is correct
31 Correct 52 ms 30104 KB Output is correct
32 Correct 51 ms 29556 KB Output is correct
33 Correct 49 ms 29604 KB Output is correct
34 Correct 53 ms 30024 KB Output is correct
35 Correct 52 ms 29592 KB Output is correct
36 Correct 60 ms 30652 KB Output is correct
37 Correct 51 ms 29504 KB Output is correct
38 Correct 49 ms 29636 KB Output is correct
39 Correct 50 ms 29680 KB Output is correct
40 Correct 49 ms 29564 KB Output is correct
41 Correct 53 ms 29916 KB Output is correct
42 Correct 53 ms 29892 KB Output is correct
43 Correct 51 ms 30184 KB Output is correct
44 Correct 48 ms 29636 KB Output is correct
45 Correct 48 ms 29512 KB Output is correct
46 Correct 28 ms 28584 KB Output is correct
47 Correct 47 ms 29380 KB Output is correct
48 Correct 47 ms 29416 KB Output is correct
49 Correct 47 ms 29312 KB Output is correct
50 Correct 48 ms 29236 KB Output is correct
51 Correct 45 ms 29252 KB Output is correct
52 Correct 44 ms 29300 KB Output is correct
53 Correct 50 ms 29756 KB Output is correct
54 Correct 49 ms 29480 KB Output is correct
55 Correct 49 ms 29436 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 26868 KB Output is correct
2 Correct 15 ms 26956 KB Output is correct
3 Correct 15 ms 26988 KB Output is correct
4 Correct 39 ms 28760 KB Output is correct
5 Correct 41 ms 28960 KB Output is correct
6 Correct 44 ms 29124 KB Output is correct
7 Correct 51 ms 29508 KB Output is correct
8 Correct 57 ms 29540 KB Output is correct
9 Correct 51 ms 29596 KB Output is correct
10 Correct 43 ms 29144 KB Output is correct
11 Correct 44 ms 29272 KB Output is correct
12 Correct 47 ms 29252 KB Output is correct
13 Correct 47 ms 29492 KB Output is correct
14 Correct 47 ms 29404 KB Output is correct
15 Correct 49 ms 29440 KB Output is correct
16 Correct 51 ms 29508 KB Output is correct
17 Correct 50 ms 29728 KB Output is correct
18 Correct 43 ms 29180 KB Output is correct
19 Correct 45 ms 29080 KB Output is correct
20 Correct 50 ms 29508 KB Output is correct
21 Correct 50 ms 29464 KB Output is correct
22 Correct 64 ms 29940 KB Output is correct
23 Correct 52 ms 29916 KB Output is correct
24 Correct 52 ms 30096 KB Output is correct
25 Correct 53 ms 30364 KB Output is correct
26 Correct 33 ms 28948 KB Output is correct
27 Correct 26 ms 28560 KB Output is correct
28 Correct 52 ms 30000 KB Output is correct
29 Correct 54 ms 30104 KB Output is correct
30 Correct 52 ms 30148 KB Output is correct
31 Correct 52 ms 30104 KB Output is correct
32 Correct 51 ms 29556 KB Output is correct
33 Correct 49 ms 29604 KB Output is correct
34 Correct 53 ms 30024 KB Output is correct
35 Correct 52 ms 29592 KB Output is correct
36 Correct 60 ms 30652 KB Output is correct
37 Correct 51 ms 29504 KB Output is correct
38 Correct 49 ms 29636 KB Output is correct
39 Correct 50 ms 29680 KB Output is correct
40 Correct 49 ms 29564 KB Output is correct
41 Correct 53 ms 29916 KB Output is correct
42 Correct 53 ms 29892 KB Output is correct
43 Correct 51 ms 30184 KB Output is correct
44 Correct 48 ms 29636 KB Output is correct
45 Correct 48 ms 29512 KB Output is correct
46 Correct 28 ms 28584 KB Output is correct
47 Correct 47 ms 29380 KB Output is correct
48 Correct 47 ms 29416 KB Output is correct
49 Correct 47 ms 29312 KB Output is correct
50 Correct 48 ms 29236 KB Output is correct
51 Correct 45 ms 29252 KB Output is correct
52 Correct 44 ms 29300 KB Output is correct
53 Correct 50 ms 29756 KB Output is correct
54 Correct 49 ms 29480 KB Output is correct
55 Correct 49 ms 29436 KB Output is correct
56 Correct 136 ms 30116 KB Output is correct
57 Correct 146 ms 30044 KB Output is correct
58 Correct 134 ms 30148 KB Output is correct
59 Correct 123 ms 31044 KB Output is correct
60 Correct 125 ms 30656 KB Output is correct
61 Correct 123 ms 31208 KB Output is correct
62 Correct 122 ms 30884 KB Output is correct
63 Correct 120 ms 30916 KB Output is correct
64 Correct 120 ms 30944 KB Output is correct
65 Correct 117 ms 30568 KB Output is correct
66 Correct 123 ms 30676 KB Output is correct
67 Correct 117 ms 30600 KB Output is correct
68 Correct 126 ms 31140 KB Output is correct
69 Correct 122 ms 30532 KB Output is correct
70 Correct 115 ms 30800 KB Output is correct
71 Correct 112 ms 30548 KB Output is correct
72 Correct 121 ms 31044 KB Output is correct
73 Correct 118 ms 30496 KB Output is correct
74 Correct 122 ms 32080 KB Output is correct
75 Correct 98 ms 30148 KB Output is correct
76 Correct 102 ms 30436 KB Output is correct
77 Correct 126 ms 31728 KB Output is correct
78 Correct 123 ms 31780 KB Output is correct
79 Correct 126 ms 32408 KB Output is correct
80 Correct 121 ms 31212 KB Output is correct
81 Correct 121 ms 31300 KB Output is correct
82 Correct 132 ms 31252 KB Output is correct
83 Correct 134 ms 31708 KB Output is correct
84 Correct 128 ms 31940 KB Output is correct
85 Correct 118 ms 30788 KB Output is correct
86 Correct 120 ms 30896 KB Output is correct
87 Correct 92 ms 29764 KB Output is correct
88 Correct 121 ms 31172 KB Output is correct
89 Correct 118 ms 30880 KB Output is correct
90 Correct 124 ms 31048 KB Output is correct
91 Correct 119 ms 30404 KB Output is correct
92 Correct 121 ms 30232 KB Output is correct
93 Correct 117 ms 30368 KB Output is correct
94 Correct 124 ms 31336 KB Output is correct
95 Correct 125 ms 31312 KB Output is correct
96 Correct 124 ms 31072 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 425 ms 59012 KB Output is correct
2 Correct 1503 ms 103464 KB Output is correct
3 Correct 1309 ms 86036 KB Output is correct
4 Correct 1280 ms 86020 KB Output is correct
5 Correct 1433 ms 95288 KB Output is correct
6 Correct 1404 ms 95152 KB Output is correct
7 Correct 1287 ms 78440 KB Output is correct
8 Correct 608 ms 64820 KB Output is correct
9 Correct 381 ms 60080 KB Output is correct
10 Correct 1391 ms 78376 KB Output is correct
11 Correct 682 ms 64724 KB Output is correct
12 Correct 400 ms 59852 KB Output is correct
13 Correct 388 ms 59144 KB Output is correct
14 Correct 375 ms 59036 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1424 ms 82640 KB Output is correct
2 Correct 1456 ms 84504 KB Output is correct
3 Correct 1477 ms 84580 KB Output is correct
4 Correct 1297 ms 79436 KB Output is correct
5 Correct 1330 ms 78704 KB Output is correct
6 Correct 1248 ms 78252 KB Output is correct
7 Correct 1377 ms 81240 KB Output is correct
8 Correct 1353 ms 81012 KB Output is correct
9 Correct 1382 ms 81528 KB Output is correct
10 Correct 1788 ms 91484 KB Output is correct
11 Correct 1455 ms 91080 KB Output is correct
12 Correct 1397 ms 93020 KB Output is correct
13 Correct 1511 ms 98928 KB Output is correct
14 Correct 704 ms 69296 KB Output is correct
15 Correct 386 ms 60716 KB Output is correct
16 Correct 1508 ms 94224 KB Output is correct
17 Correct 1522 ms 94004 KB Output is correct
18 Correct 1498 ms 95120 KB Output is correct
19 Correct 1403 ms 95244 KB Output is correct
20 Correct 1530 ms 84412 KB Output is correct
21 Correct 1399 ms 85308 KB Output is correct
22 Correct 1388 ms 91332 KB Output is correct
23 Correct 1624 ms 84800 KB Output is correct
24 Correct 1489 ms 103996 KB Output is correct
25 Correct 1299 ms 85504 KB Output is correct
26 Correct 1344 ms 85396 KB Output is correct
27 Correct 1414 ms 85848 KB Output is correct
28 Correct 1300 ms 85908 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 26868 KB Output is correct
2 Correct 15 ms 26956 KB Output is correct
3 Correct 15 ms 26988 KB Output is correct
4 Correct 39 ms 28760 KB Output is correct
5 Correct 41 ms 28960 KB Output is correct
6 Correct 44 ms 29124 KB Output is correct
7 Correct 51 ms 29508 KB Output is correct
8 Correct 57 ms 29540 KB Output is correct
9 Correct 51 ms 29596 KB Output is correct
10 Correct 43 ms 29144 KB Output is correct
11 Correct 44 ms 29272 KB Output is correct
12 Correct 47 ms 29252 KB Output is correct
13 Correct 47 ms 29492 KB Output is correct
14 Correct 47 ms 29404 KB Output is correct
15 Correct 49 ms 29440 KB Output is correct
16 Correct 51 ms 29508 KB Output is correct
17 Correct 50 ms 29728 KB Output is correct
18 Correct 43 ms 29180 KB Output is correct
19 Correct 45 ms 29080 KB Output is correct
20 Correct 50 ms 29508 KB Output is correct
21 Correct 50 ms 29464 KB Output is correct
22 Correct 64 ms 29940 KB Output is correct
23 Correct 52 ms 29916 KB Output is correct
24 Correct 52 ms 30096 KB Output is correct
25 Correct 53 ms 30364 KB Output is correct
26 Correct 33 ms 28948 KB Output is correct
27 Correct 26 ms 28560 KB Output is correct
28 Correct 52 ms 30000 KB Output is correct
29 Correct 54 ms 30104 KB Output is correct
30 Correct 52 ms 30148 KB Output is correct
31 Correct 52 ms 30104 KB Output is correct
32 Correct 51 ms 29556 KB Output is correct
33 Correct 49 ms 29604 KB Output is correct
34 Correct 53 ms 30024 KB Output is correct
35 Correct 52 ms 29592 KB Output is correct
36 Correct 60 ms 30652 KB Output is correct
37 Correct 51 ms 29504 KB Output is correct
38 Correct 49 ms 29636 KB Output is correct
39 Correct 50 ms 29680 KB Output is correct
40 Correct 49 ms 29564 KB Output is correct
41 Correct 53 ms 29916 KB Output is correct
42 Correct 53 ms 29892 KB Output is correct
43 Correct 51 ms 30184 KB Output is correct
44 Correct 48 ms 29636 KB Output is correct
45 Correct 48 ms 29512 KB Output is correct
46 Correct 28 ms 28584 KB Output is correct
47 Correct 47 ms 29380 KB Output is correct
48 Correct 47 ms 29416 KB Output is correct
49 Correct 47 ms 29312 KB Output is correct
50 Correct 48 ms 29236 KB Output is correct
51 Correct 45 ms 29252 KB Output is correct
52 Correct 44 ms 29300 KB Output is correct
53 Correct 50 ms 29756 KB Output is correct
54 Correct 49 ms 29480 KB Output is correct
55 Correct 49 ms 29436 KB Output is correct
56 Correct 136 ms 30116 KB Output is correct
57 Correct 146 ms 30044 KB Output is correct
58 Correct 134 ms 30148 KB Output is correct
59 Correct 123 ms 31044 KB Output is correct
60 Correct 125 ms 30656 KB Output is correct
61 Correct 123 ms 31208 KB Output is correct
62 Correct 122 ms 30884 KB Output is correct
63 Correct 120 ms 30916 KB Output is correct
64 Correct 120 ms 30944 KB Output is correct
65 Correct 117 ms 30568 KB Output is correct
66 Correct 123 ms 30676 KB Output is correct
67 Correct 117 ms 30600 KB Output is correct
68 Correct 126 ms 31140 KB Output is correct
69 Correct 122 ms 30532 KB Output is correct
70 Correct 115 ms 30800 KB Output is correct
71 Correct 112 ms 30548 KB Output is correct
72 Correct 121 ms 31044 KB Output is correct
73 Correct 118 ms 30496 KB Output is correct
74 Correct 122 ms 32080 KB Output is correct
75 Correct 98 ms 30148 KB Output is correct
76 Correct 102 ms 30436 KB Output is correct
77 Correct 126 ms 31728 KB Output is correct
78 Correct 123 ms 31780 KB Output is correct
79 Correct 126 ms 32408 KB Output is correct
80 Correct 121 ms 31212 KB Output is correct
81 Correct 121 ms 31300 KB Output is correct
82 Correct 132 ms 31252 KB Output is correct
83 Correct 134 ms 31708 KB Output is correct
84 Correct 128 ms 31940 KB Output is correct
85 Correct 118 ms 30788 KB Output is correct
86 Correct 120 ms 30896 KB Output is correct
87 Correct 92 ms 29764 KB Output is correct
88 Correct 121 ms 31172 KB Output is correct
89 Correct 118 ms 30880 KB Output is correct
90 Correct 124 ms 31048 KB Output is correct
91 Correct 119 ms 30404 KB Output is correct
92 Correct 121 ms 30232 KB Output is correct
93 Correct 117 ms 30368 KB Output is correct
94 Correct 124 ms 31336 KB Output is correct
95 Correct 125 ms 31312 KB Output is correct
96 Correct 124 ms 31072 KB Output is correct
97 Correct 425 ms 59012 KB Output is correct
98 Correct 1503 ms 103464 KB Output is correct
99 Correct 1309 ms 86036 KB Output is correct
100 Correct 1280 ms 86020 KB Output is correct
101 Correct 1433 ms 95288 KB Output is correct
102 Correct 1404 ms 95152 KB Output is correct
103 Correct 1287 ms 78440 KB Output is correct
104 Correct 608 ms 64820 KB Output is correct
105 Correct 381 ms 60080 KB Output is correct
106 Correct 1391 ms 78376 KB Output is correct
107 Correct 682 ms 64724 KB Output is correct
108 Correct 400 ms 59852 KB Output is correct
109 Correct 388 ms 59144 KB Output is correct
110 Correct 375 ms 59036 KB Output is correct
111 Correct 1424 ms 82640 KB Output is correct
112 Correct 1456 ms 84504 KB Output is correct
113 Correct 1477 ms 84580 KB Output is correct
114 Correct 1297 ms 79436 KB Output is correct
115 Correct 1330 ms 78704 KB Output is correct
116 Correct 1248 ms 78252 KB Output is correct
117 Correct 1377 ms 81240 KB Output is correct
118 Correct 1353 ms 81012 KB Output is correct
119 Correct 1382 ms 81528 KB Output is correct
120 Correct 1788 ms 91484 KB Output is correct
121 Correct 1455 ms 91080 KB Output is correct
122 Correct 1397 ms 93020 KB Output is correct
123 Correct 1511 ms 98928 KB Output is correct
124 Correct 704 ms 69296 KB Output is correct
125 Correct 386 ms 60716 KB Output is correct
126 Correct 1508 ms 94224 KB Output is correct
127 Correct 1522 ms 94004 KB Output is correct
128 Correct 1498 ms 95120 KB Output is correct
129 Correct 1403 ms 95244 KB Output is correct
130 Correct 1530 ms 84412 KB Output is correct
131 Correct 1399 ms 85308 KB Output is correct
132 Correct 1388 ms 91332 KB Output is correct
133 Correct 1624 ms 84800 KB Output is correct
134 Correct 1489 ms 103996 KB Output is correct
135 Correct 1299 ms 85504 KB Output is correct
136 Correct 1344 ms 85396 KB Output is correct
137 Correct 1414 ms 85848 KB Output is correct
138 Correct 1300 ms 85908 KB Output is correct
139 Correct 630 ms 55464 KB Output is correct
140 Correct 1131 ms 71108 KB Output is correct
141 Correct 1107 ms 70744 KB Output is correct
142 Correct 1141 ms 73624 KB Output is correct
143 Correct 1378 ms 80636 KB Output is correct
144 Correct 1399 ms 78828 KB Output is correct
145 Correct 1234 ms 74672 KB Output is correct
146 Correct 1094 ms 72092 KB Output is correct
147 Correct 1449 ms 80936 KB Output is correct
148 Correct 1367 ms 80668 KB Output is correct
149 Correct 1481 ms 90908 KB Output is correct
150 Correct 1374 ms 87992 KB Output is correct
151 Correct 1264 ms 94284 KB Output is correct
152 Correct 1259 ms 82696 KB Output is correct
153 Correct 1317 ms 80140 KB Output is correct
154 Correct 406 ms 57580 KB Output is correct
155 Correct 1326 ms 80152 KB Output is correct
156 Correct 1290 ms 78980 KB Output is correct
157 Correct 1291 ms 79248 KB Output is correct
158 Correct 1230 ms 77484 KB Output is correct
159 Correct 1272 ms 76808 KB Output is correct
160 Correct 1397 ms 79288 KB Output is correct
161 Correct 1498 ms 86664 KB Output is correct
162 Correct 1360 ms 83896 KB Output is correct
163 Correct 1371 ms 84004 KB Output is correct