Submission #977327

# Submission time Handle Problem Language Result Execution time Memory
977327 2024-05-07T18:24:20 Z Joshua_Andersson Maze (JOI23_ho_t3) C++14
100 / 100
1617 ms 947680 KB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define int ll
const int inf = int(1e18);

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> p2;

#define rep(i, high) for (int i = 0; i < high; i++)
#define repp(i, low, high) for (int i = low; i < high; i++)
#define repe(i, container) for (auto& i : container)
#define sz(container) ((int)container.size())
#define all(x) begin(x),end(x)
#define ceildiv(x,y) ((x + y - 1) / (y))

inline void fast() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); }

auto Start = chrono::high_resolution_clock::now();
void resettimer() { Start = chrono::high_resolution_clock::now(); }
int elapsedmillis() { return chrono::duration_cast<chrono::milliseconds>(chrono::high_resolution_clock::now() - Start).count(); }

#if _LOCAL
#define assert(x) if (!(x)) __debugbreak()
#endif

signed main()
{
	fast();

	int r, c, s;
	cin >> r >> c >> s;
	p2 start, goal;
	cin >> start.first >> start.second;
	cin >> goal.first >> goal.second;
	start.first--; start.second--;
	goal.first--; goal.second--;
	vector<string> grid(r);
	rep(i, r)
	{
		cin >> grid[i];
	}

	queue<p2> whiteq;
	whiteq.push(start);
	int ans = 0;
	vvi visw(r, vi(c));
	vvi visb(r, vi(c));
	vector<p2> dirs = { {1,0},{0,1},{-1,0},{0,-1} };
	vector<p2> dirs2 = { {1,0},{0,1},{-1,0},{0,-1}, {1,1},{1,-1},{-1,1},{-1,-1} };
	typedef tuple<int, int, int> p3;
	while (true)
	{
		queue<p3> blackq;
		while (sz(whiteq))
		{
			p2 p = whiteq.front();
			whiteq.pop();

			if (visw[p.first][p.second]) continue;
			visw[p.first][p.second] = 1;

			if (p == goal)
			{
				cout << ans;
				return 0;
			}

			repe(dir, dirs)
			{
				p2 np = { p.first + dir.first,p.second + dir.second };
				if (np.first < 0 || np.second < 0 || np.first >= r || np.second >= c) continue;
				if (grid[np.first][np.second] == '#') blackq.emplace(1, np.first, np.second);
				else whiteq.emplace(np);
			}
		}


		while (sz(blackq))
		{
			int d, a, b;
			tie(d, a, b) = blackq.front();
			blackq.pop();


			if (d > s) continue;
			if (visb[a][b]) continue;
			visb[a][b] = 1;

			grid[a][b] = '.';
			whiteq.emplace(a, b);

			repe(dir, dirs2)
			{
				p2 np = { a + dir.first, b + dir.second };
				if (np.first < 0 || np.second < 0 || np.first >= r || np.second >= c) continue;
				blackq.emplace(d + 1, np.first, np.second);
			}
		}

		ans++;
	}


	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 424 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 344 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 6 ms 1372 KB Output is correct
20 Correct 3 ms 1520 KB Output is correct
21 Correct 2 ms 1372 KB Output is correct
22 Correct 5 ms 1628 KB Output is correct
23 Correct 6 ms 1372 KB Output is correct
24 Correct 2 ms 1924 KB Output is correct
25 Correct 5 ms 1920 KB Output is correct
26 Correct 1 ms 1368 KB Output is correct
27 Correct 1 ms 1372 KB Output is correct
28 Correct 3 ms 1628 KB Output is correct
29 Correct 17 ms 3068 KB Output is correct
30 Correct 3 ms 1644 KB Output is correct
31 Correct 5 ms 2908 KB Output is correct
32 Correct 15 ms 3328 KB Output is correct
33 Correct 16 ms 2904 KB Output is correct
34 Correct 6 ms 3924 KB Output is correct
35 Correct 11 ms 3920 KB Output is correct
36 Correct 8 ms 4440 KB Output is correct
37 Correct 12 ms 3992 KB Output is correct
38 Correct 3 ms 3164 KB Output is correct
39 Correct 203 ms 26040 KB Output is correct
40 Correct 5 ms 3420 KB Output is correct
41 Correct 4 ms 4932 KB Output is correct
42 Correct 25 ms 4188 KB Output is correct
43 Correct 13 ms 5576 KB Output is correct
44 Correct 21 ms 13716 KB Output is correct
45 Correct 31 ms 14864 KB Output is correct
46 Correct 25 ms 25832 KB Output is correct
47 Correct 163 ms 26660 KB Output is correct
48 Correct 182 ms 25936 KB Output is correct
49 Correct 29 ms 36916 KB Output is correct
50 Correct 57 ms 36920 KB Output is correct
51 Correct 120 ms 32000 KB Output is correct
52 Correct 89 ms 28284 KB Output is correct
53 Correct 182 ms 26716 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 504 KB Output is correct
16 Correct 0 ms 344 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 1 ms 344 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 344 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 1 ms 544 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 344 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 1 ms 1116 KB Output is correct
26 Correct 2 ms 1884 KB Output is correct
27 Correct 2 ms 1372 KB Output is correct
28 Correct 2 ms 1372 KB Output is correct
29 Correct 6 ms 4700 KB Output is correct
30 Correct 6 ms 3928 KB Output is correct
31 Correct 3 ms 1628 KB Output is correct
32 Correct 1 ms 1492 KB Output is correct
33 Correct 1 ms 1512 KB Output is correct
34 Correct 5 ms 4188 KB Output is correct
35 Correct 5 ms 3160 KB Output is correct
36 Correct 5 ms 3164 KB Output is correct
37 Correct 14 ms 8964 KB Output is correct
38 Correct 16 ms 12012 KB Output is correct
39 Correct 16 ms 13324 KB Output is correct
40 Correct 59 ms 43528 KB Output is correct
41 Correct 22 ms 27484 KB Output is correct
42 Correct 51 ms 28112 KB Output is correct
43 Correct 159 ms 89344 KB Output is correct
44 Correct 194 ms 121856 KB Output is correct
45 Correct 58 ms 51152 KB Output is correct
46 Correct 56 ms 48896 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 504 KB Output is correct
16 Correct 0 ms 344 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 1 ms 344 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 344 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
33 Correct 6 ms 1372 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 1 ms 1116 KB Output is correct
37 Correct 3 ms 1640 KB Output is correct
38 Correct 3 ms 1884 KB Output is correct
39 Correct 2 ms 1592 KB Output is correct
40 Correct 6 ms 1744 KB Output is correct
41 Correct 7 ms 1588 KB Output is correct
42 Correct 2 ms 1372 KB Output is correct
43 Correct 7 ms 4772 KB Output is correct
44 Correct 5 ms 3932 KB Output is correct
45 Correct 2 ms 1924 KB Output is correct
46 Correct 4 ms 1924 KB Output is correct
47 Correct 4 ms 1768 KB Output is correct
48 Correct 5 ms 1372 KB Output is correct
49 Correct 4 ms 1628 KB Output is correct
50 Correct 6 ms 1628 KB Output is correct
51 Correct 3 ms 1628 KB Output is correct
52 Correct 1 ms 1628 KB Output is correct
53 Correct 1 ms 1372 KB Output is correct
54 Correct 4 ms 1628 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 504 KB Output is correct
16 Correct 0 ms 344 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 1 ms 344 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 0 ms 344 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
33 Correct 6 ms 1372 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 1 ms 348 KB Output is correct
36 Correct 1 ms 1116 KB Output is correct
37 Correct 3 ms 1640 KB Output is correct
38 Correct 3 ms 1884 KB Output is correct
39 Correct 2 ms 1592 KB Output is correct
40 Correct 6 ms 1744 KB Output is correct
41 Correct 7 ms 1588 KB Output is correct
42 Correct 2 ms 1372 KB Output is correct
43 Correct 7 ms 4772 KB Output is correct
44 Correct 5 ms 3932 KB Output is correct
45 Correct 2 ms 1924 KB Output is correct
46 Correct 4 ms 1924 KB Output is correct
47 Correct 4 ms 1768 KB Output is correct
48 Correct 5 ms 1372 KB Output is correct
49 Correct 4 ms 1628 KB Output is correct
50 Correct 6 ms 1628 KB Output is correct
51 Correct 3 ms 1628 KB Output is correct
52 Correct 1 ms 1628 KB Output is correct
53 Correct 1 ms 1372 KB Output is correct
54 Correct 4 ms 1628 KB Output is correct
55 Correct 17 ms 3416 KB Output is correct
56 Correct 3 ms 1644 KB Output is correct
57 Correct 6 ms 4036 KB Output is correct
58 Correct 13 ms 3000 KB Output is correct
59 Correct 5 ms 3164 KB Output is correct
60 Correct 15 ms 3412 KB Output is correct
61 Correct 16 ms 3160 KB Output is correct
62 Correct 5 ms 3164 KB Output is correct
63 Correct 13 ms 9104 KB Output is correct
64 Correct 22 ms 12388 KB Output is correct
65 Correct 4 ms 4176 KB Output is correct
66 Correct 10 ms 4152 KB Output is correct
67 Correct 12 ms 3600 KB Output is correct
68 Correct 15 ms 3216 KB Output is correct
69 Correct 14 ms 3160 KB Output is correct
70 Correct 14 ms 3420 KB Output is correct
71 Correct 12 ms 3932 KB Output is correct
72 Correct 9 ms 4700 KB Output is correct
73 Correct 13 ms 3912 KB Output is correct
74 Correct 4 ms 3420 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 424 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 344 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 6 ms 1372 KB Output is correct
20 Correct 3 ms 1520 KB Output is correct
21 Correct 2 ms 1372 KB Output is correct
22 Correct 5 ms 1628 KB Output is correct
23 Correct 6 ms 1372 KB Output is correct
24 Correct 2 ms 1924 KB Output is correct
25 Correct 5 ms 1920 KB Output is correct
26 Correct 1 ms 1368 KB Output is correct
27 Correct 1 ms 1372 KB Output is correct
28 Correct 3 ms 1628 KB Output is correct
29 Correct 17 ms 3068 KB Output is correct
30 Correct 3 ms 1644 KB Output is correct
31 Correct 5 ms 2908 KB Output is correct
32 Correct 15 ms 3328 KB Output is correct
33 Correct 16 ms 2904 KB Output is correct
34 Correct 6 ms 3924 KB Output is correct
35 Correct 11 ms 3920 KB Output is correct
36 Correct 8 ms 4440 KB Output is correct
37 Correct 12 ms 3992 KB Output is correct
38 Correct 3 ms 3164 KB Output is correct
39 Correct 203 ms 26040 KB Output is correct
40 Correct 5 ms 3420 KB Output is correct
41 Correct 4 ms 4932 KB Output is correct
42 Correct 25 ms 4188 KB Output is correct
43 Correct 13 ms 5576 KB Output is correct
44 Correct 21 ms 13716 KB Output is correct
45 Correct 31 ms 14864 KB Output is correct
46 Correct 25 ms 25832 KB Output is correct
47 Correct 163 ms 26660 KB Output is correct
48 Correct 182 ms 25936 KB Output is correct
49 Correct 29 ms 36916 KB Output is correct
50 Correct 57 ms 36920 KB Output is correct
51 Correct 120 ms 32000 KB Output is correct
52 Correct 89 ms 28284 KB Output is correct
53 Correct 182 ms 26716 KB Output is correct
54 Correct 1 ms 348 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 0 ms 348 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 1 ms 348 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 0 ms 348 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 0 ms 348 KB Output is correct
63 Correct 0 ms 348 KB Output is correct
64 Correct 0 ms 348 KB Output is correct
65 Correct 0 ms 348 KB Output is correct
66 Correct 0 ms 348 KB Output is correct
67 Correct 0 ms 348 KB Output is correct
68 Correct 1 ms 504 KB Output is correct
69 Correct 0 ms 344 KB Output is correct
70 Correct 0 ms 348 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 0 ms 348 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 0 ms 348 KB Output is correct
75 Correct 0 ms 348 KB Output is correct
76 Correct 0 ms 348 KB Output is correct
77 Correct 0 ms 348 KB Output is correct
78 Correct 0 ms 348 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 1 ms 344 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 0 ms 344 KB Output is correct
84 Correct 1 ms 348 KB Output is correct
85 Correct 0 ms 348 KB Output is correct
86 Correct 0 ms 348 KB Output is correct
87 Correct 0 ms 348 KB Output is correct
88 Correct 0 ms 348 KB Output is correct
89 Correct 1 ms 348 KB Output is correct
90 Correct 0 ms 348 KB Output is correct
91 Correct 0 ms 348 KB Output is correct
92 Correct 0 ms 348 KB Output is correct
93 Correct 0 ms 348 KB Output is correct
94 Correct 0 ms 348 KB Output is correct
95 Correct 0 ms 344 KB Output is correct
96 Correct 1 ms 544 KB Output is correct
97 Correct 0 ms 348 KB Output is correct
98 Correct 1 ms 348 KB Output is correct
99 Correct 0 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 0 ms 348 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 1 ms 344 KB Output is correct
105 Correct 0 ms 348 KB Output is correct
106 Correct 0 ms 348 KB Output is correct
107 Correct 1 ms 348 KB Output is correct
108 Correct 1 ms 344 KB Output is correct
109 Correct 0 ms 348 KB Output is correct
110 Correct 1 ms 1116 KB Output is correct
111 Correct 2 ms 1884 KB Output is correct
112 Correct 2 ms 1372 KB Output is correct
113 Correct 2 ms 1372 KB Output is correct
114 Correct 6 ms 4700 KB Output is correct
115 Correct 6 ms 3928 KB Output is correct
116 Correct 3 ms 1628 KB Output is correct
117 Correct 1 ms 1492 KB Output is correct
118 Correct 1 ms 1512 KB Output is correct
119 Correct 5 ms 4188 KB Output is correct
120 Correct 5 ms 3160 KB Output is correct
121 Correct 5 ms 3164 KB Output is correct
122 Correct 14 ms 8964 KB Output is correct
123 Correct 16 ms 12012 KB Output is correct
124 Correct 16 ms 13324 KB Output is correct
125 Correct 59 ms 43528 KB Output is correct
126 Correct 22 ms 27484 KB Output is correct
127 Correct 51 ms 28112 KB Output is correct
128 Correct 159 ms 89344 KB Output is correct
129 Correct 194 ms 121856 KB Output is correct
130 Correct 58 ms 51152 KB Output is correct
131 Correct 56 ms 48896 KB Output is correct
132 Correct 6 ms 1372 KB Output is correct
133 Correct 0 ms 348 KB Output is correct
134 Correct 1 ms 348 KB Output is correct
135 Correct 1 ms 1116 KB Output is correct
136 Correct 3 ms 1640 KB Output is correct
137 Correct 3 ms 1884 KB Output is correct
138 Correct 2 ms 1592 KB Output is correct
139 Correct 6 ms 1744 KB Output is correct
140 Correct 7 ms 1588 KB Output is correct
141 Correct 2 ms 1372 KB Output is correct
142 Correct 7 ms 4772 KB Output is correct
143 Correct 5 ms 3932 KB Output is correct
144 Correct 2 ms 1924 KB Output is correct
145 Correct 4 ms 1924 KB Output is correct
146 Correct 4 ms 1768 KB Output is correct
147 Correct 5 ms 1372 KB Output is correct
148 Correct 4 ms 1628 KB Output is correct
149 Correct 6 ms 1628 KB Output is correct
150 Correct 3 ms 1628 KB Output is correct
151 Correct 1 ms 1628 KB Output is correct
152 Correct 1 ms 1372 KB Output is correct
153 Correct 4 ms 1628 KB Output is correct
154 Correct 17 ms 3416 KB Output is correct
155 Correct 3 ms 1644 KB Output is correct
156 Correct 6 ms 4036 KB Output is correct
157 Correct 13 ms 3000 KB Output is correct
158 Correct 5 ms 3164 KB Output is correct
159 Correct 15 ms 3412 KB Output is correct
160 Correct 16 ms 3160 KB Output is correct
161 Correct 5 ms 3164 KB Output is correct
162 Correct 13 ms 9104 KB Output is correct
163 Correct 22 ms 12388 KB Output is correct
164 Correct 4 ms 4176 KB Output is correct
165 Correct 10 ms 4152 KB Output is correct
166 Correct 12 ms 3600 KB Output is correct
167 Correct 15 ms 3216 KB Output is correct
168 Correct 14 ms 3160 KB Output is correct
169 Correct 14 ms 3420 KB Output is correct
170 Correct 12 ms 3932 KB Output is correct
171 Correct 9 ms 4700 KB Output is correct
172 Correct 13 ms 3912 KB Output is correct
173 Correct 4 ms 3420 KB Output is correct
174 Correct 7 ms 3928 KB Output is correct
175 Correct 33 ms 6492 KB Output is correct
176 Correct 28 ms 15676 KB Output is correct
177 Correct 80 ms 18676 KB Output is correct
178 Correct 17 ms 24128 KB Output is correct
179 Correct 79 ms 27536 KB Output is correct
180 Correct 141 ms 28132 KB Output is correct
181 Correct 155 ms 29132 KB Output is correct
182 Correct 150 ms 31868 KB Output is correct
183 Correct 224 ms 55452 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 424 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 344 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 6 ms 1372 KB Output is correct
20 Correct 3 ms 1520 KB Output is correct
21 Correct 2 ms 1372 KB Output is correct
22 Correct 5 ms 1628 KB Output is correct
23 Correct 6 ms 1372 KB Output is correct
24 Correct 2 ms 1924 KB Output is correct
25 Correct 5 ms 1920 KB Output is correct
26 Correct 1 ms 1368 KB Output is correct
27 Correct 1 ms 1372 KB Output is correct
28 Correct 3 ms 1628 KB Output is correct
29 Correct 17 ms 3068 KB Output is correct
30 Correct 3 ms 1644 KB Output is correct
31 Correct 5 ms 2908 KB Output is correct
32 Correct 15 ms 3328 KB Output is correct
33 Correct 16 ms 2904 KB Output is correct
34 Correct 6 ms 3924 KB Output is correct
35 Correct 11 ms 3920 KB Output is correct
36 Correct 8 ms 4440 KB Output is correct
37 Correct 12 ms 3992 KB Output is correct
38 Correct 3 ms 3164 KB Output is correct
39 Correct 203 ms 26040 KB Output is correct
40 Correct 5 ms 3420 KB Output is correct
41 Correct 4 ms 4932 KB Output is correct
42 Correct 25 ms 4188 KB Output is correct
43 Correct 13 ms 5576 KB Output is correct
44 Correct 21 ms 13716 KB Output is correct
45 Correct 31 ms 14864 KB Output is correct
46 Correct 25 ms 25832 KB Output is correct
47 Correct 163 ms 26660 KB Output is correct
48 Correct 182 ms 25936 KB Output is correct
49 Correct 29 ms 36916 KB Output is correct
50 Correct 57 ms 36920 KB Output is correct
51 Correct 120 ms 32000 KB Output is correct
52 Correct 89 ms 28284 KB Output is correct
53 Correct 182 ms 26716 KB Output is correct
54 Correct 1 ms 348 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 0 ms 348 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 1 ms 348 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 0 ms 348 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 0 ms 348 KB Output is correct
63 Correct 0 ms 348 KB Output is correct
64 Correct 0 ms 348 KB Output is correct
65 Correct 0 ms 348 KB Output is correct
66 Correct 0 ms 348 KB Output is correct
67 Correct 0 ms 348 KB Output is correct
68 Correct 1 ms 504 KB Output is correct
69 Correct 0 ms 344 KB Output is correct
70 Correct 0 ms 348 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 0 ms 348 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 0 ms 348 KB Output is correct
75 Correct 0 ms 348 KB Output is correct
76 Correct 0 ms 348 KB Output is correct
77 Correct 0 ms 348 KB Output is correct
78 Correct 0 ms 348 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 1 ms 344 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 0 ms 344 KB Output is correct
84 Correct 1 ms 348 KB Output is correct
85 Correct 0 ms 348 KB Output is correct
86 Correct 0 ms 348 KB Output is correct
87 Correct 0 ms 348 KB Output is correct
88 Correct 0 ms 348 KB Output is correct
89 Correct 1 ms 348 KB Output is correct
90 Correct 0 ms 348 KB Output is correct
91 Correct 0 ms 348 KB Output is correct
92 Correct 0 ms 348 KB Output is correct
93 Correct 0 ms 348 KB Output is correct
94 Correct 0 ms 348 KB Output is correct
95 Correct 0 ms 344 KB Output is correct
96 Correct 1 ms 544 KB Output is correct
97 Correct 0 ms 348 KB Output is correct
98 Correct 1 ms 348 KB Output is correct
99 Correct 0 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 0 ms 348 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 1 ms 344 KB Output is correct
105 Correct 0 ms 348 KB Output is correct
106 Correct 0 ms 348 KB Output is correct
107 Correct 1 ms 348 KB Output is correct
108 Correct 1 ms 344 KB Output is correct
109 Correct 0 ms 348 KB Output is correct
110 Correct 1 ms 1116 KB Output is correct
111 Correct 2 ms 1884 KB Output is correct
112 Correct 2 ms 1372 KB Output is correct
113 Correct 2 ms 1372 KB Output is correct
114 Correct 6 ms 4700 KB Output is correct
115 Correct 6 ms 3928 KB Output is correct
116 Correct 3 ms 1628 KB Output is correct
117 Correct 1 ms 1492 KB Output is correct
118 Correct 1 ms 1512 KB Output is correct
119 Correct 5 ms 4188 KB Output is correct
120 Correct 5 ms 3160 KB Output is correct
121 Correct 5 ms 3164 KB Output is correct
122 Correct 14 ms 8964 KB Output is correct
123 Correct 16 ms 12012 KB Output is correct
124 Correct 16 ms 13324 KB Output is correct
125 Correct 59 ms 43528 KB Output is correct
126 Correct 22 ms 27484 KB Output is correct
127 Correct 51 ms 28112 KB Output is correct
128 Correct 159 ms 89344 KB Output is correct
129 Correct 194 ms 121856 KB Output is correct
130 Correct 58 ms 51152 KB Output is correct
131 Correct 56 ms 48896 KB Output is correct
132 Correct 6 ms 1372 KB Output is correct
133 Correct 0 ms 348 KB Output is correct
134 Correct 1 ms 348 KB Output is correct
135 Correct 1 ms 1116 KB Output is correct
136 Correct 3 ms 1640 KB Output is correct
137 Correct 3 ms 1884 KB Output is correct
138 Correct 2 ms 1592 KB Output is correct
139 Correct 6 ms 1744 KB Output is correct
140 Correct 7 ms 1588 KB Output is correct
141 Correct 2 ms 1372 KB Output is correct
142 Correct 7 ms 4772 KB Output is correct
143 Correct 5 ms 3932 KB Output is correct
144 Correct 2 ms 1924 KB Output is correct
145 Correct 4 ms 1924 KB Output is correct
146 Correct 4 ms 1768 KB Output is correct
147 Correct 5 ms 1372 KB Output is correct
148 Correct 4 ms 1628 KB Output is correct
149 Correct 6 ms 1628 KB Output is correct
150 Correct 3 ms 1628 KB Output is correct
151 Correct 1 ms 1628 KB Output is correct
152 Correct 1 ms 1372 KB Output is correct
153 Correct 4 ms 1628 KB Output is correct
154 Correct 17 ms 3416 KB Output is correct
155 Correct 3 ms 1644 KB Output is correct
156 Correct 6 ms 4036 KB Output is correct
157 Correct 13 ms 3000 KB Output is correct
158 Correct 5 ms 3164 KB Output is correct
159 Correct 15 ms 3412 KB Output is correct
160 Correct 16 ms 3160 KB Output is correct
161 Correct 5 ms 3164 KB Output is correct
162 Correct 13 ms 9104 KB Output is correct
163 Correct 22 ms 12388 KB Output is correct
164 Correct 4 ms 4176 KB Output is correct
165 Correct 10 ms 4152 KB Output is correct
166 Correct 12 ms 3600 KB Output is correct
167 Correct 15 ms 3216 KB Output is correct
168 Correct 14 ms 3160 KB Output is correct
169 Correct 14 ms 3420 KB Output is correct
170 Correct 12 ms 3932 KB Output is correct
171 Correct 9 ms 4700 KB Output is correct
172 Correct 13 ms 3912 KB Output is correct
173 Correct 4 ms 3420 KB Output is correct
174 Correct 7 ms 3928 KB Output is correct
175 Correct 33 ms 6492 KB Output is correct
176 Correct 28 ms 15676 KB Output is correct
177 Correct 80 ms 18676 KB Output is correct
178 Correct 17 ms 24128 KB Output is correct
179 Correct 79 ms 27536 KB Output is correct
180 Correct 141 ms 28132 KB Output is correct
181 Correct 155 ms 29132 KB Output is correct
182 Correct 150 ms 31868 KB Output is correct
183 Correct 224 ms 55452 KB Output is correct
184 Correct 463 ms 54084 KB Output is correct
185 Correct 71 ms 30172 KB Output is correct
186 Correct 100 ms 53508 KB Output is correct
187 Correct 71 ms 43124 KB Output is correct
188 Correct 200 ms 56404 KB Output is correct
189 Correct 344 ms 55680 KB Output is correct
190 Correct 172 ms 54028 KB Output is correct
191 Correct 162 ms 56404 KB Output is correct
192 Correct 500 ms 243412 KB Output is correct
193 Correct 519 ms 235856 KB Output is correct
194 Correct 70 ms 77636 KB Output is correct
195 Correct 141 ms 77412 KB Output is correct
196 Correct 328 ms 54100 KB Output is correct
197 Correct 168 ms 55240 KB Output is correct
198 Correct 181 ms 56900 KB Output is correct
199 Correct 366 ms 60984 KB Output is correct
200 Correct 172 ms 62644 KB Output is correct
201 Correct 286 ms 58220 KB Output is correct
202 Correct 535 ms 55556 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 424 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 344 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 6 ms 1372 KB Output is correct
20 Correct 3 ms 1520 KB Output is correct
21 Correct 2 ms 1372 KB Output is correct
22 Correct 5 ms 1628 KB Output is correct
23 Correct 6 ms 1372 KB Output is correct
24 Correct 2 ms 1924 KB Output is correct
25 Correct 5 ms 1920 KB Output is correct
26 Correct 1 ms 1368 KB Output is correct
27 Correct 1 ms 1372 KB Output is correct
28 Correct 3 ms 1628 KB Output is correct
29 Correct 17 ms 3068 KB Output is correct
30 Correct 3 ms 1644 KB Output is correct
31 Correct 5 ms 2908 KB Output is correct
32 Correct 15 ms 3328 KB Output is correct
33 Correct 16 ms 2904 KB Output is correct
34 Correct 6 ms 3924 KB Output is correct
35 Correct 11 ms 3920 KB Output is correct
36 Correct 8 ms 4440 KB Output is correct
37 Correct 12 ms 3992 KB Output is correct
38 Correct 3 ms 3164 KB Output is correct
39 Correct 203 ms 26040 KB Output is correct
40 Correct 5 ms 3420 KB Output is correct
41 Correct 4 ms 4932 KB Output is correct
42 Correct 25 ms 4188 KB Output is correct
43 Correct 13 ms 5576 KB Output is correct
44 Correct 21 ms 13716 KB Output is correct
45 Correct 31 ms 14864 KB Output is correct
46 Correct 25 ms 25832 KB Output is correct
47 Correct 163 ms 26660 KB Output is correct
48 Correct 182 ms 25936 KB Output is correct
49 Correct 29 ms 36916 KB Output is correct
50 Correct 57 ms 36920 KB Output is correct
51 Correct 120 ms 32000 KB Output is correct
52 Correct 89 ms 28284 KB Output is correct
53 Correct 182 ms 26716 KB Output is correct
54 Correct 1 ms 348 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 0 ms 348 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 1 ms 348 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 0 ms 348 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 0 ms 348 KB Output is correct
63 Correct 0 ms 348 KB Output is correct
64 Correct 0 ms 348 KB Output is correct
65 Correct 0 ms 348 KB Output is correct
66 Correct 0 ms 348 KB Output is correct
67 Correct 0 ms 348 KB Output is correct
68 Correct 1 ms 504 KB Output is correct
69 Correct 0 ms 344 KB Output is correct
70 Correct 0 ms 348 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 0 ms 348 KB Output is correct
73 Correct 1 ms 348 KB Output is correct
74 Correct 0 ms 348 KB Output is correct
75 Correct 0 ms 348 KB Output is correct
76 Correct 0 ms 348 KB Output is correct
77 Correct 0 ms 348 KB Output is correct
78 Correct 0 ms 348 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 1 ms 344 KB Output is correct
81 Correct 1 ms 348 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 0 ms 344 KB Output is correct
84 Correct 1 ms 348 KB Output is correct
85 Correct 0 ms 348 KB Output is correct
86 Correct 0 ms 348 KB Output is correct
87 Correct 0 ms 348 KB Output is correct
88 Correct 0 ms 348 KB Output is correct
89 Correct 1 ms 348 KB Output is correct
90 Correct 0 ms 348 KB Output is correct
91 Correct 0 ms 348 KB Output is correct
92 Correct 0 ms 348 KB Output is correct
93 Correct 0 ms 348 KB Output is correct
94 Correct 0 ms 348 KB Output is correct
95 Correct 0 ms 344 KB Output is correct
96 Correct 1 ms 544 KB Output is correct
97 Correct 0 ms 348 KB Output is correct
98 Correct 1 ms 348 KB Output is correct
99 Correct 0 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 0 ms 348 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 1 ms 344 KB Output is correct
105 Correct 0 ms 348 KB Output is correct
106 Correct 0 ms 348 KB Output is correct
107 Correct 1 ms 348 KB Output is correct
108 Correct 1 ms 344 KB Output is correct
109 Correct 0 ms 348 KB Output is correct
110 Correct 1 ms 1116 KB Output is correct
111 Correct 2 ms 1884 KB Output is correct
112 Correct 2 ms 1372 KB Output is correct
113 Correct 2 ms 1372 KB Output is correct
114 Correct 6 ms 4700 KB Output is correct
115 Correct 6 ms 3928 KB Output is correct
116 Correct 3 ms 1628 KB Output is correct
117 Correct 1 ms 1492 KB Output is correct
118 Correct 1 ms 1512 KB Output is correct
119 Correct 5 ms 4188 KB Output is correct
120 Correct 5 ms 3160 KB Output is correct
121 Correct 5 ms 3164 KB Output is correct
122 Correct 14 ms 8964 KB Output is correct
123 Correct 16 ms 12012 KB Output is correct
124 Correct 16 ms 13324 KB Output is correct
125 Correct 59 ms 43528 KB Output is correct
126 Correct 22 ms 27484 KB Output is correct
127 Correct 51 ms 28112 KB Output is correct
128 Correct 159 ms 89344 KB Output is correct
129 Correct 194 ms 121856 KB Output is correct
130 Correct 58 ms 51152 KB Output is correct
131 Correct 56 ms 48896 KB Output is correct
132 Correct 6 ms 1372 KB Output is correct
133 Correct 0 ms 348 KB Output is correct
134 Correct 1 ms 348 KB Output is correct
135 Correct 1 ms 1116 KB Output is correct
136 Correct 3 ms 1640 KB Output is correct
137 Correct 3 ms 1884 KB Output is correct
138 Correct 2 ms 1592 KB Output is correct
139 Correct 6 ms 1744 KB Output is correct
140 Correct 7 ms 1588 KB Output is correct
141 Correct 2 ms 1372 KB Output is correct
142 Correct 7 ms 4772 KB Output is correct
143 Correct 5 ms 3932 KB Output is correct
144 Correct 2 ms 1924 KB Output is correct
145 Correct 4 ms 1924 KB Output is correct
146 Correct 4 ms 1768 KB Output is correct
147 Correct 5 ms 1372 KB Output is correct
148 Correct 4 ms 1628 KB Output is correct
149 Correct 6 ms 1628 KB Output is correct
150 Correct 3 ms 1628 KB Output is correct
151 Correct 1 ms 1628 KB Output is correct
152 Correct 1 ms 1372 KB Output is correct
153 Correct 4 ms 1628 KB Output is correct
154 Correct 17 ms 3416 KB Output is correct
155 Correct 3 ms 1644 KB Output is correct
156 Correct 6 ms 4036 KB Output is correct
157 Correct 13 ms 3000 KB Output is correct
158 Correct 5 ms 3164 KB Output is correct
159 Correct 15 ms 3412 KB Output is correct
160 Correct 16 ms 3160 KB Output is correct
161 Correct 5 ms 3164 KB Output is correct
162 Correct 13 ms 9104 KB Output is correct
163 Correct 22 ms 12388 KB Output is correct
164 Correct 4 ms 4176 KB Output is correct
165 Correct 10 ms 4152 KB Output is correct
166 Correct 12 ms 3600 KB Output is correct
167 Correct 15 ms 3216 KB Output is correct
168 Correct 14 ms 3160 KB Output is correct
169 Correct 14 ms 3420 KB Output is correct
170 Correct 12 ms 3932 KB Output is correct
171 Correct 9 ms 4700 KB Output is correct
172 Correct 13 ms 3912 KB Output is correct
173 Correct 4 ms 3420 KB Output is correct
174 Correct 7 ms 3928 KB Output is correct
175 Correct 33 ms 6492 KB Output is correct
176 Correct 28 ms 15676 KB Output is correct
177 Correct 80 ms 18676 KB Output is correct
178 Correct 17 ms 24128 KB Output is correct
179 Correct 79 ms 27536 KB Output is correct
180 Correct 141 ms 28132 KB Output is correct
181 Correct 155 ms 29132 KB Output is correct
182 Correct 150 ms 31868 KB Output is correct
183 Correct 224 ms 55452 KB Output is correct
184 Correct 463 ms 54084 KB Output is correct
185 Correct 71 ms 30172 KB Output is correct
186 Correct 100 ms 53508 KB Output is correct
187 Correct 71 ms 43124 KB Output is correct
188 Correct 200 ms 56404 KB Output is correct
189 Correct 344 ms 55680 KB Output is correct
190 Correct 172 ms 54028 KB Output is correct
191 Correct 162 ms 56404 KB Output is correct
192 Correct 500 ms 243412 KB Output is correct
193 Correct 519 ms 235856 KB Output is correct
194 Correct 70 ms 77636 KB Output is correct
195 Correct 141 ms 77412 KB Output is correct
196 Correct 328 ms 54100 KB Output is correct
197 Correct 168 ms 55240 KB Output is correct
198 Correct 181 ms 56900 KB Output is correct
199 Correct 366 ms 60984 KB Output is correct
200 Correct 172 ms 62644 KB Output is correct
201 Correct 286 ms 58220 KB Output is correct
202 Correct 535 ms 55556 KB Output is correct
203 Correct 1117 ms 107720 KB Output is correct
204 Correct 356 ms 78348 KB Output is correct
205 Correct 520 ms 67860 KB Output is correct
206 Correct 171 ms 107168 KB Output is correct
207 Correct 342 ms 111448 KB Output is correct
208 Correct 692 ms 110048 KB Output is correct
209 Correct 1124 ms 107436 KB Output is correct
210 Correct 190 ms 109904 KB Output is correct
211 Correct 793 ms 372376 KB Output is correct
212 Correct 1162 ms 500512 KB Output is correct
213 Correct 132 ms 155076 KB Output is correct
214 Correct 286 ms 154888 KB Output is correct
215 Correct 567 ms 107284 KB Output is correct
216 Correct 581 ms 108564 KB Output is correct
217 Correct 671 ms 111796 KB Output is correct
218 Correct 605 ms 119204 KB Output is correct
219 Correct 1028 ms 383740 KB Output is correct
220 Correct 169 ms 151272 KB Output is correct
221 Correct 261 ms 211644 KB Output is correct
222 Correct 1617 ms 947680 KB Output is correct
223 Correct 694 ms 118728 KB Output is correct
224 Correct 701 ms 114224 KB Output is correct
225 Correct 529 ms 109004 KB Output is correct