Submission #1087887

# Submission time Handle Problem Language Result Execution time Memory
1087887 2024-09-13T11:02:19 Z mychecksedad Toy (CEOI24_toy) C++17
100 / 100
188 ms 117904 KB
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define en cout << '\n'
#define vi vector<int>
#define pii pair<int, int>
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
const int N = 1500+100;


int n, m, k, l, xh, yh, xv, yv, pref[N][N], H[N][N], V[N][N], vis[N][N], L[N][N], R[N][N], U[N][N], D[N][N], HOR[N][N], VER[N][N], pref2[N][N], pref3[N][N];
string s[N];
int arr[4][2]={
	{0, 1},
	{1, 0},
	{-1, 0},
	{0, -1}
};
int get(int r1, int r2, int c1, int c2){
	return pref[r2][c2] - pref[r1 - 1][c2] - pref[r2][c1 - 1] + pref[r1 - 1][c1 - 1];
}
int get2(int r1, int r2, int c1, int c2){
	return pref2[r2][c2] - pref2[r1 - 1][c2] - pref2[r2][c1 - 1] + pref2[r1 - 1][c1 - 1];
}
int get3(int r1, int r2, int c1, int c2){
	return pref3[r2][c2] - pref3[r1 - 1][c2] - pref3[r2][c1 - 1] + pref3[r1 - 1][c1 - 1];
}
void solve(){
	cin >> m >> n >> k >> l;	
	cin >> yh >> xh >> yv >> xv;
	++xh, ++yh, ++xv, ++yv;
	for(int i = 1; i <= n; ++i){
		cin >> s[i];
		s[i] = " " + s[i];
	}
	for(int i = 0; i <= n; ++i) for(int j = 0; j <= m; ++j) pref[i][j] = 0;
	for(int i = 0; i <= n; ++i) for(int j = 0; j <= m; ++j) pref2[i][j] = pref3[i][j] = H[i][j] = V[i][j] = vis[i][j] = L[i][j] = R[i][j] = D[i][j] = U[i][j] = HOR[i][j] = VER[i][j] = 0;
	for(int i = 1; i <= n; ++i){
		for(int j = 1; j <= m; ++j){
			pref[i][j] = pref[i - 1][j] + pref[i][j - 1] - pref[i - 1][j - 1];
			if(s[i][j] == 'X') ++pref[i][j];
		}
	}
	H[xh][yh] = 1;
	queue<pii> q;
	q.push({xh, yh});
	while(!q.empty()){
		int x = q.front().ff;
		int y = q.front().ss;
		q.pop();
		for(int i = 0; i < 4; ++i){
			int nx = x + arr[i][0];
			int ny = y + arr[i][1];
			if(nx > 0 && ny > 0 && nx <= n && ny + k - 1 <= m && H[nx][ny] == 0){
				if(get(nx, nx, ny, ny + k - 1) == 0){
					H[nx][ny] = 1;
					q.push({nx, ny});
				}
			}
		}
	}
	V[xv][yv] = 1;
	q.push({xv, yv});
	while(!q.empty()){
		int x = q.front().ff;
		int y = q.front().ss;
		q.pop();
		for(int i = 0; i < 4; ++i){
			int nx = x + arr[i][0];
			int ny = y + arr[i][1];
			if(nx > 0 && ny > 0 && nx + l - 1 <= n && ny <= m && V[nx][ny] == 0){
				if(get(nx, nx+l-1, ny, ny) == 0){
					V[nx][ny] = 1;
					q.push({nx, ny});
				}
			}
		}
	}
	for(int i = 1; i <= n; ++i){
		for(int j = 1; j <= m; ++j){
			if(H[i][j] && H[i + 1][j]) VER[i][j] = 1;
			if(V[i][j] && V[i][j + 1]) HOR[i][j] = 1;
		}
	}
	for(int i = 1; i <= n; ++i){
		for(int j = 1; j <= m; ++j){
			pref2[i][j] = pref2[i - 1][j] + pref2[i][j - 1] - pref2[i - 1][j - 1];
			if(VER[i][j]) pref2[i][j]++;
			pref3[i][j] = pref3[i - 1][j] + pref3[i][j - 1] - pref3[i - 1][j - 1];
			if(HOR[i][j]) pref3[i][j]++;
		}
	}

	for(int i = n; i >= 1; --i){
		for(int j = m; j >= 1; --j){
			if(s[i][j] == 'X') continue;
			R[i][j] = get3(max(1, i-l+1), i, j, j);
			L[i][j] = get3(max(1, i-l+1), i, j-1, j-1);
			D[i][j] = get2(i, i, max(1, j-k+1), j);
			U[i][j] = get2(i-1, i-1, max(1, j-k+1), j);
		// 	for(int i1 = i; i1 >= max(1, i - l + 1); --i1)
		// 			if(get(i1, i, j, j) == 0 && V[i1][j]){
		// 				if(V[i1][j + 1]) R[i][j] = 1;
		// 				if(V[i1][j - 1]) L[i][j] = 1;
		// 			}
		// 	for(int i1 = j; i1 >= max(1, j - k + 1); --i1)
		// 			if(get(i, i, i1, j) == 0 && H[i][i1]){
		// 				if(H[i - 1][i1]) U[i][j] = 1;
		// 				if(H[i + 1][i1]) D[i][j] = 1;
		// 			}
		}
	}
	// for(int i = 1; i <= n; ++i){
	// 	for(int j = 1; j <= m; ++j){
	// 		cout << L[i][j];
	// 	}
	// 	en;
	// }
	// assert(H[xh][yv] && V[xh][yv]);
	vis[xh][yv] = 1;
	q.push({xh, yv});
	while(!q.empty()){
		int x = q.front().ff;
		int y = q.front().ss;
		q.pop();
		for(int i = 0; i < 4; ++i){
			int nx = x + arr[i][0];
			int ny = y + arr[i][1];
			if(nx > 0 && ny > 0 && nx <= n && ny <= m && !vis[nx][ny] && s[nx][ny] != 'X'){
				if((nx == x - 1 && U[x][y]) || (nx == x + 1 && D[x][y]) || (ny == y + 1 && R[x][y]) || (ny == y - 1 && L[x][y])){
					vis[nx][ny] = 1;
					q.push({nx, ny});
				}
			}
		}
	}
	for(int i = 1; i <= n; ++i){
		for(int j = 1; j <= m; ++j){
			if(s[i][j] == '*' && vis[i][j]){
				cout << "YES";
				return;
			}
		}
	}
	cout << "NO";
}

int main(){
	cin.tie(0); ios::sync_with_stdio(0);
	solve();
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 0 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 0 ms 604 KB Output is correct
3 Correct 1 ms 1116 KB Output is correct
4 Correct 2 ms 2908 KB Output is correct
5 Correct 1 ms 2908 KB Output is correct
6 Correct 1 ms 2652 KB Output is correct
7 Correct 1 ms 2904 KB Output is correct
8 Correct 1 ms 2908 KB Output is correct
9 Correct 1 ms 2140 KB Output is correct
10 Correct 1 ms 2908 KB Output is correct
11 Correct 1 ms 2908 KB Output is correct
12 Correct 0 ms 860 KB Output is correct
13 Correct 1 ms 2908 KB Output is correct
14 Correct 1 ms 2908 KB Output is correct
15 Correct 2 ms 2908 KB Output is correct
16 Correct 1 ms 2652 KB Output is correct
17 Correct 1 ms 2648 KB Output is correct
18 Correct 1 ms 2908 KB Output is correct
19 Correct 1 ms 2908 KB Output is correct
20 Correct 1 ms 2908 KB Output is correct
21 Correct 1 ms 2908 KB Output is correct
22 Correct 1 ms 2908 KB Output is correct
23 Correct 1 ms 2908 KB Output is correct
24 Correct 1 ms 2908 KB Output is correct
25 Correct 1 ms 2908 KB Output is correct
26 Correct 1 ms 2908 KB Output is correct
27 Correct 1 ms 2908 KB Output is correct
28 Correct 2 ms 2908 KB Output is correct
29 Correct 1 ms 2908 KB Output is correct
30 Correct 1 ms 2652 KB Output is correct
31 Correct 1 ms 2908 KB Output is correct
32 Correct 1 ms 2652 KB Output is correct
33 Correct 1 ms 2908 KB Output is correct
34 Correct 1 ms 2908 KB Output is correct
35 Correct 1 ms 2908 KB Output is correct
36 Correct 1 ms 2908 KB Output is correct
37 Correct 1 ms 2652 KB Output is correct
38 Correct 2 ms 2704 KB Output is correct
39 Correct 1 ms 2652 KB Output is correct
40 Correct 1 ms 2908 KB Output is correct
41 Correct 1 ms 2908 KB Output is correct
42 Correct 1 ms 2908 KB Output is correct
43 Correct 1 ms 2908 KB Output is correct
44 Correct 1 ms 2908 KB Output is correct
45 Correct 1 ms 2908 KB Output is correct
46 Correct 1 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 0 ms 604 KB Output is correct
3 Correct 1 ms 1116 KB Output is correct
4 Correct 2 ms 2908 KB Output is correct
5 Correct 1 ms 2908 KB Output is correct
6 Correct 1 ms 2652 KB Output is correct
7 Correct 1 ms 2904 KB Output is correct
8 Correct 1 ms 2908 KB Output is correct
9 Correct 1 ms 2140 KB Output is correct
10 Correct 1 ms 2908 KB Output is correct
11 Correct 1 ms 2908 KB Output is correct
12 Correct 0 ms 860 KB Output is correct
13 Correct 1 ms 2908 KB Output is correct
14 Correct 1 ms 2908 KB Output is correct
15 Correct 2 ms 2908 KB Output is correct
16 Correct 1 ms 2652 KB Output is correct
17 Correct 1 ms 2648 KB Output is correct
18 Correct 1 ms 2908 KB Output is correct
19 Correct 1 ms 2908 KB Output is correct
20 Correct 1 ms 2908 KB Output is correct
21 Correct 1 ms 2908 KB Output is correct
22 Correct 1 ms 2908 KB Output is correct
23 Correct 1 ms 2908 KB Output is correct
24 Correct 1 ms 2908 KB Output is correct
25 Correct 1 ms 2908 KB Output is correct
26 Correct 1 ms 2908 KB Output is correct
27 Correct 1 ms 2908 KB Output is correct
28 Correct 2 ms 2908 KB Output is correct
29 Correct 1 ms 2908 KB Output is correct
30 Correct 1 ms 2652 KB Output is correct
31 Correct 1 ms 2908 KB Output is correct
32 Correct 1 ms 2652 KB Output is correct
33 Correct 1 ms 2908 KB Output is correct
34 Correct 1 ms 2908 KB Output is correct
35 Correct 1 ms 2908 KB Output is correct
36 Correct 1 ms 2908 KB Output is correct
37 Correct 1 ms 2652 KB Output is correct
38 Correct 2 ms 2704 KB Output is correct
39 Correct 1 ms 2652 KB Output is correct
40 Correct 1 ms 2908 KB Output is correct
41 Correct 1 ms 2908 KB Output is correct
42 Correct 1 ms 2908 KB Output is correct
43 Correct 1 ms 2908 KB Output is correct
44 Correct 1 ms 2908 KB Output is correct
45 Correct 1 ms 2908 KB Output is correct
46 Correct 1 ms 2652 KB Output is correct
47 Correct 1 ms 1880 KB Output is correct
48 Correct 2 ms 5212 KB Output is correct
49 Correct 2 ms 5208 KB Output is correct
50 Correct 2 ms 4956 KB Output is correct
51 Correct 2 ms 5212 KB Output is correct
52 Correct 2 ms 5212 KB Output is correct
53 Correct 1 ms 3164 KB Output is correct
54 Correct 2 ms 5208 KB Output is correct
55 Correct 2 ms 5212 KB Output is correct
56 Correct 2 ms 4940 KB Output is correct
57 Correct 2 ms 5212 KB Output is correct
58 Correct 2 ms 5212 KB Output is correct
59 Correct 2 ms 4956 KB Output is correct
60 Correct 2 ms 4956 KB Output is correct
61 Correct 2 ms 4700 KB Output is correct
62 Correct 2 ms 5212 KB Output is correct
63 Correct 2 ms 5212 KB Output is correct
64 Correct 2 ms 5212 KB Output is correct
65 Correct 3 ms 5240 KB Output is correct
66 Correct 2 ms 5208 KB Output is correct
67 Correct 2 ms 5212 KB Output is correct
68 Correct 2 ms 5212 KB Output is correct
69 Correct 2 ms 5212 KB Output is correct
70 Correct 2 ms 5212 KB Output is correct
71 Correct 2 ms 5236 KB Output is correct
72 Correct 2 ms 5208 KB Output is correct
73 Correct 2 ms 5208 KB Output is correct
74 Correct 2 ms 4956 KB Output is correct
75 Correct 2 ms 4700 KB Output is correct
76 Correct 2 ms 5212 KB Output is correct
77 Correct 2 ms 4956 KB Output is correct
78 Correct 2 ms 5212 KB Output is correct
79 Correct 2 ms 4956 KB Output is correct
80 Correct 2 ms 4924 KB Output is correct
81 Correct 2 ms 4700 KB Output is correct
82 Correct 2 ms 4956 KB Output is correct
83 Correct 2 ms 4700 KB Output is correct
84 Correct 2 ms 4724 KB Output is correct
85 Correct 2 ms 4952 KB Output is correct
86 Correct 2 ms 5208 KB Output is correct
87 Correct 2 ms 5212 KB Output is correct
88 Correct 2 ms 5212 KB Output is correct
89 Correct 2 ms 5200 KB Output is correct
90 Correct 2 ms 4956 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 0 ms 604 KB Output is correct
3 Correct 1 ms 2140 KB Output is correct
4 Correct 12 ms 18524 KB Output is correct
5 Correct 12 ms 18756 KB Output is correct
6 Correct 2 ms 4188 KB Output is correct
7 Correct 13 ms 18524 KB Output is correct
8 Correct 12 ms 18584 KB Output is correct
9 Correct 4 ms 7316 KB Output is correct
10 Correct 9 ms 18752 KB Output is correct
11 Correct 8 ms 18536 KB Output is correct
12 Correct 5 ms 13176 KB Output is correct
13 Correct 8 ms 18764 KB Output is correct
14 Correct 8 ms 18692 KB Output is correct
15 Correct 11 ms 18524 KB Output is correct
16 Correct 12 ms 17768 KB Output is correct
17 Correct 11 ms 18536 KB Output is correct
18 Correct 13 ms 18760 KB Output is correct
19 Correct 12 ms 18760 KB Output is correct
20 Correct 12 ms 18536 KB Output is correct
21 Correct 12 ms 18520 KB Output is correct
22 Correct 13 ms 18524 KB Output is correct
23 Correct 13 ms 18524 KB Output is correct
24 Correct 12 ms 18668 KB Output is correct
25 Correct 11 ms 18524 KB Output is correct
26 Correct 11 ms 18700 KB Output is correct
27 Correct 12 ms 18744 KB Output is correct
28 Correct 12 ms 18524 KB Output is correct
29 Correct 12 ms 18524 KB Output is correct
30 Correct 11 ms 18012 KB Output is correct
31 Correct 11 ms 18268 KB Output is correct
32 Correct 12 ms 18524 KB Output is correct
33 Correct 12 ms 17756 KB Output is correct
34 Correct 10 ms 17244 KB Output is correct
35 Correct 11 ms 17660 KB Output is correct
36 Correct 10 ms 18012 KB Output is correct
37 Correct 10 ms 18168 KB Output is correct
38 Correct 12 ms 18520 KB Output is correct
39 Correct 11 ms 18024 KB Output is correct
40 Correct 11 ms 18524 KB Output is correct
41 Correct 10 ms 18740 KB Output is correct
42 Correct 12 ms 18524 KB Output is correct
43 Correct 12 ms 18524 KB Output is correct
44 Correct 12 ms 18524 KB Output is correct
45 Correct 13 ms 18624 KB Output is correct
46 Correct 7 ms 17500 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 0 ms 604 KB Output is correct
3 Correct 1 ms 1116 KB Output is correct
4 Correct 2 ms 2908 KB Output is correct
5 Correct 1 ms 2908 KB Output is correct
6 Correct 1 ms 2652 KB Output is correct
7 Correct 1 ms 2904 KB Output is correct
8 Correct 1 ms 2908 KB Output is correct
9 Correct 1 ms 2140 KB Output is correct
10 Correct 1 ms 2908 KB Output is correct
11 Correct 1 ms 2908 KB Output is correct
12 Correct 0 ms 860 KB Output is correct
13 Correct 1 ms 2908 KB Output is correct
14 Correct 1 ms 2908 KB Output is correct
15 Correct 2 ms 2908 KB Output is correct
16 Correct 1 ms 2652 KB Output is correct
17 Correct 1 ms 2648 KB Output is correct
18 Correct 1 ms 2908 KB Output is correct
19 Correct 1 ms 2908 KB Output is correct
20 Correct 1 ms 2908 KB Output is correct
21 Correct 1 ms 2908 KB Output is correct
22 Correct 1 ms 2908 KB Output is correct
23 Correct 1 ms 2908 KB Output is correct
24 Correct 1 ms 2908 KB Output is correct
25 Correct 1 ms 2908 KB Output is correct
26 Correct 1 ms 2908 KB Output is correct
27 Correct 1 ms 2908 KB Output is correct
28 Correct 2 ms 2908 KB Output is correct
29 Correct 1 ms 2908 KB Output is correct
30 Correct 1 ms 2652 KB Output is correct
31 Correct 1 ms 2908 KB Output is correct
32 Correct 1 ms 2652 KB Output is correct
33 Correct 1 ms 2908 KB Output is correct
34 Correct 1 ms 2908 KB Output is correct
35 Correct 1 ms 2908 KB Output is correct
36 Correct 1 ms 2908 KB Output is correct
37 Correct 1 ms 2652 KB Output is correct
38 Correct 2 ms 2704 KB Output is correct
39 Correct 1 ms 2652 KB Output is correct
40 Correct 1 ms 2908 KB Output is correct
41 Correct 1 ms 2908 KB Output is correct
42 Correct 1 ms 2908 KB Output is correct
43 Correct 1 ms 2908 KB Output is correct
44 Correct 1 ms 2908 KB Output is correct
45 Correct 1 ms 2908 KB Output is correct
46 Correct 1 ms 2652 KB Output is correct
47 Correct 1 ms 1880 KB Output is correct
48 Correct 2 ms 5212 KB Output is correct
49 Correct 2 ms 5208 KB Output is correct
50 Correct 2 ms 4956 KB Output is correct
51 Correct 2 ms 5212 KB Output is correct
52 Correct 2 ms 5212 KB Output is correct
53 Correct 1 ms 3164 KB Output is correct
54 Correct 2 ms 5208 KB Output is correct
55 Correct 2 ms 5212 KB Output is correct
56 Correct 2 ms 4940 KB Output is correct
57 Correct 2 ms 5212 KB Output is correct
58 Correct 2 ms 5212 KB Output is correct
59 Correct 2 ms 4956 KB Output is correct
60 Correct 2 ms 4956 KB Output is correct
61 Correct 2 ms 4700 KB Output is correct
62 Correct 2 ms 5212 KB Output is correct
63 Correct 2 ms 5212 KB Output is correct
64 Correct 2 ms 5212 KB Output is correct
65 Correct 3 ms 5240 KB Output is correct
66 Correct 2 ms 5208 KB Output is correct
67 Correct 2 ms 5212 KB Output is correct
68 Correct 2 ms 5212 KB Output is correct
69 Correct 2 ms 5212 KB Output is correct
70 Correct 2 ms 5212 KB Output is correct
71 Correct 2 ms 5236 KB Output is correct
72 Correct 2 ms 5208 KB Output is correct
73 Correct 2 ms 5208 KB Output is correct
74 Correct 2 ms 4956 KB Output is correct
75 Correct 2 ms 4700 KB Output is correct
76 Correct 2 ms 5212 KB Output is correct
77 Correct 2 ms 4956 KB Output is correct
78 Correct 2 ms 5212 KB Output is correct
79 Correct 2 ms 4956 KB Output is correct
80 Correct 2 ms 4924 KB Output is correct
81 Correct 2 ms 4700 KB Output is correct
82 Correct 2 ms 4956 KB Output is correct
83 Correct 2 ms 4700 KB Output is correct
84 Correct 2 ms 4724 KB Output is correct
85 Correct 2 ms 4952 KB Output is correct
86 Correct 2 ms 5208 KB Output is correct
87 Correct 2 ms 5212 KB Output is correct
88 Correct 2 ms 5212 KB Output is correct
89 Correct 2 ms 5200 KB Output is correct
90 Correct 2 ms 4956 KB Output is correct
91 Correct 1 ms 2140 KB Output is correct
92 Correct 12 ms 18524 KB Output is correct
93 Correct 12 ms 18756 KB Output is correct
94 Correct 2 ms 4188 KB Output is correct
95 Correct 13 ms 18524 KB Output is correct
96 Correct 12 ms 18584 KB Output is correct
97 Correct 4 ms 7316 KB Output is correct
98 Correct 9 ms 18752 KB Output is correct
99 Correct 8 ms 18536 KB Output is correct
100 Correct 5 ms 13176 KB Output is correct
101 Correct 8 ms 18764 KB Output is correct
102 Correct 8 ms 18692 KB Output is correct
103 Correct 11 ms 18524 KB Output is correct
104 Correct 12 ms 17768 KB Output is correct
105 Correct 11 ms 18536 KB Output is correct
106 Correct 13 ms 18760 KB Output is correct
107 Correct 12 ms 18760 KB Output is correct
108 Correct 12 ms 18536 KB Output is correct
109 Correct 12 ms 18520 KB Output is correct
110 Correct 13 ms 18524 KB Output is correct
111 Correct 13 ms 18524 KB Output is correct
112 Correct 12 ms 18668 KB Output is correct
113 Correct 11 ms 18524 KB Output is correct
114 Correct 11 ms 18700 KB Output is correct
115 Correct 12 ms 18744 KB Output is correct
116 Correct 12 ms 18524 KB Output is correct
117 Correct 12 ms 18524 KB Output is correct
118 Correct 11 ms 18012 KB Output is correct
119 Correct 11 ms 18268 KB Output is correct
120 Correct 12 ms 18524 KB Output is correct
121 Correct 12 ms 17756 KB Output is correct
122 Correct 10 ms 17244 KB Output is correct
123 Correct 11 ms 17660 KB Output is correct
124 Correct 10 ms 18012 KB Output is correct
125 Correct 10 ms 18168 KB Output is correct
126 Correct 12 ms 18520 KB Output is correct
127 Correct 11 ms 18024 KB Output is correct
128 Correct 11 ms 18524 KB Output is correct
129 Correct 10 ms 18740 KB Output is correct
130 Correct 12 ms 18524 KB Output is correct
131 Correct 12 ms 18524 KB Output is correct
132 Correct 12 ms 18524 KB Output is correct
133 Correct 13 ms 18624 KB Output is correct
134 Correct 7 ms 17500 KB Output is correct
135 Correct 6 ms 12888 KB Output is correct
136 Correct 12 ms 23504 KB Output is correct
137 Correct 11 ms 23384 KB Output is correct
138 Correct 5 ms 10844 KB Output is correct
139 Correct 10 ms 23388 KB Output is correct
140 Correct 10 ms 23472 KB Output is correct
141 Correct 8 ms 19036 KB Output is correct
142 Correct 11 ms 23276 KB Output is correct
143 Correct 13 ms 23388 KB Output is correct
144 Correct 2 ms 2140 KB Output is correct
145 Correct 12 ms 23388 KB Output is correct
146 Correct 11 ms 23388 KB Output is correct
147 Correct 13 ms 23132 KB Output is correct
148 Correct 14 ms 21852 KB Output is correct
149 Correct 12 ms 21336 KB Output is correct
150 Correct 13 ms 23388 KB Output is correct
151 Correct 13 ms 23392 KB Output is correct
152 Correct 14 ms 23640 KB Output is correct
153 Correct 13 ms 23456 KB Output is correct
154 Correct 14 ms 23504 KB Output is correct
155 Correct 19 ms 23348 KB Output is correct
156 Correct 15 ms 23388 KB Output is correct
157 Correct 17 ms 23508 KB Output is correct
158 Correct 14 ms 23388 KB Output is correct
159 Correct 16 ms 23388 KB Output is correct
160 Correct 14 ms 23384 KB Output is correct
161 Correct 16 ms 23388 KB Output is correct
162 Correct 16 ms 22108 KB Output is correct
163 Correct 15 ms 22108 KB Output is correct
164 Correct 15 ms 22876 KB Output is correct
165 Correct 16 ms 21340 KB Output is correct
166 Correct 16 ms 22360 KB Output is correct
167 Correct 14 ms 21340 KB Output is correct
168 Correct 10 ms 22364 KB Output is correct
169 Correct 13 ms 22620 KB Output is correct
170 Correct 13 ms 22876 KB Output is correct
171 Correct 15 ms 21896 KB Output is correct
172 Correct 12 ms 21852 KB Output is correct
173 Correct 13 ms 22620 KB Output is correct
174 Correct 12 ms 23508 KB Output is correct
175 Correct 12 ms 23388 KB Output is correct
176 Correct 13 ms 23492 KB Output is correct
177 Correct 13 ms 23388 KB Output is correct
178 Correct 10 ms 22876 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 0 ms 604 KB Output is correct
3 Correct 1 ms 1116 KB Output is correct
4 Correct 2 ms 2908 KB Output is correct
5 Correct 1 ms 2908 KB Output is correct
6 Correct 1 ms 2652 KB Output is correct
7 Correct 1 ms 2904 KB Output is correct
8 Correct 1 ms 2908 KB Output is correct
9 Correct 1 ms 2140 KB Output is correct
10 Correct 1 ms 2908 KB Output is correct
11 Correct 1 ms 2908 KB Output is correct
12 Correct 0 ms 860 KB Output is correct
13 Correct 1 ms 2908 KB Output is correct
14 Correct 1 ms 2908 KB Output is correct
15 Correct 2 ms 2908 KB Output is correct
16 Correct 1 ms 2652 KB Output is correct
17 Correct 1 ms 2648 KB Output is correct
18 Correct 1 ms 2908 KB Output is correct
19 Correct 1 ms 2908 KB Output is correct
20 Correct 1 ms 2908 KB Output is correct
21 Correct 1 ms 2908 KB Output is correct
22 Correct 1 ms 2908 KB Output is correct
23 Correct 1 ms 2908 KB Output is correct
24 Correct 1 ms 2908 KB Output is correct
25 Correct 1 ms 2908 KB Output is correct
26 Correct 1 ms 2908 KB Output is correct
27 Correct 1 ms 2908 KB Output is correct
28 Correct 2 ms 2908 KB Output is correct
29 Correct 1 ms 2908 KB Output is correct
30 Correct 1 ms 2652 KB Output is correct
31 Correct 1 ms 2908 KB Output is correct
32 Correct 1 ms 2652 KB Output is correct
33 Correct 1 ms 2908 KB Output is correct
34 Correct 1 ms 2908 KB Output is correct
35 Correct 1 ms 2908 KB Output is correct
36 Correct 1 ms 2908 KB Output is correct
37 Correct 1 ms 2652 KB Output is correct
38 Correct 2 ms 2704 KB Output is correct
39 Correct 1 ms 2652 KB Output is correct
40 Correct 1 ms 2908 KB Output is correct
41 Correct 1 ms 2908 KB Output is correct
42 Correct 1 ms 2908 KB Output is correct
43 Correct 1 ms 2908 KB Output is correct
44 Correct 1 ms 2908 KB Output is correct
45 Correct 1 ms 2908 KB Output is correct
46 Correct 1 ms 2652 KB Output is correct
47 Correct 1 ms 1880 KB Output is correct
48 Correct 2 ms 5212 KB Output is correct
49 Correct 2 ms 5208 KB Output is correct
50 Correct 2 ms 4956 KB Output is correct
51 Correct 2 ms 5212 KB Output is correct
52 Correct 2 ms 5212 KB Output is correct
53 Correct 1 ms 3164 KB Output is correct
54 Correct 2 ms 5208 KB Output is correct
55 Correct 2 ms 5212 KB Output is correct
56 Correct 2 ms 4940 KB Output is correct
57 Correct 2 ms 5212 KB Output is correct
58 Correct 2 ms 5212 KB Output is correct
59 Correct 2 ms 4956 KB Output is correct
60 Correct 2 ms 4956 KB Output is correct
61 Correct 2 ms 4700 KB Output is correct
62 Correct 2 ms 5212 KB Output is correct
63 Correct 2 ms 5212 KB Output is correct
64 Correct 2 ms 5212 KB Output is correct
65 Correct 3 ms 5240 KB Output is correct
66 Correct 2 ms 5208 KB Output is correct
67 Correct 2 ms 5212 KB Output is correct
68 Correct 2 ms 5212 KB Output is correct
69 Correct 2 ms 5212 KB Output is correct
70 Correct 2 ms 5212 KB Output is correct
71 Correct 2 ms 5236 KB Output is correct
72 Correct 2 ms 5208 KB Output is correct
73 Correct 2 ms 5208 KB Output is correct
74 Correct 2 ms 4956 KB Output is correct
75 Correct 2 ms 4700 KB Output is correct
76 Correct 2 ms 5212 KB Output is correct
77 Correct 2 ms 4956 KB Output is correct
78 Correct 2 ms 5212 KB Output is correct
79 Correct 2 ms 4956 KB Output is correct
80 Correct 2 ms 4924 KB Output is correct
81 Correct 2 ms 4700 KB Output is correct
82 Correct 2 ms 4956 KB Output is correct
83 Correct 2 ms 4700 KB Output is correct
84 Correct 2 ms 4724 KB Output is correct
85 Correct 2 ms 4952 KB Output is correct
86 Correct 2 ms 5208 KB Output is correct
87 Correct 2 ms 5212 KB Output is correct
88 Correct 2 ms 5212 KB Output is correct
89 Correct 2 ms 5200 KB Output is correct
90 Correct 2 ms 4956 KB Output is correct
91 Correct 1 ms 2140 KB Output is correct
92 Correct 12 ms 18524 KB Output is correct
93 Correct 12 ms 18756 KB Output is correct
94 Correct 2 ms 4188 KB Output is correct
95 Correct 13 ms 18524 KB Output is correct
96 Correct 12 ms 18584 KB Output is correct
97 Correct 4 ms 7316 KB Output is correct
98 Correct 9 ms 18752 KB Output is correct
99 Correct 8 ms 18536 KB Output is correct
100 Correct 5 ms 13176 KB Output is correct
101 Correct 8 ms 18764 KB Output is correct
102 Correct 8 ms 18692 KB Output is correct
103 Correct 11 ms 18524 KB Output is correct
104 Correct 12 ms 17768 KB Output is correct
105 Correct 11 ms 18536 KB Output is correct
106 Correct 13 ms 18760 KB Output is correct
107 Correct 12 ms 18760 KB Output is correct
108 Correct 12 ms 18536 KB Output is correct
109 Correct 12 ms 18520 KB Output is correct
110 Correct 13 ms 18524 KB Output is correct
111 Correct 13 ms 18524 KB Output is correct
112 Correct 12 ms 18668 KB Output is correct
113 Correct 11 ms 18524 KB Output is correct
114 Correct 11 ms 18700 KB Output is correct
115 Correct 12 ms 18744 KB Output is correct
116 Correct 12 ms 18524 KB Output is correct
117 Correct 12 ms 18524 KB Output is correct
118 Correct 11 ms 18012 KB Output is correct
119 Correct 11 ms 18268 KB Output is correct
120 Correct 12 ms 18524 KB Output is correct
121 Correct 12 ms 17756 KB Output is correct
122 Correct 10 ms 17244 KB Output is correct
123 Correct 11 ms 17660 KB Output is correct
124 Correct 10 ms 18012 KB Output is correct
125 Correct 10 ms 18168 KB Output is correct
126 Correct 12 ms 18520 KB Output is correct
127 Correct 11 ms 18024 KB Output is correct
128 Correct 11 ms 18524 KB Output is correct
129 Correct 10 ms 18740 KB Output is correct
130 Correct 12 ms 18524 KB Output is correct
131 Correct 12 ms 18524 KB Output is correct
132 Correct 12 ms 18524 KB Output is correct
133 Correct 13 ms 18624 KB Output is correct
134 Correct 7 ms 17500 KB Output is correct
135 Correct 6 ms 12888 KB Output is correct
136 Correct 12 ms 23504 KB Output is correct
137 Correct 11 ms 23384 KB Output is correct
138 Correct 5 ms 10844 KB Output is correct
139 Correct 10 ms 23388 KB Output is correct
140 Correct 10 ms 23472 KB Output is correct
141 Correct 8 ms 19036 KB Output is correct
142 Correct 11 ms 23276 KB Output is correct
143 Correct 13 ms 23388 KB Output is correct
144 Correct 2 ms 2140 KB Output is correct
145 Correct 12 ms 23388 KB Output is correct
146 Correct 11 ms 23388 KB Output is correct
147 Correct 13 ms 23132 KB Output is correct
148 Correct 14 ms 21852 KB Output is correct
149 Correct 12 ms 21336 KB Output is correct
150 Correct 13 ms 23388 KB Output is correct
151 Correct 13 ms 23392 KB Output is correct
152 Correct 14 ms 23640 KB Output is correct
153 Correct 13 ms 23456 KB Output is correct
154 Correct 14 ms 23504 KB Output is correct
155 Correct 19 ms 23348 KB Output is correct
156 Correct 15 ms 23388 KB Output is correct
157 Correct 17 ms 23508 KB Output is correct
158 Correct 14 ms 23388 KB Output is correct
159 Correct 16 ms 23388 KB Output is correct
160 Correct 14 ms 23384 KB Output is correct
161 Correct 16 ms 23388 KB Output is correct
162 Correct 16 ms 22108 KB Output is correct
163 Correct 15 ms 22108 KB Output is correct
164 Correct 15 ms 22876 KB Output is correct
165 Correct 16 ms 21340 KB Output is correct
166 Correct 16 ms 22360 KB Output is correct
167 Correct 14 ms 21340 KB Output is correct
168 Correct 10 ms 22364 KB Output is correct
169 Correct 13 ms 22620 KB Output is correct
170 Correct 13 ms 22876 KB Output is correct
171 Correct 15 ms 21896 KB Output is correct
172 Correct 12 ms 21852 KB Output is correct
173 Correct 13 ms 22620 KB Output is correct
174 Correct 12 ms 23508 KB Output is correct
175 Correct 12 ms 23388 KB Output is correct
176 Correct 13 ms 23492 KB Output is correct
177 Correct 13 ms 23388 KB Output is correct
178 Correct 10 ms 22876 KB Output is correct
179 Correct 45 ms 64604 KB Output is correct
180 Correct 70 ms 115560 KB Output is correct
181 Correct 72 ms 117840 KB Output is correct
182 Correct 39 ms 75624 KB Output is correct
183 Correct 74 ms 117764 KB Output is correct
184 Correct 76 ms 117844 KB Output is correct
185 Correct 66 ms 102740 KB Output is correct
186 Correct 74 ms 117664 KB Output is correct
187 Correct 75 ms 117848 KB Output is correct
188 Correct 55 ms 90420 KB Output is correct
189 Correct 83 ms 117844 KB Output is correct
190 Correct 80 ms 117840 KB Output is correct
191 Correct 142 ms 105960 KB Output is correct
192 Correct 155 ms 115280 KB Output is correct
193 Correct 147 ms 107796 KB Output is correct
194 Correct 158 ms 117808 KB Output is correct
195 Correct 148 ms 117840 KB Output is correct
196 Correct 151 ms 117844 KB Output is correct
197 Correct 153 ms 117776 KB Output is correct
198 Correct 156 ms 117848 KB Output is correct
199 Correct 150 ms 117844 KB Output is correct
200 Correct 178 ms 117792 KB Output is correct
201 Correct 176 ms 117844 KB Output is correct
202 Correct 143 ms 117844 KB Output is correct
203 Correct 149 ms 117904 KB Output is correct
204 Correct 157 ms 117848 KB Output is correct
205 Correct 151 ms 117780 KB Output is correct
206 Correct 188 ms 113232 KB Output is correct
207 Correct 176 ms 108628 KB Output is correct
208 Correct 162 ms 109048 KB Output is correct
209 Correct 166 ms 114236 KB Output is correct
210 Correct 177 ms 110496 KB Output is correct
211 Correct 186 ms 113136 KB Output is correct
212 Correct 81 ms 106324 KB Output is correct
213 Correct 119 ms 107088 KB Output is correct
214 Correct 119 ms 106324 KB Output is correct
215 Correct 123 ms 109544 KB Output is correct
216 Correct 110 ms 105812 KB Output is correct
217 Correct 117 ms 108828 KB Output is correct
218 Correct 109 ms 117840 KB Output is correct
219 Correct 116 ms 117756 KB Output is correct
220 Correct 101 ms 117840 KB Output is correct
221 Correct 118 ms 117860 KB Output is correct
222 Correct 53 ms 109136 KB Output is correct