Submission #1075644

# Submission time Handle Problem Language Result Execution time Memory
1075644 2024-08-26T08:18:10 Z GrindMachine Toy (CEOI24_toy) C++17
100 / 100
191 ms 77832 KB
#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL)
#define pb push_back
#define endl '\n'
#define conts continue
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define sz(a) (int)a.size()
#define yes cout << "YES" << endl
#define no cout << "NO" << endl

#define rep(i,n) for(int i = 0; i < n; ++i)
#define rep1(i,n) for(int i = 1; i <= n; ++i) 
#define rev(i,s,e) for(int i = s; i >= e; --i)
#define trav(i,a) for(auto &i : a)

template<typename T>
void amin(T &x, T y){
	x = min(x,y);
}

template<typename T>
void amax(T &x, T y){
	x = max(x,y);
}

template<typename A,typename B>
string to_string(pair<A,B> p);

string to_string(const string &s){
	return "'"+s+"'";
}

string to_string(const char *s){
	return to_string((string)s);
}

string to_string(bool b){
	return b?"true":"false";
}

template<typename A>
string to_string(A v){
	string res = "{";
	trav(x,v){
		res += to_string(x)+",";
	}
	if(res.back() == ',') res.pop_back();
	res += "}";
	return res;
}

template<typename A,typename B>
string to_string(pair<A,B> p){
	return "("+to_string(p.ff)+","+to_string(p.ss)+")";
}

#define debug(x) cout << #x << " = "; cout << to_string(x) << endl

const int MOD = 1e9 + 7;
const int N = 1.5e3 + 5;
const int inf1 = 1e9 + 5;
const ll inf2 = (ll)1e18 + 5;

vector<int> dx = {-1,1,0,0};
vector<int> dy = {0,0,-1,1};

int cu[N][N], cd[N][N], cl[N][N], cr[N][N];
pii hr[N][N], vr[N][N];
bool vis[N][N];

void solve(int test_case){
	int m,n,w,h; cin >> m >> n >> w >> h;
	int c1,r1,c2,r2; cin >> c1 >> r1 >> c2 >> r2;
	c1++, r1++, c2++, r2++;
	char a[n+5][m+5];
	rep1(i,n) rep1(j,m) cin >> a[i][j];

	rep1(i,n){
		int c = 0;
		rep1(j,m){
			if(a[i][j] == 'X') c = j;
			cl[i][j] = c;
		}
		c = m+1;
		rev(j,m,1){
			if(a[i][j] == 'X') c = j;
			cr[i][j] = c;
		}
	}

	rep1(j,m){
		int c = 0;
		rep1(i,n){
			if(a[i][j] == 'X') c = i;
			cu[i][j] = c;
		}
		c = n+1;
		rev(i,n,1){
			if(a[i][j] == 'X') c = i;
			cd[i][j] = c;
		}
	}

	rep1(i,n){
		rep1(j,m){
			if(a[i][j] == 'X') conts;
			int l = cl[i][j], r = cr[i][j];
			l++, r--;
			int lx = max(j-w+1,l);
			int rx = min(j,r-w+1);
			hr[i][j] = {lx,rx};
		}
	}

	rep1(i,n){
		rep1(j,m){
			if(a[i][j] == 'X') conts;
			int l = cu[i][j], r = cd[i][j];
			l++, r--;
			int lx = max(i-h+1,l);
			int rx = min(i,r-h+1);
			vr[i][j] = {lx,rx};
		}
	}

	auto f = [&](pii p1, pii p2){
		auto [l1,r1] = p1;
		auto [l2,r2] = p2;
		if(l1 > r1 or l2 > r2) return false;
		return max(l1,l2) <= min(r1,r2);
	};

	queue<pii> q;
	q.push({r1,c2});
	vis[r1][c2] = 1;

	while(!q.empty()){
		auto [i,j] = q.front();
		q.pop();

		if(a[i][j] == '*'){
			yes;
			return;
		}

		rep(dir,4){
			int i2 = i+dx[dir], j2 = j+dy[dir];
			if(i2 < 1 or i2 > n or j2 < 1 or j2 > m) conts;
			if(vis[i2][j2]) conts;

			bool ok = false;

			if(dir >= 2){
				if(dir == 2){
					// L
					if(j > hr[i][j].ff){
						ok = f(vr[i][j],vr[i][j-1]);
					}
				}
				else{
					// R
					if(j < hr[i][j].ss+w-1){
						ok = f(vr[i][j],vr[i][j+1]);
					}
				}
			}
			else{
				if(dir == 0){
					// U
					if(i > vr[i][j].ff){
						ok = f(hr[i][j],hr[i-1][j]);
					}
				}
				else{
					// D
					if(i < vr[i][j].ss+h-1){
						ok = f(hr[i][j],hr[i+1][j]);
					}
				}
			}

			if(!ok) conts;

			vis[i2][j2] = 1;
			q.push({i2,j2});
		}
	}

	no;
} 

int main(){
	int t = 1;
	// cin >> t;

	rep1(i,t){
		solve(i);
	}

	return 0;
}

# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 856 KB Output is correct
4 Correct 1 ms 1628 KB Output is correct
5 Correct 1 ms 1628 KB Output is correct
6 Correct 1 ms 1628 KB Output is correct
7 Correct 2 ms 1572 KB Output is correct
8 Correct 1 ms 1564 KB Output is correct
9 Correct 1 ms 1112 KB Output is correct
10 Correct 1 ms 1624 KB Output is correct
11 Correct 1 ms 1880 KB Output is correct
12 Correct 1 ms 604 KB Output is correct
13 Correct 1 ms 1628 KB Output is correct
14 Correct 1 ms 1628 KB Output is correct
15 Correct 1 ms 1628 KB Output is correct
16 Correct 1 ms 1624 KB Output is correct
17 Correct 1 ms 1628 KB Output is correct
18 Correct 1 ms 1624 KB Output is correct
19 Correct 2 ms 1628 KB Output is correct
20 Correct 1 ms 1628 KB Output is correct
21 Correct 2 ms 1628 KB Output is correct
22 Correct 1 ms 1628 KB Output is correct
23 Correct 1 ms 1628 KB Output is correct
24 Correct 1 ms 1628 KB Output is correct
25 Correct 1 ms 1628 KB Output is correct
26 Correct 1 ms 1628 KB Output is correct
27 Correct 1 ms 1628 KB Output is correct
28 Correct 1 ms 1728 KB Output is correct
29 Correct 1 ms 1628 KB Output is correct
30 Correct 1 ms 1628 KB Output is correct
31 Correct 1 ms 1628 KB Output is correct
32 Correct 1 ms 1628 KB Output is correct
33 Correct 1 ms 1628 KB Output is correct
34 Correct 1 ms 1628 KB Output is correct
35 Correct 1 ms 1716 KB Output is correct
36 Correct 1 ms 1624 KB Output is correct
37 Correct 1 ms 1628 KB Output is correct
38 Correct 1 ms 1628 KB Output is correct
39 Correct 1 ms 1628 KB Output is correct
40 Correct 1 ms 1624 KB Output is correct
41 Correct 1 ms 1628 KB Output is correct
42 Correct 1 ms 1628 KB Output is correct
43 Correct 1 ms 1628 KB Output is correct
44 Correct 1 ms 1628 KB Output is correct
45 Correct 1 ms 1628 KB Output is correct
46 Correct 1 ms 1372 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 856 KB Output is correct
4 Correct 1 ms 1628 KB Output is correct
5 Correct 1 ms 1628 KB Output is correct
6 Correct 1 ms 1628 KB Output is correct
7 Correct 2 ms 1572 KB Output is correct
8 Correct 1 ms 1564 KB Output is correct
9 Correct 1 ms 1112 KB Output is correct
10 Correct 1 ms 1624 KB Output is correct
11 Correct 1 ms 1880 KB Output is correct
12 Correct 1 ms 604 KB Output is correct
13 Correct 1 ms 1628 KB Output is correct
14 Correct 1 ms 1628 KB Output is correct
15 Correct 1 ms 1628 KB Output is correct
16 Correct 1 ms 1624 KB Output is correct
17 Correct 1 ms 1628 KB Output is correct
18 Correct 1 ms 1624 KB Output is correct
19 Correct 2 ms 1628 KB Output is correct
20 Correct 1 ms 1628 KB Output is correct
21 Correct 2 ms 1628 KB Output is correct
22 Correct 1 ms 1628 KB Output is correct
23 Correct 1 ms 1628 KB Output is correct
24 Correct 1 ms 1628 KB Output is correct
25 Correct 1 ms 1628 KB Output is correct
26 Correct 1 ms 1628 KB Output is correct
27 Correct 1 ms 1628 KB Output is correct
28 Correct 1 ms 1728 KB Output is correct
29 Correct 1 ms 1628 KB Output is correct
30 Correct 1 ms 1628 KB Output is correct
31 Correct 1 ms 1628 KB Output is correct
32 Correct 1 ms 1628 KB Output is correct
33 Correct 1 ms 1628 KB Output is correct
34 Correct 1 ms 1628 KB Output is correct
35 Correct 1 ms 1716 KB Output is correct
36 Correct 1 ms 1624 KB Output is correct
37 Correct 1 ms 1628 KB Output is correct
38 Correct 1 ms 1628 KB Output is correct
39 Correct 1 ms 1628 KB Output is correct
40 Correct 1 ms 1624 KB Output is correct
41 Correct 1 ms 1628 KB Output is correct
42 Correct 1 ms 1628 KB Output is correct
43 Correct 1 ms 1628 KB Output is correct
44 Correct 1 ms 1628 KB Output is correct
45 Correct 1 ms 1628 KB Output is correct
46 Correct 1 ms 1372 KB Output is correct
47 Correct 1 ms 1112 KB Output is correct
48 Correct 1 ms 2908 KB Output is correct
49 Correct 2 ms 2908 KB Output is correct
50 Correct 1 ms 2652 KB Output is correct
51 Correct 2 ms 2908 KB Output is correct
52 Correct 1 ms 2908 KB Output is correct
53 Correct 1 ms 1884 KB Output is correct
54 Correct 2 ms 2908 KB Output is correct
55 Correct 2 ms 2908 KB Output is correct
56 Correct 1 ms 2496 KB Output is correct
57 Correct 2 ms 2908 KB Output is correct
58 Correct 2 ms 2908 KB Output is correct
59 Correct 2 ms 2904 KB Output is correct
60 Correct 2 ms 2904 KB Output is correct
61 Correct 2 ms 2652 KB Output is correct
62 Correct 2 ms 2980 KB Output is correct
63 Correct 2 ms 3020 KB Output is correct
64 Correct 2 ms 2904 KB Output is correct
65 Correct 2 ms 2908 KB Output is correct
66 Correct 2 ms 2908 KB Output is correct
67 Correct 2 ms 3020 KB Output is correct
68 Correct 2 ms 2908 KB Output is correct
69 Correct 2 ms 2908 KB Output is correct
70 Correct 2 ms 3052 KB Output is correct
71 Correct 2 ms 2908 KB Output is correct
72 Correct 2 ms 2908 KB Output is correct
73 Correct 2 ms 3160 KB Output is correct
74 Correct 1 ms 2908 KB Output is correct
75 Correct 2 ms 2652 KB Output is correct
76 Correct 2 ms 2908 KB Output is correct
77 Correct 2 ms 2908 KB Output is correct
78 Correct 1 ms 2908 KB Output is correct
79 Correct 1 ms 2908 KB Output is correct
80 Correct 1 ms 2652 KB Output is correct
81 Correct 2 ms 2652 KB Output is correct
82 Correct 1 ms 2744 KB Output is correct
83 Correct 2 ms 2652 KB Output is correct
84 Correct 1 ms 2652 KB Output is correct
85 Correct 1 ms 2904 KB Output is correct
86 Correct 2 ms 2908 KB Output is correct
87 Correct 1 ms 2908 KB Output is correct
88 Correct 2 ms 2920 KB Output is correct
89 Correct 1 ms 2908 KB Output is correct
90 Correct 2 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 1220 KB Output is correct
4 Correct 9 ms 10864 KB Output is correct
5 Correct 9 ms 10588 KB Output is correct
6 Correct 2 ms 2508 KB Output is correct
7 Correct 8 ms 11096 KB Output is correct
8 Correct 7 ms 10844 KB Output is correct
9 Correct 3 ms 4084 KB Output is correct
10 Correct 7 ms 10684 KB Output is correct
11 Correct 7 ms 10592 KB Output is correct
12 Correct 5 ms 7260 KB Output is correct
13 Correct 8 ms 10608 KB Output is correct
14 Correct 9 ms 10588 KB Output is correct
15 Correct 8 ms 10852 KB Output is correct
16 Correct 9 ms 10336 KB Output is correct
17 Correct 9 ms 10596 KB Output is correct
18 Correct 9 ms 10920 KB Output is correct
19 Correct 9 ms 11108 KB Output is correct
20 Correct 9 ms 11108 KB Output is correct
21 Correct 9 ms 11360 KB Output is correct
22 Correct 12 ms 11108 KB Output is correct
23 Correct 9 ms 11104 KB Output is correct
24 Correct 10 ms 11100 KB Output is correct
25 Correct 9 ms 11124 KB Output is correct
26 Correct 10 ms 11100 KB Output is correct
27 Correct 9 ms 11096 KB Output is correct
28 Correct 9 ms 11124 KB Output is correct
29 Correct 9 ms 10960 KB Output is correct
30 Correct 7 ms 10340 KB Output is correct
31 Correct 9 ms 10584 KB Output is correct
32 Correct 8 ms 10840 KB Output is correct
33 Correct 9 ms 10336 KB Output is correct
34 Correct 10 ms 10164 KB Output is correct
35 Correct 9 ms 10140 KB Output is correct
36 Correct 8 ms 10076 KB Output is correct
37 Correct 8 ms 10588 KB Output is correct
38 Correct 9 ms 10444 KB Output is correct
39 Correct 9 ms 10332 KB Output is correct
40 Correct 8 ms 10588 KB Output is correct
41 Correct 7 ms 10584 KB Output is correct
42 Correct 9 ms 11100 KB Output is correct
43 Correct 8 ms 11100 KB Output is correct
44 Correct 8 ms 10844 KB Output is correct
45 Correct 9 ms 11100 KB Output is correct
46 Correct 6 ms 8524 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 856 KB Output is correct
4 Correct 1 ms 1628 KB Output is correct
5 Correct 1 ms 1628 KB Output is correct
6 Correct 1 ms 1628 KB Output is correct
7 Correct 2 ms 1572 KB Output is correct
8 Correct 1 ms 1564 KB Output is correct
9 Correct 1 ms 1112 KB Output is correct
10 Correct 1 ms 1624 KB Output is correct
11 Correct 1 ms 1880 KB Output is correct
12 Correct 1 ms 604 KB Output is correct
13 Correct 1 ms 1628 KB Output is correct
14 Correct 1 ms 1628 KB Output is correct
15 Correct 1 ms 1628 KB Output is correct
16 Correct 1 ms 1624 KB Output is correct
17 Correct 1 ms 1628 KB Output is correct
18 Correct 1 ms 1624 KB Output is correct
19 Correct 2 ms 1628 KB Output is correct
20 Correct 1 ms 1628 KB Output is correct
21 Correct 2 ms 1628 KB Output is correct
22 Correct 1 ms 1628 KB Output is correct
23 Correct 1 ms 1628 KB Output is correct
24 Correct 1 ms 1628 KB Output is correct
25 Correct 1 ms 1628 KB Output is correct
26 Correct 1 ms 1628 KB Output is correct
27 Correct 1 ms 1628 KB Output is correct
28 Correct 1 ms 1728 KB Output is correct
29 Correct 1 ms 1628 KB Output is correct
30 Correct 1 ms 1628 KB Output is correct
31 Correct 1 ms 1628 KB Output is correct
32 Correct 1 ms 1628 KB Output is correct
33 Correct 1 ms 1628 KB Output is correct
34 Correct 1 ms 1628 KB Output is correct
35 Correct 1 ms 1716 KB Output is correct
36 Correct 1 ms 1624 KB Output is correct
37 Correct 1 ms 1628 KB Output is correct
38 Correct 1 ms 1628 KB Output is correct
39 Correct 1 ms 1628 KB Output is correct
40 Correct 1 ms 1624 KB Output is correct
41 Correct 1 ms 1628 KB Output is correct
42 Correct 1 ms 1628 KB Output is correct
43 Correct 1 ms 1628 KB Output is correct
44 Correct 1 ms 1628 KB Output is correct
45 Correct 1 ms 1628 KB Output is correct
46 Correct 1 ms 1372 KB Output is correct
47 Correct 1 ms 1112 KB Output is correct
48 Correct 1 ms 2908 KB Output is correct
49 Correct 2 ms 2908 KB Output is correct
50 Correct 1 ms 2652 KB Output is correct
51 Correct 2 ms 2908 KB Output is correct
52 Correct 1 ms 2908 KB Output is correct
53 Correct 1 ms 1884 KB Output is correct
54 Correct 2 ms 2908 KB Output is correct
55 Correct 2 ms 2908 KB Output is correct
56 Correct 1 ms 2496 KB Output is correct
57 Correct 2 ms 2908 KB Output is correct
58 Correct 2 ms 2908 KB Output is correct
59 Correct 2 ms 2904 KB Output is correct
60 Correct 2 ms 2904 KB Output is correct
61 Correct 2 ms 2652 KB Output is correct
62 Correct 2 ms 2980 KB Output is correct
63 Correct 2 ms 3020 KB Output is correct
64 Correct 2 ms 2904 KB Output is correct
65 Correct 2 ms 2908 KB Output is correct
66 Correct 2 ms 2908 KB Output is correct
67 Correct 2 ms 3020 KB Output is correct
68 Correct 2 ms 2908 KB Output is correct
69 Correct 2 ms 2908 KB Output is correct
70 Correct 2 ms 3052 KB Output is correct
71 Correct 2 ms 2908 KB Output is correct
72 Correct 2 ms 2908 KB Output is correct
73 Correct 2 ms 3160 KB Output is correct
74 Correct 1 ms 2908 KB Output is correct
75 Correct 2 ms 2652 KB Output is correct
76 Correct 2 ms 2908 KB Output is correct
77 Correct 2 ms 2908 KB Output is correct
78 Correct 1 ms 2908 KB Output is correct
79 Correct 1 ms 2908 KB Output is correct
80 Correct 1 ms 2652 KB Output is correct
81 Correct 2 ms 2652 KB Output is correct
82 Correct 1 ms 2744 KB Output is correct
83 Correct 2 ms 2652 KB Output is correct
84 Correct 1 ms 2652 KB Output is correct
85 Correct 1 ms 2904 KB Output is correct
86 Correct 2 ms 2908 KB Output is correct
87 Correct 1 ms 2908 KB Output is correct
88 Correct 2 ms 2920 KB Output is correct
89 Correct 1 ms 2908 KB Output is correct
90 Correct 2 ms 2652 KB Output is correct
91 Correct 1 ms 1220 KB Output is correct
92 Correct 9 ms 10864 KB Output is correct
93 Correct 9 ms 10588 KB Output is correct
94 Correct 2 ms 2508 KB Output is correct
95 Correct 8 ms 11096 KB Output is correct
96 Correct 7 ms 10844 KB Output is correct
97 Correct 3 ms 4084 KB Output is correct
98 Correct 7 ms 10684 KB Output is correct
99 Correct 7 ms 10592 KB Output is correct
100 Correct 5 ms 7260 KB Output is correct
101 Correct 8 ms 10608 KB Output is correct
102 Correct 9 ms 10588 KB Output is correct
103 Correct 8 ms 10852 KB Output is correct
104 Correct 9 ms 10336 KB Output is correct
105 Correct 9 ms 10596 KB Output is correct
106 Correct 9 ms 10920 KB Output is correct
107 Correct 9 ms 11108 KB Output is correct
108 Correct 9 ms 11108 KB Output is correct
109 Correct 9 ms 11360 KB Output is correct
110 Correct 12 ms 11108 KB Output is correct
111 Correct 9 ms 11104 KB Output is correct
112 Correct 10 ms 11100 KB Output is correct
113 Correct 9 ms 11124 KB Output is correct
114 Correct 10 ms 11100 KB Output is correct
115 Correct 9 ms 11096 KB Output is correct
116 Correct 9 ms 11124 KB Output is correct
117 Correct 9 ms 10960 KB Output is correct
118 Correct 7 ms 10340 KB Output is correct
119 Correct 9 ms 10584 KB Output is correct
120 Correct 8 ms 10840 KB Output is correct
121 Correct 9 ms 10336 KB Output is correct
122 Correct 10 ms 10164 KB Output is correct
123 Correct 9 ms 10140 KB Output is correct
124 Correct 8 ms 10076 KB Output is correct
125 Correct 8 ms 10588 KB Output is correct
126 Correct 9 ms 10444 KB Output is correct
127 Correct 9 ms 10332 KB Output is correct
128 Correct 8 ms 10588 KB Output is correct
129 Correct 7 ms 10584 KB Output is correct
130 Correct 9 ms 11100 KB Output is correct
131 Correct 8 ms 11100 KB Output is correct
132 Correct 8 ms 10844 KB Output is correct
133 Correct 9 ms 11100 KB Output is correct
134 Correct 6 ms 8524 KB Output is correct
135 Correct 4 ms 7004 KB Output is correct
136 Correct 12 ms 13592 KB Output is correct
137 Correct 11 ms 13404 KB Output is correct
138 Correct 5 ms 6236 KB Output is correct
139 Correct 12 ms 13240 KB Output is correct
140 Correct 12 ms 13404 KB Output is correct
141 Correct 6 ms 10332 KB Output is correct
142 Correct 10 ms 13404 KB Output is correct
143 Correct 11 ms 13404 KB Output is correct
144 Correct 1 ms 1112 KB Output is correct
145 Correct 10 ms 13372 KB Output is correct
146 Correct 12 ms 13388 KB Output is correct
147 Correct 13 ms 13140 KB Output is correct
148 Correct 12 ms 12892 KB Output is correct
149 Correct 17 ms 12512 KB Output is correct
150 Correct 13 ms 13916 KB Output is correct
151 Correct 11 ms 13912 KB Output is correct
152 Correct 12 ms 13912 KB Output is correct
153 Correct 16 ms 13916 KB Output is correct
154 Correct 13 ms 13916 KB Output is correct
155 Correct 11 ms 13944 KB Output is correct
156 Correct 12 ms 13928 KB Output is correct
157 Correct 12 ms 13912 KB Output is correct
158 Correct 13 ms 13732 KB Output is correct
159 Correct 13 ms 13916 KB Output is correct
160 Correct 14 ms 13916 KB Output is correct
161 Correct 11 ms 13916 KB Output is correct
162 Correct 11 ms 13056 KB Output is correct
163 Correct 11 ms 12888 KB Output is correct
164 Correct 10 ms 13256 KB Output is correct
165 Correct 11 ms 12440 KB Output is correct
166 Correct 10 ms 13144 KB Output is correct
167 Correct 11 ms 12636 KB Output is correct
168 Correct 9 ms 12456 KB Output is correct
169 Correct 10 ms 13004 KB Output is correct
170 Correct 11 ms 13148 KB Output is correct
171 Correct 9 ms 12540 KB Output is correct
172 Correct 10 ms 12344 KB Output is correct
173 Correct 9 ms 12892 KB Output is correct
174 Correct 10 ms 13656 KB Output is correct
175 Correct 11 ms 13660 KB Output is correct
176 Correct 10 ms 13516 KB Output is correct
177 Correct 10 ms 13676 KB Output is correct
178 Correct 8 ms 10844 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 856 KB Output is correct
4 Correct 1 ms 1628 KB Output is correct
5 Correct 1 ms 1628 KB Output is correct
6 Correct 1 ms 1628 KB Output is correct
7 Correct 2 ms 1572 KB Output is correct
8 Correct 1 ms 1564 KB Output is correct
9 Correct 1 ms 1112 KB Output is correct
10 Correct 1 ms 1624 KB Output is correct
11 Correct 1 ms 1880 KB Output is correct
12 Correct 1 ms 604 KB Output is correct
13 Correct 1 ms 1628 KB Output is correct
14 Correct 1 ms 1628 KB Output is correct
15 Correct 1 ms 1628 KB Output is correct
16 Correct 1 ms 1624 KB Output is correct
17 Correct 1 ms 1628 KB Output is correct
18 Correct 1 ms 1624 KB Output is correct
19 Correct 2 ms 1628 KB Output is correct
20 Correct 1 ms 1628 KB Output is correct
21 Correct 2 ms 1628 KB Output is correct
22 Correct 1 ms 1628 KB Output is correct
23 Correct 1 ms 1628 KB Output is correct
24 Correct 1 ms 1628 KB Output is correct
25 Correct 1 ms 1628 KB Output is correct
26 Correct 1 ms 1628 KB Output is correct
27 Correct 1 ms 1628 KB Output is correct
28 Correct 1 ms 1728 KB Output is correct
29 Correct 1 ms 1628 KB Output is correct
30 Correct 1 ms 1628 KB Output is correct
31 Correct 1 ms 1628 KB Output is correct
32 Correct 1 ms 1628 KB Output is correct
33 Correct 1 ms 1628 KB Output is correct
34 Correct 1 ms 1628 KB Output is correct
35 Correct 1 ms 1716 KB Output is correct
36 Correct 1 ms 1624 KB Output is correct
37 Correct 1 ms 1628 KB Output is correct
38 Correct 1 ms 1628 KB Output is correct
39 Correct 1 ms 1628 KB Output is correct
40 Correct 1 ms 1624 KB Output is correct
41 Correct 1 ms 1628 KB Output is correct
42 Correct 1 ms 1628 KB Output is correct
43 Correct 1 ms 1628 KB Output is correct
44 Correct 1 ms 1628 KB Output is correct
45 Correct 1 ms 1628 KB Output is correct
46 Correct 1 ms 1372 KB Output is correct
47 Correct 1 ms 1112 KB Output is correct
48 Correct 1 ms 2908 KB Output is correct
49 Correct 2 ms 2908 KB Output is correct
50 Correct 1 ms 2652 KB Output is correct
51 Correct 2 ms 2908 KB Output is correct
52 Correct 1 ms 2908 KB Output is correct
53 Correct 1 ms 1884 KB Output is correct
54 Correct 2 ms 2908 KB Output is correct
55 Correct 2 ms 2908 KB Output is correct
56 Correct 1 ms 2496 KB Output is correct
57 Correct 2 ms 2908 KB Output is correct
58 Correct 2 ms 2908 KB Output is correct
59 Correct 2 ms 2904 KB Output is correct
60 Correct 2 ms 2904 KB Output is correct
61 Correct 2 ms 2652 KB Output is correct
62 Correct 2 ms 2980 KB Output is correct
63 Correct 2 ms 3020 KB Output is correct
64 Correct 2 ms 2904 KB Output is correct
65 Correct 2 ms 2908 KB Output is correct
66 Correct 2 ms 2908 KB Output is correct
67 Correct 2 ms 3020 KB Output is correct
68 Correct 2 ms 2908 KB Output is correct
69 Correct 2 ms 2908 KB Output is correct
70 Correct 2 ms 3052 KB Output is correct
71 Correct 2 ms 2908 KB Output is correct
72 Correct 2 ms 2908 KB Output is correct
73 Correct 2 ms 3160 KB Output is correct
74 Correct 1 ms 2908 KB Output is correct
75 Correct 2 ms 2652 KB Output is correct
76 Correct 2 ms 2908 KB Output is correct
77 Correct 2 ms 2908 KB Output is correct
78 Correct 1 ms 2908 KB Output is correct
79 Correct 1 ms 2908 KB Output is correct
80 Correct 1 ms 2652 KB Output is correct
81 Correct 2 ms 2652 KB Output is correct
82 Correct 1 ms 2744 KB Output is correct
83 Correct 2 ms 2652 KB Output is correct
84 Correct 1 ms 2652 KB Output is correct
85 Correct 1 ms 2904 KB Output is correct
86 Correct 2 ms 2908 KB Output is correct
87 Correct 1 ms 2908 KB Output is correct
88 Correct 2 ms 2920 KB Output is correct
89 Correct 1 ms 2908 KB Output is correct
90 Correct 2 ms 2652 KB Output is correct
91 Correct 1 ms 1220 KB Output is correct
92 Correct 9 ms 10864 KB Output is correct
93 Correct 9 ms 10588 KB Output is correct
94 Correct 2 ms 2508 KB Output is correct
95 Correct 8 ms 11096 KB Output is correct
96 Correct 7 ms 10844 KB Output is correct
97 Correct 3 ms 4084 KB Output is correct
98 Correct 7 ms 10684 KB Output is correct
99 Correct 7 ms 10592 KB Output is correct
100 Correct 5 ms 7260 KB Output is correct
101 Correct 8 ms 10608 KB Output is correct
102 Correct 9 ms 10588 KB Output is correct
103 Correct 8 ms 10852 KB Output is correct
104 Correct 9 ms 10336 KB Output is correct
105 Correct 9 ms 10596 KB Output is correct
106 Correct 9 ms 10920 KB Output is correct
107 Correct 9 ms 11108 KB Output is correct
108 Correct 9 ms 11108 KB Output is correct
109 Correct 9 ms 11360 KB Output is correct
110 Correct 12 ms 11108 KB Output is correct
111 Correct 9 ms 11104 KB Output is correct
112 Correct 10 ms 11100 KB Output is correct
113 Correct 9 ms 11124 KB Output is correct
114 Correct 10 ms 11100 KB Output is correct
115 Correct 9 ms 11096 KB Output is correct
116 Correct 9 ms 11124 KB Output is correct
117 Correct 9 ms 10960 KB Output is correct
118 Correct 7 ms 10340 KB Output is correct
119 Correct 9 ms 10584 KB Output is correct
120 Correct 8 ms 10840 KB Output is correct
121 Correct 9 ms 10336 KB Output is correct
122 Correct 10 ms 10164 KB Output is correct
123 Correct 9 ms 10140 KB Output is correct
124 Correct 8 ms 10076 KB Output is correct
125 Correct 8 ms 10588 KB Output is correct
126 Correct 9 ms 10444 KB Output is correct
127 Correct 9 ms 10332 KB Output is correct
128 Correct 8 ms 10588 KB Output is correct
129 Correct 7 ms 10584 KB Output is correct
130 Correct 9 ms 11100 KB Output is correct
131 Correct 8 ms 11100 KB Output is correct
132 Correct 8 ms 10844 KB Output is correct
133 Correct 9 ms 11100 KB Output is correct
134 Correct 6 ms 8524 KB Output is correct
135 Correct 4 ms 7004 KB Output is correct
136 Correct 12 ms 13592 KB Output is correct
137 Correct 11 ms 13404 KB Output is correct
138 Correct 5 ms 6236 KB Output is correct
139 Correct 12 ms 13240 KB Output is correct
140 Correct 12 ms 13404 KB Output is correct
141 Correct 6 ms 10332 KB Output is correct
142 Correct 10 ms 13404 KB Output is correct
143 Correct 11 ms 13404 KB Output is correct
144 Correct 1 ms 1112 KB Output is correct
145 Correct 10 ms 13372 KB Output is correct
146 Correct 12 ms 13388 KB Output is correct
147 Correct 13 ms 13140 KB Output is correct
148 Correct 12 ms 12892 KB Output is correct
149 Correct 17 ms 12512 KB Output is correct
150 Correct 13 ms 13916 KB Output is correct
151 Correct 11 ms 13912 KB Output is correct
152 Correct 12 ms 13912 KB Output is correct
153 Correct 16 ms 13916 KB Output is correct
154 Correct 13 ms 13916 KB Output is correct
155 Correct 11 ms 13944 KB Output is correct
156 Correct 12 ms 13928 KB Output is correct
157 Correct 12 ms 13912 KB Output is correct
158 Correct 13 ms 13732 KB Output is correct
159 Correct 13 ms 13916 KB Output is correct
160 Correct 14 ms 13916 KB Output is correct
161 Correct 11 ms 13916 KB Output is correct
162 Correct 11 ms 13056 KB Output is correct
163 Correct 11 ms 12888 KB Output is correct
164 Correct 10 ms 13256 KB Output is correct
165 Correct 11 ms 12440 KB Output is correct
166 Correct 10 ms 13144 KB Output is correct
167 Correct 11 ms 12636 KB Output is correct
168 Correct 9 ms 12456 KB Output is correct
169 Correct 10 ms 13004 KB Output is correct
170 Correct 11 ms 13148 KB Output is correct
171 Correct 9 ms 12540 KB Output is correct
172 Correct 10 ms 12344 KB Output is correct
173 Correct 9 ms 12892 KB Output is correct
174 Correct 10 ms 13656 KB Output is correct
175 Correct 11 ms 13660 KB Output is correct
176 Correct 10 ms 13516 KB Output is correct
177 Correct 10 ms 13676 KB Output is correct
178 Correct 8 ms 10844 KB Output is correct
179 Correct 44 ms 37204 KB Output is correct
180 Correct 116 ms 75348 KB Output is correct
181 Correct 108 ms 75344 KB Output is correct
182 Correct 38 ms 41808 KB Output is correct
183 Correct 113 ms 75336 KB Output is correct
184 Correct 116 ms 75316 KB Output is correct
185 Correct 90 ms 65696 KB Output is correct
186 Correct 124 ms 75704 KB Output is correct
187 Correct 114 ms 75348 KB Output is correct
188 Correct 74 ms 57424 KB Output is correct
189 Correct 132 ms 75328 KB Output is correct
190 Correct 161 ms 75464 KB Output is correct
191 Correct 191 ms 69736 KB Output is correct
192 Correct 157 ms 76028 KB Output is correct
193 Correct 155 ms 70988 KB Output is correct
194 Correct 164 ms 77648 KB Output is correct
195 Correct 164 ms 77652 KB Output is correct
196 Correct 161 ms 77652 KB Output is correct
197 Correct 181 ms 77752 KB Output is correct
198 Correct 164 ms 77620 KB Output is correct
199 Correct 163 ms 77648 KB Output is correct
200 Correct 167 ms 77656 KB Output is correct
201 Correct 158 ms 77640 KB Output is correct
202 Correct 163 ms 77652 KB Output is correct
203 Correct 152 ms 77752 KB Output is correct
204 Correct 158 ms 77652 KB Output is correct
205 Correct 158 ms 77648 KB Output is correct
206 Correct 128 ms 74416 KB Output is correct
207 Correct 166 ms 71728 KB Output is correct
208 Correct 125 ms 71504 KB Output is correct
209 Correct 146 ms 75100 KB Output is correct
210 Correct 142 ms 72784 KB Output is correct
211 Correct 111 ms 72784 KB Output is correct
212 Correct 92 ms 68180 KB Output is correct
213 Correct 139 ms 69868 KB Output is correct
214 Correct 103 ms 69464 KB Output is correct
215 Correct 123 ms 71508 KB Output is correct
216 Correct 105 ms 68944 KB Output is correct
217 Correct 114 ms 70992 KB Output is correct
218 Correct 113 ms 76112 KB Output is correct
219 Correct 148 ms 77056 KB Output is correct
220 Correct 168 ms 77832 KB Output is correct
221 Correct 147 ms 77496 KB Output is correct
222 Correct 89 ms 48364 KB Output is correct