답안 #1077116

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1077116 2024-08-27T01:01:21 Z pawned Toy (CEOI24_toy) C++17
44 / 100
1500 ms 777812 KB
#pragma GCC optimize("O1,O2,O3,Ofast,unroll-loops")

#include <bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define pb push_back
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;

const char nl = '\n';

void fastIO() {
	ios::sync_with_stdio(false);
	cin.tie(0);
}


int dir1[8] = {-1, 1, 0, 0, 0, 0, 0, 0};
int dir2[8] = {0, 0, -1, 1, 0, 0, 0, 0};
int dir3[8] = {0, 0, 0, 0, -1, 1, 0, 0};
int dir4[8] = {0, 0, 0, 0, 0, 0, -1, 1};

int main() {
	fastIO();
	int R, C, K, L;
	// K = horizontal width, L = vertical width
	cin>>C>>R>>K>>L;
	pair<ii, ii> start;
	// {horizontal left coords, vertical top coords}
	cin>>start.fi.se>>start.fi.fi>>start.se.se>>start.se.fi;
	ii goal;	// goal cell
	vector<vector<char>> grid(R, vector<char>(C, '.'));
	for (int i = 0; i < R; i++) {
		for (int j = 0; j < C; j++) {
			cin>>grid[i][j];
			if (grid[i][j] == '*')
				goal = {i, j};
		}
	}
	// prefix sums to check for filled
	vector<vi> pfs1(R, vi(C + 1, 0));	// horizontal prefix sums
	vector<vi> pfs2(R + 1, vi(C, 0));	// vertical prefix sums
	for (int i = 0; i < R; i++) {
		for (int j = 1; j <= C; j++) {
			pfs1[i][j] = pfs1[i][j - 1];
			if (grid[i][j - 1] == 'X')
				pfs1[i][j]++;
		}
	}
	for (int i = 0; i < C; i++) {
		for (int j = 1; j <= R; j++) {
			pfs2[j][i] = pfs2[j - 1][i];
			if (grid[j - 1][i] == 'X')
				pfs2[j][i]++;
		}
	}
/*	cout<<"pfs1: "<<endl;
	for (vi v : pfs1) {
		for (int x : v)
			cout<<x<<" ";
		cout<<endl;
	}
	cout<<"pfs2: "<<endl;
	for (vi v : pfs2) {
		for (int x : v)
			cout<<x<<" ";
		cout<<endl;
	}*/
	vector<vector<vector<vector<bool>>>> vis(R, vector<vector<vector<bool>>>(C, vector<vector<bool>>(L, vector<bool>(K, false))));
	// {horizontal left coords, {distance of intersection to top of vertical, to left of horizontal}}
	queue<pair<ii, ii>> q;
	vis[start.fi.fi][start.fi.se][start.fi.fi - start.se.fi][start.se.se - start.fi.se] = true;
	q.push(start);
	while (!q.empty()) {
		pair<ii, ii> x = q.front();
		q.pop();
//		cout<<"at ("<<x.fi.fi<<", "<<x.fi.se<<", "<<x.se.fi<<", "<<x.se.se<<")"<<endl;
		for (int i = 0; i < 8; i++) {
			pair<ii, ii> y = x;	// new state
			y.fi.fi += dir1[i];
			y.fi.se += dir2[i];
			y.se.fi += dir3[i];
			y.se.se += dir4[i];
//			cout<<"going to ("<<y.fi.fi<<", "<<y.fi.se<<", "<<y.se.fi<<", "<<y.se.se<<")"<<endl;
			// check if state is possible
			if (y.fi.fi < 0 || y.fi.fi >= R || y.fi.se < 0 || y.fi.se >= C - K + 1)
				continue;
			if (y.se.se < 0 || y.se.se >= C || y.se.fi < 0 || y.se.fi >= R - L + 1)
				continue;
			// check if they intersect
			if (y.fi.fi < y.se.fi || y.fi.fi >= y.se.fi + L)
				continue;
			if (y.se.se < y.fi.se || y.se.se >= y.fi.se + K)
				continue;
			// state is in grid, check if none on it blocked
			if (pfs1[y.fi.fi][y.fi.se + K] - pfs1[y.fi.fi][y.fi.se] > 0)
				continue;
			if (pfs2[y.se.fi + L][y.se.se] - pfs2[y.se.fi][y.se.se] > 0)
				continue;
			// if state is possible and unvisited, add to queue
			if (!vis[y.fi.fi][y.fi.se][y.fi.fi - y.se.fi][y.se.se - y.fi.se]) {
				q.push(y);
				vis[y.fi.fi][y.fi.se][y.fi.fi - y.se.fi][y.se.se - y.fi.se] = true;
			}
		}
	}
	// check if any of visited intersect at flag
	bool found = false;
	for (int i = 0; i < R; i++) {
		for (int j = 0; j < C; j++) {
			for (int k = 0; k < L; k++) {
				for (int l = 0; l < K; l++) {
					if (vis[i][j][k][l]) {
//						cout<<"can do "<<i<<" "<<j<<" "<<k<<" "<<l<<endl;
						ii ins = {i, j + l};
						if (ins == goal)
							found = true;
					}
				}
			}
		}
	}
	if (found)
		cout<<"YES"<<endl;
	else
		cout<<"NO"<<endl;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 3 ms 860 KB Output is correct
4 Correct 23 ms 3160 KB Output is correct
5 Correct 22 ms 9564 KB Output is correct
6 Correct 1 ms 1116 KB Output is correct
7 Correct 14 ms 8852 KB Output is correct
8 Correct 18 ms 9564 KB Output is correct
9 Correct 2 ms 1628 KB Output is correct
10 Correct 4 ms 3420 KB Output is correct
11 Correct 18 ms 9560 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 3 ms 2652 KB Output is correct
14 Correct 19 ms 9408 KB Output is correct
15 Correct 32 ms 4188 KB Output is correct
16 Correct 26 ms 4440 KB Output is correct
17 Correct 34 ms 4700 KB Output is correct
18 Correct 32 ms 4960 KB Output is correct
19 Correct 40 ms 4896 KB Output is correct
20 Correct 32 ms 4696 KB Output is correct
21 Correct 33 ms 4952 KB Output is correct
22 Correct 33 ms 4700 KB Output is correct
23 Correct 32 ms 4696 KB Output is correct
24 Correct 14 ms 2648 KB Output is correct
25 Correct 12 ms 2396 KB Output is correct
26 Correct 11 ms 2764 KB Output is correct
27 Correct 10 ms 2560 KB Output is correct
28 Correct 9 ms 2140 KB Output is correct
29 Correct 9 ms 2140 KB Output is correct
30 Correct 8 ms 1772 KB Output is correct
31 Correct 10 ms 2132 KB Output is correct
32 Correct 5 ms 1372 KB Output is correct
33 Correct 6 ms 1628 KB Output is correct
34 Correct 9 ms 2036 KB Output is correct
35 Correct 7 ms 1880 KB Output is correct
36 Correct 2 ms 2396 KB Output is correct
37 Correct 4 ms 2140 KB Output is correct
38 Correct 4 ms 2396 KB Output is correct
39 Correct 4 ms 2140 KB Output is correct
40 Correct 4 ms 2396 KB Output is correct
41 Correct 4 ms 2140 KB Output is correct
42 Correct 18 ms 9564 KB Output is correct
43 Correct 17 ms 9564 KB Output is correct
44 Correct 21 ms 9560 KB Output is correct
45 Correct 22 ms 9564 KB Output is correct
46 Correct 2 ms 2140 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 3 ms 860 KB Output is correct
4 Correct 23 ms 3160 KB Output is correct
5 Correct 22 ms 9564 KB Output is correct
6 Correct 1 ms 1116 KB Output is correct
7 Correct 14 ms 8852 KB Output is correct
8 Correct 18 ms 9564 KB Output is correct
9 Correct 2 ms 1628 KB Output is correct
10 Correct 4 ms 3420 KB Output is correct
11 Correct 18 ms 9560 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 3 ms 2652 KB Output is correct
14 Correct 19 ms 9408 KB Output is correct
15 Correct 32 ms 4188 KB Output is correct
16 Correct 26 ms 4440 KB Output is correct
17 Correct 34 ms 4700 KB Output is correct
18 Correct 32 ms 4960 KB Output is correct
19 Correct 40 ms 4896 KB Output is correct
20 Correct 32 ms 4696 KB Output is correct
21 Correct 33 ms 4952 KB Output is correct
22 Correct 33 ms 4700 KB Output is correct
23 Correct 32 ms 4696 KB Output is correct
24 Correct 14 ms 2648 KB Output is correct
25 Correct 12 ms 2396 KB Output is correct
26 Correct 11 ms 2764 KB Output is correct
27 Correct 10 ms 2560 KB Output is correct
28 Correct 9 ms 2140 KB Output is correct
29 Correct 9 ms 2140 KB Output is correct
30 Correct 8 ms 1772 KB Output is correct
31 Correct 10 ms 2132 KB Output is correct
32 Correct 5 ms 1372 KB Output is correct
33 Correct 6 ms 1628 KB Output is correct
34 Correct 9 ms 2036 KB Output is correct
35 Correct 7 ms 1880 KB Output is correct
36 Correct 2 ms 2396 KB Output is correct
37 Correct 4 ms 2140 KB Output is correct
38 Correct 4 ms 2396 KB Output is correct
39 Correct 4 ms 2140 KB Output is correct
40 Correct 4 ms 2396 KB Output is correct
41 Correct 4 ms 2140 KB Output is correct
42 Correct 18 ms 9564 KB Output is correct
43 Correct 17 ms 9564 KB Output is correct
44 Correct 21 ms 9560 KB Output is correct
45 Correct 22 ms 9564 KB Output is correct
46 Correct 2 ms 2140 KB Output is correct
47 Correct 7 ms 2792 KB Output is correct
48 Correct 47 ms 27312 KB Output is correct
49 Correct 106 ms 52772 KB Output is correct
50 Correct 71 ms 32660 KB Output is correct
51 Correct 42 ms 18012 KB Output is correct
52 Correct 103 ms 52692 KB Output is correct
53 Correct 16 ms 14940 KB Output is correct
54 Correct 45 ms 21408 KB Output is correct
55 Correct 105 ms 52656 KB Output is correct
56 Correct 2 ms 2396 KB Output is correct
57 Correct 70 ms 46932 KB Output is correct
58 Correct 103 ms 52560 KB Output is correct
59 Correct 261 ms 21328 KB Output is correct
60 Correct 246 ms 20564 KB Output is correct
61 Correct 246 ms 21512 KB Output is correct
62 Correct 339 ms 26956 KB Output is correct
63 Correct 342 ms 26964 KB Output is correct
64 Correct 327 ms 25940 KB Output is correct
65 Correct 338 ms 27348 KB Output is correct
66 Correct 346 ms 26448 KB Output is correct
67 Correct 343 ms 25936 KB Output is correct
68 Correct 147 ms 13548 KB Output is correct
69 Correct 146 ms 12892 KB Output is correct
70 Correct 110 ms 13404 KB Output is correct
71 Correct 109 ms 12892 KB Output is correct
72 Correct 97 ms 12164 KB Output is correct
73 Correct 92 ms 11612 KB Output is correct
74 Correct 35 ms 5468 KB Output is correct
75 Correct 34 ms 5212 KB Output is correct
76 Correct 40 ms 5976 KB Output is correct
77 Correct 21 ms 3932 KB Output is correct
78 Correct 31 ms 5212 KB Output is correct
79 Correct 16 ms 3932 KB Output is correct
80 Correct 18 ms 12636 KB Output is correct
81 Correct 32 ms 9620 KB Output is correct
82 Correct 40 ms 11356 KB Output is correct
83 Correct 29 ms 10076 KB Output is correct
84 Correct 40 ms 11868 KB Output is correct
85 Correct 36 ms 10844 KB Output is correct
86 Correct 119 ms 52756 KB Output is correct
87 Correct 98 ms 52564 KB Output is correct
88 Correct 99 ms 52564 KB Output is correct
89 Correct 106 ms 52564 KB Output is correct
90 Correct 17 ms 13400 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 6 ms 1372 KB Output is correct
4 Correct 268 ms 55496 KB Output is correct
5 Correct 681 ms 68944 KB Output is correct
6 Correct 8 ms 2396 KB Output is correct
7 Correct 623 ms 68548 KB Output is correct
8 Correct 587 ms 68384 KB Output is correct
9 Correct 21 ms 21340 KB Output is correct
10 Correct 41 ms 43076 KB Output is correct
11 Correct 76 ms 68436 KB Output is correct
12 Correct 9 ms 10332 KB Output is correct
13 Correct 40 ms 35848 KB Output is correct
14 Correct 75 ms 68304 KB Output is correct
15 Correct 513 ms 57840 KB Output is correct
16 Correct 455 ms 55140 KB Output is correct
17 Correct 518 ms 55120 KB Output is correct
18 Correct 667 ms 68460 KB Output is correct
19 Correct 553 ms 61524 KB Output is correct
20 Correct 410 ms 55804 KB Output is correct
21 Correct 654 ms 68452 KB Output is correct
22 Correct 529 ms 61520 KB Output is correct
23 Correct 450 ms 55808 KB Output is correct
24 Correct 648 ms 68432 KB Output is correct
25 Correct 526 ms 61468 KB Output is correct
26 Correct 621 ms 68432 KB Output is correct
27 Correct 489 ms 61464 KB Output is correct
28 Correct 428 ms 56056 KB Output is correct
29 Correct 323 ms 48724 KB Output is correct
30 Correct 419 ms 53784 KB Output is correct
31 Correct 160 ms 33372 KB Output is correct
32 Correct 507 ms 60236 KB Output is correct
33 Correct 491 ms 55912 KB Output is correct
34 Correct 157 ms 32456 KB Output is correct
35 Correct 478 ms 55892 KB Output is correct
36 Correct 82 ms 55632 KB Output is correct
37 Correct 208 ms 59424 KB Output is correct
38 Correct 187 ms 55020 KB Output is correct
39 Correct 231 ms 63096 KB Output is correct
40 Correct 252 ms 65616 KB Output is correct
41 Correct 211 ms 61592 KB Output is correct
42 Correct 696 ms 68688 KB Output is correct
43 Correct 666 ms 68804 KB Output is correct
44 Correct 676 ms 68540 KB Output is correct
45 Correct 735 ms 68536 KB Output is correct
46 Correct 76 ms 63132 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 3 ms 860 KB Output is correct
4 Correct 23 ms 3160 KB Output is correct
5 Correct 22 ms 9564 KB Output is correct
6 Correct 1 ms 1116 KB Output is correct
7 Correct 14 ms 8852 KB Output is correct
8 Correct 18 ms 9564 KB Output is correct
9 Correct 2 ms 1628 KB Output is correct
10 Correct 4 ms 3420 KB Output is correct
11 Correct 18 ms 9560 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 3 ms 2652 KB Output is correct
14 Correct 19 ms 9408 KB Output is correct
15 Correct 32 ms 4188 KB Output is correct
16 Correct 26 ms 4440 KB Output is correct
17 Correct 34 ms 4700 KB Output is correct
18 Correct 32 ms 4960 KB Output is correct
19 Correct 40 ms 4896 KB Output is correct
20 Correct 32 ms 4696 KB Output is correct
21 Correct 33 ms 4952 KB Output is correct
22 Correct 33 ms 4700 KB Output is correct
23 Correct 32 ms 4696 KB Output is correct
24 Correct 14 ms 2648 KB Output is correct
25 Correct 12 ms 2396 KB Output is correct
26 Correct 11 ms 2764 KB Output is correct
27 Correct 10 ms 2560 KB Output is correct
28 Correct 9 ms 2140 KB Output is correct
29 Correct 9 ms 2140 KB Output is correct
30 Correct 8 ms 1772 KB Output is correct
31 Correct 10 ms 2132 KB Output is correct
32 Correct 5 ms 1372 KB Output is correct
33 Correct 6 ms 1628 KB Output is correct
34 Correct 9 ms 2036 KB Output is correct
35 Correct 7 ms 1880 KB Output is correct
36 Correct 2 ms 2396 KB Output is correct
37 Correct 4 ms 2140 KB Output is correct
38 Correct 4 ms 2396 KB Output is correct
39 Correct 4 ms 2140 KB Output is correct
40 Correct 4 ms 2396 KB Output is correct
41 Correct 4 ms 2140 KB Output is correct
42 Correct 18 ms 9564 KB Output is correct
43 Correct 17 ms 9564 KB Output is correct
44 Correct 21 ms 9560 KB Output is correct
45 Correct 22 ms 9564 KB Output is correct
46 Correct 2 ms 2140 KB Output is correct
47 Correct 7 ms 2792 KB Output is correct
48 Correct 47 ms 27312 KB Output is correct
49 Correct 106 ms 52772 KB Output is correct
50 Correct 71 ms 32660 KB Output is correct
51 Correct 42 ms 18012 KB Output is correct
52 Correct 103 ms 52692 KB Output is correct
53 Correct 16 ms 14940 KB Output is correct
54 Correct 45 ms 21408 KB Output is correct
55 Correct 105 ms 52656 KB Output is correct
56 Correct 2 ms 2396 KB Output is correct
57 Correct 70 ms 46932 KB Output is correct
58 Correct 103 ms 52560 KB Output is correct
59 Correct 261 ms 21328 KB Output is correct
60 Correct 246 ms 20564 KB Output is correct
61 Correct 246 ms 21512 KB Output is correct
62 Correct 339 ms 26956 KB Output is correct
63 Correct 342 ms 26964 KB Output is correct
64 Correct 327 ms 25940 KB Output is correct
65 Correct 338 ms 27348 KB Output is correct
66 Correct 346 ms 26448 KB Output is correct
67 Correct 343 ms 25936 KB Output is correct
68 Correct 147 ms 13548 KB Output is correct
69 Correct 146 ms 12892 KB Output is correct
70 Correct 110 ms 13404 KB Output is correct
71 Correct 109 ms 12892 KB Output is correct
72 Correct 97 ms 12164 KB Output is correct
73 Correct 92 ms 11612 KB Output is correct
74 Correct 35 ms 5468 KB Output is correct
75 Correct 34 ms 5212 KB Output is correct
76 Correct 40 ms 5976 KB Output is correct
77 Correct 21 ms 3932 KB Output is correct
78 Correct 31 ms 5212 KB Output is correct
79 Correct 16 ms 3932 KB Output is correct
80 Correct 18 ms 12636 KB Output is correct
81 Correct 32 ms 9620 KB Output is correct
82 Correct 40 ms 11356 KB Output is correct
83 Correct 29 ms 10076 KB Output is correct
84 Correct 40 ms 11868 KB Output is correct
85 Correct 36 ms 10844 KB Output is correct
86 Correct 119 ms 52756 KB Output is correct
87 Correct 98 ms 52564 KB Output is correct
88 Correct 99 ms 52564 KB Output is correct
89 Correct 106 ms 52564 KB Output is correct
90 Correct 17 ms 13400 KB Output is correct
91 Correct 6 ms 1372 KB Output is correct
92 Correct 268 ms 55496 KB Output is correct
93 Correct 681 ms 68944 KB Output is correct
94 Correct 8 ms 2396 KB Output is correct
95 Correct 623 ms 68548 KB Output is correct
96 Correct 587 ms 68384 KB Output is correct
97 Correct 21 ms 21340 KB Output is correct
98 Correct 41 ms 43076 KB Output is correct
99 Correct 76 ms 68436 KB Output is correct
100 Correct 9 ms 10332 KB Output is correct
101 Correct 40 ms 35848 KB Output is correct
102 Correct 75 ms 68304 KB Output is correct
103 Correct 513 ms 57840 KB Output is correct
104 Correct 455 ms 55140 KB Output is correct
105 Correct 518 ms 55120 KB Output is correct
106 Correct 667 ms 68460 KB Output is correct
107 Correct 553 ms 61524 KB Output is correct
108 Correct 410 ms 55804 KB Output is correct
109 Correct 654 ms 68452 KB Output is correct
110 Correct 529 ms 61520 KB Output is correct
111 Correct 450 ms 55808 KB Output is correct
112 Correct 648 ms 68432 KB Output is correct
113 Correct 526 ms 61468 KB Output is correct
114 Correct 621 ms 68432 KB Output is correct
115 Correct 489 ms 61464 KB Output is correct
116 Correct 428 ms 56056 KB Output is correct
117 Correct 323 ms 48724 KB Output is correct
118 Correct 419 ms 53784 KB Output is correct
119 Correct 160 ms 33372 KB Output is correct
120 Correct 507 ms 60236 KB Output is correct
121 Correct 491 ms 55912 KB Output is correct
122 Correct 157 ms 32456 KB Output is correct
123 Correct 478 ms 55892 KB Output is correct
124 Correct 82 ms 55632 KB Output is correct
125 Correct 208 ms 59424 KB Output is correct
126 Correct 187 ms 55020 KB Output is correct
127 Correct 231 ms 63096 KB Output is correct
128 Correct 252 ms 65616 KB Output is correct
129 Correct 211 ms 61592 KB Output is correct
130 Correct 696 ms 68688 KB Output is correct
131 Correct 666 ms 68804 KB Output is correct
132 Correct 676 ms 68540 KB Output is correct
133 Correct 735 ms 68536 KB Output is correct
134 Correct 76 ms 63132 KB Output is correct
135 Correct 1246 ms 296404 KB Output is correct
136 Execution timed out 1584 ms 777812 KB Time limit exceeded
137 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 3 ms 860 KB Output is correct
4 Correct 23 ms 3160 KB Output is correct
5 Correct 22 ms 9564 KB Output is correct
6 Correct 1 ms 1116 KB Output is correct
7 Correct 14 ms 8852 KB Output is correct
8 Correct 18 ms 9564 KB Output is correct
9 Correct 2 ms 1628 KB Output is correct
10 Correct 4 ms 3420 KB Output is correct
11 Correct 18 ms 9560 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 3 ms 2652 KB Output is correct
14 Correct 19 ms 9408 KB Output is correct
15 Correct 32 ms 4188 KB Output is correct
16 Correct 26 ms 4440 KB Output is correct
17 Correct 34 ms 4700 KB Output is correct
18 Correct 32 ms 4960 KB Output is correct
19 Correct 40 ms 4896 KB Output is correct
20 Correct 32 ms 4696 KB Output is correct
21 Correct 33 ms 4952 KB Output is correct
22 Correct 33 ms 4700 KB Output is correct
23 Correct 32 ms 4696 KB Output is correct
24 Correct 14 ms 2648 KB Output is correct
25 Correct 12 ms 2396 KB Output is correct
26 Correct 11 ms 2764 KB Output is correct
27 Correct 10 ms 2560 KB Output is correct
28 Correct 9 ms 2140 KB Output is correct
29 Correct 9 ms 2140 KB Output is correct
30 Correct 8 ms 1772 KB Output is correct
31 Correct 10 ms 2132 KB Output is correct
32 Correct 5 ms 1372 KB Output is correct
33 Correct 6 ms 1628 KB Output is correct
34 Correct 9 ms 2036 KB Output is correct
35 Correct 7 ms 1880 KB Output is correct
36 Correct 2 ms 2396 KB Output is correct
37 Correct 4 ms 2140 KB Output is correct
38 Correct 4 ms 2396 KB Output is correct
39 Correct 4 ms 2140 KB Output is correct
40 Correct 4 ms 2396 KB Output is correct
41 Correct 4 ms 2140 KB Output is correct
42 Correct 18 ms 9564 KB Output is correct
43 Correct 17 ms 9564 KB Output is correct
44 Correct 21 ms 9560 KB Output is correct
45 Correct 22 ms 9564 KB Output is correct
46 Correct 2 ms 2140 KB Output is correct
47 Correct 7 ms 2792 KB Output is correct
48 Correct 47 ms 27312 KB Output is correct
49 Correct 106 ms 52772 KB Output is correct
50 Correct 71 ms 32660 KB Output is correct
51 Correct 42 ms 18012 KB Output is correct
52 Correct 103 ms 52692 KB Output is correct
53 Correct 16 ms 14940 KB Output is correct
54 Correct 45 ms 21408 KB Output is correct
55 Correct 105 ms 52656 KB Output is correct
56 Correct 2 ms 2396 KB Output is correct
57 Correct 70 ms 46932 KB Output is correct
58 Correct 103 ms 52560 KB Output is correct
59 Correct 261 ms 21328 KB Output is correct
60 Correct 246 ms 20564 KB Output is correct
61 Correct 246 ms 21512 KB Output is correct
62 Correct 339 ms 26956 KB Output is correct
63 Correct 342 ms 26964 KB Output is correct
64 Correct 327 ms 25940 KB Output is correct
65 Correct 338 ms 27348 KB Output is correct
66 Correct 346 ms 26448 KB Output is correct
67 Correct 343 ms 25936 KB Output is correct
68 Correct 147 ms 13548 KB Output is correct
69 Correct 146 ms 12892 KB Output is correct
70 Correct 110 ms 13404 KB Output is correct
71 Correct 109 ms 12892 KB Output is correct
72 Correct 97 ms 12164 KB Output is correct
73 Correct 92 ms 11612 KB Output is correct
74 Correct 35 ms 5468 KB Output is correct
75 Correct 34 ms 5212 KB Output is correct
76 Correct 40 ms 5976 KB Output is correct
77 Correct 21 ms 3932 KB Output is correct
78 Correct 31 ms 5212 KB Output is correct
79 Correct 16 ms 3932 KB Output is correct
80 Correct 18 ms 12636 KB Output is correct
81 Correct 32 ms 9620 KB Output is correct
82 Correct 40 ms 11356 KB Output is correct
83 Correct 29 ms 10076 KB Output is correct
84 Correct 40 ms 11868 KB Output is correct
85 Correct 36 ms 10844 KB Output is correct
86 Correct 119 ms 52756 KB Output is correct
87 Correct 98 ms 52564 KB Output is correct
88 Correct 99 ms 52564 KB Output is correct
89 Correct 106 ms 52564 KB Output is correct
90 Correct 17 ms 13400 KB Output is correct
91 Correct 6 ms 1372 KB Output is correct
92 Correct 268 ms 55496 KB Output is correct
93 Correct 681 ms 68944 KB Output is correct
94 Correct 8 ms 2396 KB Output is correct
95 Correct 623 ms 68548 KB Output is correct
96 Correct 587 ms 68384 KB Output is correct
97 Correct 21 ms 21340 KB Output is correct
98 Correct 41 ms 43076 KB Output is correct
99 Correct 76 ms 68436 KB Output is correct
100 Correct 9 ms 10332 KB Output is correct
101 Correct 40 ms 35848 KB Output is correct
102 Correct 75 ms 68304 KB Output is correct
103 Correct 513 ms 57840 KB Output is correct
104 Correct 455 ms 55140 KB Output is correct
105 Correct 518 ms 55120 KB Output is correct
106 Correct 667 ms 68460 KB Output is correct
107 Correct 553 ms 61524 KB Output is correct
108 Correct 410 ms 55804 KB Output is correct
109 Correct 654 ms 68452 KB Output is correct
110 Correct 529 ms 61520 KB Output is correct
111 Correct 450 ms 55808 KB Output is correct
112 Correct 648 ms 68432 KB Output is correct
113 Correct 526 ms 61468 KB Output is correct
114 Correct 621 ms 68432 KB Output is correct
115 Correct 489 ms 61464 KB Output is correct
116 Correct 428 ms 56056 KB Output is correct
117 Correct 323 ms 48724 KB Output is correct
118 Correct 419 ms 53784 KB Output is correct
119 Correct 160 ms 33372 KB Output is correct
120 Correct 507 ms 60236 KB Output is correct
121 Correct 491 ms 55912 KB Output is correct
122 Correct 157 ms 32456 KB Output is correct
123 Correct 478 ms 55892 KB Output is correct
124 Correct 82 ms 55632 KB Output is correct
125 Correct 208 ms 59424 KB Output is correct
126 Correct 187 ms 55020 KB Output is correct
127 Correct 231 ms 63096 KB Output is correct
128 Correct 252 ms 65616 KB Output is correct
129 Correct 211 ms 61592 KB Output is correct
130 Correct 696 ms 68688 KB Output is correct
131 Correct 666 ms 68804 KB Output is correct
132 Correct 676 ms 68540 KB Output is correct
133 Correct 735 ms 68536 KB Output is correct
134 Correct 76 ms 63132 KB Output is correct
135 Correct 1246 ms 296404 KB Output is correct
136 Execution timed out 1584 ms 777812 KB Time limit exceeded
137 Halted 0 ms 0 KB -