Submission #801943

# Submission time Handle Problem Language Result Execution time Memory
801943 2023-08-02T08:32:29 Z 이온조(#10130) IOI Fever (JOI21_fever) C++17
100 / 100
917 ms 62532 KB
#include <bits/stdc++.h>
#define sz(V) ((int)V.size())
using namespace std;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
const int INF = 1e9;

int N, X[100009], Y[100009], ans = 1;

void comp(vector<int> &P) {
	sort(P.begin(), P.end());
	P.resize(unique(P.begin(), P.end()) - P.begin());
}

int get(vector<int> &P, int x) {
	return lower_bound(P.begin(), P.end(), x) - P.begin();
}

int f(int p, int q) {
	return max(X[p] - X[q], X[q] - X[p]) + max(Y[p] - Y[q], Y[q] - Y[p]);
}

int g(vector<int> &V, int x, int y, int v) {
	int l = 0, r = sz(V) - 1, f = -1;
	while(l <= r) {
		int m = l+r >> 1;
		if(v <= X[V[m]]*x + Y[V[m]]*y) r = m-1, f = V[m];
		else l = m+1;
	}
	return f;
}

void solve() {
	vector<int> D(N);
	for(int i=1; i<N; i++) {
		if(X[i] + Y[i] <= 0 && X[i] - Y[i] <= 0) D[i] = 0;
		if(X[i] + Y[i] > 0 && X[i] - Y[i] <= 0) D[i] = 1;
		if(X[i] + Y[i] > 0 && X[i] - Y[i] > 0) D[i] = 2;
		if(X[i] + Y[i] <= 0 && X[i] - Y[i] > 0) D[i] = 3;
	}
	vector<int> XP(N), YP(N), PP(N), QP(N), LI(N), PI(N), QI(N);
	for(int i=0; i<N; i++) {
		XP[i] = X[i];
		YP[i] = Y[i];
		PP[i] = X[i] + Y[i];
		QP[i] = X[i] - Y[i];
	}
	comp(XP); comp(YP); comp(PP); comp(QP);
	vector<vector<int>> LV[4], PV[4], QV[4];
	vector<vector<tiii>> G[4];
	for(int d=0; d<4; d++) {
		if(d&1) LV[d].resize(sz(XP));
		else LV[d].resize(sz(YP));
		PV[d].resize(sz(PP));
		QV[d].resize(sz(QP));
		G[d].resize(N);
	}
	for(int i=0; i<N; i++) {
		if(D[i]&1) LV[D[i]][LI[i] = get(XP, X[i])].push_back(i);
		else LV[D[i]][LI[i] = get(YP, Y[i])].push_back(i);
		PV[D[i]][PI[i] = get(PP, X[i] + Y[i])].push_back(i);
		QV[D[i]][QI[i] = get(QP, X[i] - Y[i])].push_back(i);
	}
	for(int d=0, p; d<4; d++) {
		for(auto& jt: LV[d]) {
			sort(jt.begin(), jt.end(), [&](int p, int q) {
				if(d == 0 || d == 3) return X[p] + Y[p] > X[q] + Y[q];
				return X[p] + Y[p] < X[q] + Y[q];
			});
			p = -1;
			for(auto& it: jt) {
				if(p != -1) G[1][p].push_back({1, it, f(it, p) >> 1});
				p = it;
			}
		}

		for(auto& jt: PV[d]) {
			sort(jt.begin(), jt.end(), [&](int p, int q) {
				if(d == 0 || d == 1) return X[p] > X[q];
				return X[p] < X[q];
			});
			p = -1;
			for(auto& it: jt) {
				if(p != -1) G[2][p].push_back({2, it, f(it, p) >> 1});
				p = it;
			}
		}
		
		for(auto& jt: QV[d]) {
			sort(jt.begin(), jt.end(), [&](int p, int q) {
				if(d == 0 || d == 3) return X[p] > X[q];
				return X[p] < X[q];
			});
			p = -1;
			for(auto& it: jt) {
				if(p != -1) G[3][p].push_back({3, it, f(it, p) >> 1});
				p = it;
			}
		}
	}
	for(int i=1; i<=3; i++) for(int j=0; j<N; j++) G[i][j].push_back({0, j, 0});

	vector<int> L[4];
	for(int d=0; d<4; d++) L[d] = vector<int>(N, INF + 9);
	priority_queue<tiii> pq; pq.push({L[0][0] = 0, 0, 0});
	while(pq.size()) {
		auto [l, t, x] = pq.top(); pq.pop(); l = -l;
		if(L[t][x] != l) continue;
		if(t == 0) {
			int lv, pv, qv;
			if(D[x] == 0) {
				lv = g(LV[D[x] ^ 2][LI[x]], 1, 0, X[x] + 2*l);
				pv = g(PV[D[x] ^ 3][PI[x]], 1, 0, X[x] + l);
				qv = g(QV[D[x] ^ 1][QI[x]], 1, 0, X[x] + l);
			}
			if(D[x] == 1) {
				lv = g(LV[D[x] ^ 2][LI[x]], 0, -1, -(Y[x] - 2*l));
				pv = g(PV[D[x] ^ 3][PI[x]], 1, 0, X[x] + l);
				qv = g(QV[D[x] ^ 1][QI[x]], -1, 0, -(X[x] - l));
			}
			if(D[x] == 2) {
				lv = g(LV[D[x] ^ 2][LI[x]], -1, 0, -(X[x] - 2*l));
				pv = g(PV[D[x] ^ 3][PI[x]], -1, 0, -(X[x] - l));
				qv = g(QV[D[x] ^ 1][QI[x]], -1, 0, -(X[x] - l));
			}
			if(D[x] == 3) {
				lv = g(LV[D[x] ^ 2][LI[x]], 0, 1, Y[x] + 2*l);
				pv = g(PV[D[x] ^ 3][PI[x]], -1, 0, -(X[x] - l));
				qv = g(QV[D[x] ^ 1][QI[x]], 1, 0, X[x] + l);
			}

			if(lv != -1) {
				int c = f(x, lv) >> 1;
				if(L[1][lv] > c) {
					L[1][lv] = c;
					pq.push({-c, 1, lv});
				}
			}
			if(pv != -1) {
				int c = f(x, pv) >> 1;
				if(L[2][pv] > c) {
					L[2][pv] = c;
					pq.push({-c, 2, pv});
				}
			}
			if(qv != -1) {
				int c = f(x, qv) >> 1;
				if(L[3][qv] > c) {
					L[3][qv] = c;
					pq.push({-c, 3, qv});
				}
			}
		}
		else {
			for(auto& [it, ix, c]: G[t][x]) if(l + c < L[it][ix]) {
				L[it][ix] = l + c;
				pq.push({-L[it][ix], it, ix});
			}
		}
	}
	int cnt = 0;
	for(int i=0; i<N; i++) if(L[0][i] != INF + 9) ++cnt;
	ans = max(ans, cnt);
}

int main() {
	int x0, y0; scanf("%d%d%d", &N, &x0, &y0);
	for(int i=1; i<N; i++) {
		scanf("%d%d", &X[i], &Y[i]);
		X[i] -= x0; Y[i] -= y0;
		X[i] *= 2; Y[i] *= 2;
	}
	for(int d=0; d<4; d++) {
		solve();
		for(int i=0; i<N; i++) {
			swap(X[i], Y[i]);
			X[i] = -X[i];
		}
	}
	printf("%d", ans);
	return 0;
}

Compilation message

fever.cpp: In function 'int g(std::vector<int>&, int, int, int)':
fever.cpp:26:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   26 |   int m = l+r >> 1;
      |           ~^~
fever.cpp: In function 'int main()':
fever.cpp:167:19: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  167 |  int x0, y0; scanf("%d%d%d", &N, &x0, &y0);
      |              ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
fever.cpp:169:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  169 |   scanf("%d%d", &X[i], &Y[i]);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~
fever.cpp: In function 'void solve()':
fever.cpp:147:14: warning: 'qv' may be used uninitialized in this function [-Wmaybe-uninitialized]
  147 |     int c = f(x, qv) >> 1;
      |             ~^~~~~~~
fever.cpp:140:14: warning: 'pv' may be used uninitialized in this function [-Wmaybe-uninitialized]
  140 |     int c = f(x, pv) >> 1;
      |             ~^~~~~~~
fever.cpp:133:14: warning: 'lv' may be used uninitialized in this function [-Wmaybe-uninitialized]
  133 |     int c = f(x, lv) >> 1;
      |             ~^~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 264 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 1 ms 212 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 264 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 1 ms 212 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 0 ms 212 KB Output is correct
37 Correct 0 ms 212 KB Output is correct
38 Correct 0 ms 212 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 1 ms 212 KB Output is correct
41 Correct 0 ms 212 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 0 ms 212 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 264 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 1 ms 212 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 0 ms 212 KB Output is correct
37 Correct 0 ms 212 KB Output is correct
38 Correct 0 ms 212 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 1 ms 212 KB Output is correct
41 Correct 0 ms 212 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 0 ms 212 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 0 ms 212 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 364 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
52 Correct 1 ms 340 KB Output is correct
53 Correct 1 ms 340 KB Output is correct
54 Correct 1 ms 340 KB Output is correct
55 Correct 1 ms 340 KB Output is correct
56 Correct 1 ms 340 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 1 ms 340 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 1 ms 340 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 340 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 264 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 1 ms 212 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 0 ms 212 KB Output is correct
37 Correct 0 ms 212 KB Output is correct
38 Correct 0 ms 212 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 1 ms 212 KB Output is correct
41 Correct 0 ms 212 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 0 ms 212 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 0 ms 212 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 364 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
52 Correct 1 ms 340 KB Output is correct
53 Correct 1 ms 340 KB Output is correct
54 Correct 1 ms 340 KB Output is correct
55 Correct 1 ms 340 KB Output is correct
56 Correct 1 ms 340 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 1 ms 340 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 1 ms 340 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 340 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 10 ms 1980 KB Output is correct
67 Correct 13 ms 1956 KB Output is correct
68 Correct 10 ms 2132 KB Output is correct
69 Correct 18 ms 1108 KB Output is correct
70 Correct 13 ms 1272 KB Output is correct
71 Correct 11 ms 1348 KB Output is correct
72 Correct 10 ms 1868 KB Output is correct
73 Correct 10 ms 2132 KB Output is correct
74 Correct 11 ms 1748 KB Output is correct
75 Correct 12 ms 1872 KB Output is correct
76 Correct 11 ms 2004 KB Output is correct
77 Correct 10 ms 1748 KB Output is correct
78 Correct 10 ms 2004 KB Output is correct
79 Correct 10 ms 2004 KB Output is correct
80 Correct 11 ms 2140 KB Output is correct
81 Correct 11 ms 2020 KB Output is correct
82 Correct 11 ms 1956 KB Output is correct
83 Correct 10 ms 1964 KB Output is correct
84 Correct 7 ms 1500 KB Output is correct
85 Correct 6 ms 1108 KB Output is correct
86 Correct 9 ms 1124 KB Output is correct
87 Correct 6 ms 1204 KB Output is correct
88 Correct 7 ms 1748 KB Output is correct
89 Correct 10 ms 1880 KB Output is correct
90 Correct 10 ms 1884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 264 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 1 ms 212 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 0 ms 212 KB Output is correct
37 Correct 0 ms 212 KB Output is correct
38 Correct 0 ms 212 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 1 ms 212 KB Output is correct
41 Correct 0 ms 212 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 0 ms 212 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 0 ms 212 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 364 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
52 Correct 1 ms 340 KB Output is correct
53 Correct 1 ms 340 KB Output is correct
54 Correct 1 ms 340 KB Output is correct
55 Correct 1 ms 340 KB Output is correct
56 Correct 1 ms 340 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 1 ms 340 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 1 ms 340 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 340 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 526 ms 45084 KB Output is correct
67 Correct 672 ms 55960 KB Output is correct
68 Correct 643 ms 62412 KB Output is correct
69 Correct 541 ms 50112 KB Output is correct
70 Correct 707 ms 50124 KB Output is correct
71 Correct 682 ms 62104 KB Output is correct
72 Correct 634 ms 61772 KB Output is correct
73 Correct 575 ms 50180 KB Output is correct
74 Correct 729 ms 62432 KB Output is correct
75 Correct 711 ms 61644 KB Output is correct
76 Correct 562 ms 50364 KB Output is correct
77 Correct 659 ms 62532 KB Output is correct
78 Correct 719 ms 53100 KB Output is correct
79 Correct 701 ms 53032 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 264 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 1 ms 212 KB Output is correct
32 Correct 0 ms 212 KB Output is correct
33 Correct 0 ms 212 KB Output is correct
34 Correct 0 ms 212 KB Output is correct
35 Correct 0 ms 212 KB Output is correct
36 Correct 0 ms 212 KB Output is correct
37 Correct 0 ms 212 KB Output is correct
38 Correct 0 ms 212 KB Output is correct
39 Correct 1 ms 212 KB Output is correct
40 Correct 1 ms 212 KB Output is correct
41 Correct 0 ms 212 KB Output is correct
42 Correct 0 ms 212 KB Output is correct
43 Correct 0 ms 212 KB Output is correct
44 Correct 1 ms 212 KB Output is correct
45 Correct 0 ms 212 KB Output is correct
46 Correct 1 ms 340 KB Output is correct
47 Correct 1 ms 340 KB Output is correct
48 Correct 1 ms 340 KB Output is correct
49 Correct 1 ms 364 KB Output is correct
50 Correct 1 ms 340 KB Output is correct
51 Correct 1 ms 340 KB Output is correct
52 Correct 1 ms 340 KB Output is correct
53 Correct 1 ms 340 KB Output is correct
54 Correct 1 ms 340 KB Output is correct
55 Correct 1 ms 340 KB Output is correct
56 Correct 1 ms 340 KB Output is correct
57 Correct 1 ms 340 KB Output is correct
58 Correct 1 ms 340 KB Output is correct
59 Correct 1 ms 340 KB Output is correct
60 Correct 1 ms 340 KB Output is correct
61 Correct 1 ms 340 KB Output is correct
62 Correct 1 ms 340 KB Output is correct
63 Correct 1 ms 340 KB Output is correct
64 Correct 1 ms 340 KB Output is correct
65 Correct 1 ms 340 KB Output is correct
66 Correct 10 ms 1980 KB Output is correct
67 Correct 13 ms 1956 KB Output is correct
68 Correct 10 ms 2132 KB Output is correct
69 Correct 18 ms 1108 KB Output is correct
70 Correct 13 ms 1272 KB Output is correct
71 Correct 11 ms 1348 KB Output is correct
72 Correct 10 ms 1868 KB Output is correct
73 Correct 10 ms 2132 KB Output is correct
74 Correct 11 ms 1748 KB Output is correct
75 Correct 12 ms 1872 KB Output is correct
76 Correct 11 ms 2004 KB Output is correct
77 Correct 10 ms 1748 KB Output is correct
78 Correct 10 ms 2004 KB Output is correct
79 Correct 10 ms 2004 KB Output is correct
80 Correct 11 ms 2140 KB Output is correct
81 Correct 11 ms 2020 KB Output is correct
82 Correct 11 ms 1956 KB Output is correct
83 Correct 10 ms 1964 KB Output is correct
84 Correct 7 ms 1500 KB Output is correct
85 Correct 6 ms 1108 KB Output is correct
86 Correct 9 ms 1124 KB Output is correct
87 Correct 6 ms 1204 KB Output is correct
88 Correct 7 ms 1748 KB Output is correct
89 Correct 10 ms 1880 KB Output is correct
90 Correct 10 ms 1884 KB Output is correct
91 Correct 526 ms 45084 KB Output is correct
92 Correct 672 ms 55960 KB Output is correct
93 Correct 643 ms 62412 KB Output is correct
94 Correct 541 ms 50112 KB Output is correct
95 Correct 707 ms 50124 KB Output is correct
96 Correct 682 ms 62104 KB Output is correct
97 Correct 634 ms 61772 KB Output is correct
98 Correct 575 ms 50180 KB Output is correct
99 Correct 729 ms 62432 KB Output is correct
100 Correct 711 ms 61644 KB Output is correct
101 Correct 562 ms 50364 KB Output is correct
102 Correct 659 ms 62532 KB Output is correct
103 Correct 719 ms 53100 KB Output is correct
104 Correct 701 ms 53032 KB Output is correct
105 Correct 578 ms 21348 KB Output is correct
106 Correct 694 ms 26636 KB Output is correct
107 Correct 917 ms 27092 KB Output is correct
108 Correct 728 ms 27468 KB Output is correct
109 Correct 515 ms 32084 KB Output is correct
110 Correct 598 ms 51772 KB Output is correct
111 Correct 657 ms 62476 KB Output is correct
112 Correct 628 ms 59724 KB Output is correct
113 Correct 668 ms 59900 KB Output is correct
114 Correct 856 ms 38408 KB Output is correct
115 Correct 589 ms 50256 KB Output is correct
116 Correct 644 ms 59736 KB Output is correct
117 Correct 664 ms 59096 KB Output is correct
118 Correct 780 ms 46728 KB Output is correct
119 Correct 624 ms 50148 KB Output is correct
120 Correct 686 ms 60124 KB Output is correct
121 Correct 699 ms 60376 KB Output is correct
122 Correct 674 ms 59372 KB Output is correct
123 Correct 612 ms 54840 KB Output is correct
124 Correct 534 ms 54856 KB Output is correct
125 Correct 228 ms 40292 KB Output is correct
126 Correct 217 ms 28992 KB Output is correct
127 Correct 246 ms 26864 KB Output is correct
128 Correct 233 ms 27184 KB Output is correct
129 Correct 237 ms 32892 KB Output is correct