# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
770694 |
2023-07-01T18:01:21 Z |
boris_mihov |
Maze (JOI23_ho_t3) |
C++17 |
|
2000 ms |
347544 KB |
#include <algorithm>
#include <iostream>
#include <numeric>
#include <cassert>
#include <vector>
#include <queue>
typedef long long llong;
const int MAXN = 6000000 + 10;
const int INF = 1e9;
int r, c, n;
int sRow, sCol;
int eRow, eCol;
std::pair <int,int> delta[] = {{-1, 0}, {0, -1}, {1, 0}, {0, 1}};
std::deque <std::pair <int,int>> dq;
std::vector <int> dist[MAXN];
std::string t[MAXN];
bool isOutside(int row, int col)
{
return row == 0 || row == r + 1 || col == 0 || col == c + 1;
}
void solve()
{
for (int i = 1 ; i <= r ; ++i)
{
std::fill(dist[i].begin(), dist[i].end(), INF);
}
dq.push_back({sRow, sCol});
dist[sRow][sCol] = 0;
while (!dq.empty())
{
auto [row, col] = dq.front();
dq.pop_front();
if (row == eRow && col == eCol)
{
std::cout << dist[row][col] << '\n';
break;
}
for (const auto &[dx, dy] : delta)
{
if (isOutside(row + dx, col + dy) || dist[row + dx][col + dy] <= dist[row][col])
{
continue;
}
if (t[row + dx][col + dy] == '.')
{
dist[row + dx][col + dy] = dist[row][col];
dq.push_front({row + dx, col + dy});
}
}
if (abs(row - eRow) <= n && abs(col - eCol) <= n && dist[eRow][eCol] > dist[row][col])
{
dist[eRow][eCol] = dist[row][col] + 1;
dq.push_back({eRow, eCol});
}
for (int i = std::max(1, col - n + 1) ; i <= std::min(c, col + n - 1) ; ++i)
{
int prevR = std::max(1, row - n);
int nextR = std::min(r, row + n);
if (dist[prevR][i] > dist[row][col] + 1)
{
dist[prevR][i] = dist[row][col] + 1;
dq.push_back({prevR, i});
}
if (dist[nextR][i] > dist[row][col] + 1)
{
dist[nextR][i] = dist[row][col] + 1;
dq.push_back({nextR, i});
}
}
for (int i = std::max(1, row - n + 1) ; i <= std::min(r, row + n - 1) ; ++i)
{
int prevC = std::max(1, col - n);
int nextC = std::min(c, col + n);
if (dist[i][prevC] > dist[row][col] + 1)
{
dist[i][prevC] = dist[row][col] + 1;
dq.push_back({i, prevC});
}
if (dist[i][nextC] > dist[row][col] + 1)
{
dist[i][nextC] = dist[row][col] + 1;
dq.push_back({i, nextC});
}
}
}
}
void input()
{
std::cin >> r >> c >> n;
std::cin >> sRow >> sCol;
std::cin >> eRow >> eCol;
for (int i = 1 ; i <= r ; ++i)
{
std::cin >> t[i];
t[i] = ' ' + t[i];
dist[i].resize(c + 1, INF);
}
}
void fastIOI()
{
std::ios_base :: sync_with_stdio(0);
std::cout.tie(nullptr);
std::cin.tie(nullptr);
}
int main()
{
fastIOI();
input();
solve();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
158 ms |
329024 KB |
Output is correct |
2 |
Correct |
153 ms |
329076 KB |
Output is correct |
3 |
Correct |
173 ms |
329020 KB |
Output is correct |
4 |
Correct |
142 ms |
329136 KB |
Output is correct |
5 |
Correct |
138 ms |
329076 KB |
Output is correct |
6 |
Correct |
138 ms |
329080 KB |
Output is correct |
7 |
Correct |
141 ms |
329016 KB |
Output is correct |
8 |
Correct |
141 ms |
329076 KB |
Output is correct |
9 |
Correct |
138 ms |
329004 KB |
Output is correct |
10 |
Correct |
138 ms |
329036 KB |
Output is correct |
11 |
Correct |
138 ms |
328976 KB |
Output is correct |
12 |
Correct |
145 ms |
329132 KB |
Output is correct |
13 |
Correct |
137 ms |
329068 KB |
Output is correct |
14 |
Correct |
139 ms |
329076 KB |
Output is correct |
15 |
Correct |
139 ms |
328976 KB |
Output is correct |
16 |
Correct |
137 ms |
329036 KB |
Output is correct |
17 |
Correct |
138 ms |
328964 KB |
Output is correct |
18 |
Correct |
138 ms |
329000 KB |
Output is correct |
19 |
Correct |
140 ms |
329340 KB |
Output is correct |
20 |
Correct |
142 ms |
329304 KB |
Output is correct |
21 |
Correct |
146 ms |
329688 KB |
Output is correct |
22 |
Correct |
145 ms |
329576 KB |
Output is correct |
23 |
Correct |
143 ms |
329384 KB |
Output is correct |
24 |
Correct |
148 ms |
329508 KB |
Output is correct |
25 |
Correct |
141 ms |
329428 KB |
Output is correct |
26 |
Correct |
139 ms |
329436 KB |
Output is correct |
27 |
Correct |
139 ms |
329372 KB |
Output is correct |
28 |
Correct |
145 ms |
329452 KB |
Output is correct |
29 |
Correct |
143 ms |
329880 KB |
Output is correct |
30 |
Correct |
140 ms |
329448 KB |
Output is correct |
31 |
Correct |
140 ms |
330128 KB |
Output is correct |
32 |
Correct |
150 ms |
330056 KB |
Output is correct |
33 |
Correct |
144 ms |
329980 KB |
Output is correct |
34 |
Correct |
143 ms |
329996 KB |
Output is correct |
35 |
Correct |
158 ms |
329964 KB |
Output is correct |
36 |
Correct |
147 ms |
329992 KB |
Output is correct |
37 |
Correct |
148 ms |
329924 KB |
Output is correct |
38 |
Correct |
152 ms |
329988 KB |
Output is correct |
39 |
Correct |
194 ms |
337868 KB |
Output is correct |
40 |
Correct |
145 ms |
330376 KB |
Output is correct |
41 |
Correct |
144 ms |
330236 KB |
Output is correct |
42 |
Correct |
149 ms |
330256 KB |
Output is correct |
43 |
Correct |
144 ms |
330432 KB |
Output is correct |
44 |
Correct |
157 ms |
333724 KB |
Output is correct |
45 |
Correct |
153 ms |
334036 KB |
Output is correct |
46 |
Correct |
171 ms |
344164 KB |
Output is correct |
47 |
Correct |
204 ms |
337952 KB |
Output is correct |
48 |
Correct |
174 ms |
337964 KB |
Output is correct |
49 |
Correct |
158 ms |
337972 KB |
Output is correct |
50 |
Correct |
163 ms |
337980 KB |
Output is correct |
51 |
Correct |
185 ms |
338112 KB |
Output is correct |
52 |
Correct |
171 ms |
338036 KB |
Output is correct |
53 |
Correct |
184 ms |
338000 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
144 ms |
329036 KB |
Output is correct |
2 |
Correct |
160 ms |
329036 KB |
Output is correct |
3 |
Correct |
140 ms |
328956 KB |
Output is correct |
4 |
Correct |
146 ms |
329068 KB |
Output is correct |
5 |
Correct |
154 ms |
328956 KB |
Output is correct |
6 |
Correct |
141 ms |
329072 KB |
Output is correct |
7 |
Correct |
143 ms |
328976 KB |
Output is correct |
8 |
Correct |
140 ms |
328980 KB |
Output is correct |
9 |
Correct |
142 ms |
329028 KB |
Output is correct |
10 |
Correct |
139 ms |
329060 KB |
Output is correct |
11 |
Correct |
138 ms |
329028 KB |
Output is correct |
12 |
Correct |
137 ms |
329036 KB |
Output is correct |
13 |
Correct |
138 ms |
328968 KB |
Output is correct |
14 |
Correct |
142 ms |
329028 KB |
Output is correct |
15 |
Correct |
139 ms |
329000 KB |
Output is correct |
16 |
Correct |
144 ms |
329004 KB |
Output is correct |
17 |
Correct |
139 ms |
329084 KB |
Output is correct |
18 |
Correct |
139 ms |
328996 KB |
Output is correct |
19 |
Correct |
143 ms |
329192 KB |
Output is correct |
20 |
Correct |
139 ms |
328976 KB |
Output is correct |
21 |
Correct |
139 ms |
329068 KB |
Output is correct |
22 |
Correct |
140 ms |
328952 KB |
Output is correct |
23 |
Correct |
154 ms |
329072 KB |
Output is correct |
24 |
Correct |
139 ms |
329072 KB |
Output is correct |
25 |
Correct |
144 ms |
329000 KB |
Output is correct |
26 |
Correct |
142 ms |
329072 KB |
Output is correct |
27 |
Correct |
139 ms |
328996 KB |
Output is correct |
28 |
Correct |
165 ms |
329044 KB |
Output is correct |
29 |
Correct |
140 ms |
329060 KB |
Output is correct |
30 |
Correct |
141 ms |
329000 KB |
Output is correct |
31 |
Correct |
142 ms |
329008 KB |
Output is correct |
32 |
Correct |
140 ms |
329060 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
140 ms |
329044 KB |
Output is correct |
2 |
Correct |
141 ms |
328980 KB |
Output is correct |
3 |
Correct |
140 ms |
329036 KB |
Output is correct |
4 |
Correct |
140 ms |
329036 KB |
Output is correct |
5 |
Correct |
143 ms |
329104 KB |
Output is correct |
6 |
Correct |
141 ms |
329008 KB |
Output is correct |
7 |
Correct |
148 ms |
329076 KB |
Output is correct |
8 |
Correct |
142 ms |
329016 KB |
Output is correct |
9 |
Correct |
146 ms |
329012 KB |
Output is correct |
10 |
Correct |
141 ms |
329072 KB |
Output is correct |
11 |
Correct |
140 ms |
329076 KB |
Output is correct |
12 |
Correct |
138 ms |
329084 KB |
Output is correct |
13 |
Correct |
141 ms |
328976 KB |
Output is correct |
14 |
Correct |
140 ms |
329076 KB |
Output is correct |
15 |
Correct |
141 ms |
328956 KB |
Output is correct |
16 |
Correct |
143 ms |
329036 KB |
Output is correct |
17 |
Correct |
160 ms |
328960 KB |
Output is correct |
18 |
Correct |
141 ms |
329024 KB |
Output is correct |
19 |
Correct |
140 ms |
328984 KB |
Output is correct |
20 |
Correct |
140 ms |
329036 KB |
Output is correct |
21 |
Correct |
147 ms |
328972 KB |
Output is correct |
22 |
Correct |
141 ms |
329032 KB |
Output is correct |
23 |
Correct |
140 ms |
329080 KB |
Output is correct |
24 |
Correct |
140 ms |
329084 KB |
Output is correct |
25 |
Correct |
149 ms |
329272 KB |
Output is correct |
26 |
Correct |
146 ms |
329652 KB |
Output is correct |
27 |
Correct |
141 ms |
329676 KB |
Output is correct |
28 |
Correct |
149 ms |
329480 KB |
Output is correct |
29 |
Correct |
148 ms |
329376 KB |
Output is correct |
30 |
Correct |
143 ms |
329420 KB |
Output is correct |
31 |
Correct |
152 ms |
329440 KB |
Output is correct |
32 |
Correct |
145 ms |
329352 KB |
Output is correct |
33 |
Correct |
149 ms |
329548 KB |
Output is correct |
34 |
Correct |
192 ms |
330852 KB |
Output is correct |
35 |
Correct |
156 ms |
330068 KB |
Output is correct |
36 |
Correct |
429 ms |
330648 KB |
Output is correct |
37 |
Correct |
139 ms |
329916 KB |
Output is correct |
38 |
Correct |
143 ms |
329992 KB |
Output is correct |
39 |
Correct |
237 ms |
335708 KB |
Output is correct |
40 |
Correct |
473 ms |
347544 KB |
Output is correct |
41 |
Correct |
199 ms |
344196 KB |
Output is correct |
42 |
Execution timed out |
2099 ms |
342828 KB |
Time limit exceeded |
43 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
144 ms |
329036 KB |
Output is correct |
2 |
Correct |
160 ms |
329036 KB |
Output is correct |
3 |
Correct |
140 ms |
328956 KB |
Output is correct |
4 |
Correct |
146 ms |
329068 KB |
Output is correct |
5 |
Correct |
154 ms |
328956 KB |
Output is correct |
6 |
Correct |
141 ms |
329072 KB |
Output is correct |
7 |
Correct |
143 ms |
328976 KB |
Output is correct |
8 |
Correct |
140 ms |
328980 KB |
Output is correct |
9 |
Correct |
142 ms |
329028 KB |
Output is correct |
10 |
Correct |
139 ms |
329060 KB |
Output is correct |
11 |
Correct |
138 ms |
329028 KB |
Output is correct |
12 |
Correct |
137 ms |
329036 KB |
Output is correct |
13 |
Correct |
138 ms |
328968 KB |
Output is correct |
14 |
Correct |
142 ms |
329028 KB |
Output is correct |
15 |
Correct |
139 ms |
329000 KB |
Output is correct |
16 |
Correct |
144 ms |
329004 KB |
Output is correct |
17 |
Correct |
139 ms |
329084 KB |
Output is correct |
18 |
Correct |
139 ms |
328996 KB |
Output is correct |
19 |
Correct |
143 ms |
329192 KB |
Output is correct |
20 |
Correct |
139 ms |
328976 KB |
Output is correct |
21 |
Correct |
139 ms |
329068 KB |
Output is correct |
22 |
Correct |
140 ms |
328952 KB |
Output is correct |
23 |
Correct |
154 ms |
329072 KB |
Output is correct |
24 |
Correct |
139 ms |
329072 KB |
Output is correct |
25 |
Correct |
144 ms |
329000 KB |
Output is correct |
26 |
Correct |
142 ms |
329072 KB |
Output is correct |
27 |
Correct |
139 ms |
328996 KB |
Output is correct |
28 |
Correct |
165 ms |
329044 KB |
Output is correct |
29 |
Correct |
140 ms |
329060 KB |
Output is correct |
30 |
Correct |
141 ms |
329000 KB |
Output is correct |
31 |
Correct |
142 ms |
329008 KB |
Output is correct |
32 |
Correct |
140 ms |
329060 KB |
Output is correct |
33 |
Correct |
142 ms |
329460 KB |
Output is correct |
34 |
Correct |
141 ms |
329084 KB |
Output is correct |
35 |
Correct |
142 ms |
329096 KB |
Output is correct |
36 |
Correct |
142 ms |
329220 KB |
Output is correct |
37 |
Correct |
144 ms |
329384 KB |
Output is correct |
38 |
Correct |
144 ms |
329736 KB |
Output is correct |
39 |
Correct |
140 ms |
329588 KB |
Output is correct |
40 |
Correct |
149 ms |
329460 KB |
Output is correct |
41 |
Correct |
142 ms |
329364 KB |
Output is correct |
42 |
Correct |
146 ms |
329416 KB |
Output is correct |
43 |
Correct |
143 ms |
329404 KB |
Output is correct |
44 |
Correct |
145 ms |
329528 KB |
Output is correct |
45 |
Correct |
144 ms |
329436 KB |
Output is correct |
46 |
Correct |
145 ms |
329544 KB |
Output is correct |
47 |
Correct |
144 ms |
329440 KB |
Output is correct |
48 |
Correct |
149 ms |
329452 KB |
Output is correct |
49 |
Correct |
151 ms |
329380 KB |
Output is correct |
50 |
Correct |
162 ms |
329336 KB |
Output is correct |
51 |
Correct |
175 ms |
329484 KB |
Output is correct |
52 |
Correct |
140 ms |
329324 KB |
Output is correct |
53 |
Correct |
142 ms |
329420 KB |
Output is correct |
54 |
Correct |
141 ms |
329424 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
144 ms |
329036 KB |
Output is correct |
2 |
Correct |
160 ms |
329036 KB |
Output is correct |
3 |
Correct |
140 ms |
328956 KB |
Output is correct |
4 |
Correct |
146 ms |
329068 KB |
Output is correct |
5 |
Correct |
154 ms |
328956 KB |
Output is correct |
6 |
Correct |
141 ms |
329072 KB |
Output is correct |
7 |
Correct |
143 ms |
328976 KB |
Output is correct |
8 |
Correct |
140 ms |
328980 KB |
Output is correct |
9 |
Correct |
142 ms |
329028 KB |
Output is correct |
10 |
Correct |
139 ms |
329060 KB |
Output is correct |
11 |
Correct |
138 ms |
329028 KB |
Output is correct |
12 |
Correct |
137 ms |
329036 KB |
Output is correct |
13 |
Correct |
138 ms |
328968 KB |
Output is correct |
14 |
Correct |
142 ms |
329028 KB |
Output is correct |
15 |
Correct |
139 ms |
329000 KB |
Output is correct |
16 |
Correct |
144 ms |
329004 KB |
Output is correct |
17 |
Correct |
139 ms |
329084 KB |
Output is correct |
18 |
Correct |
139 ms |
328996 KB |
Output is correct |
19 |
Correct |
143 ms |
329192 KB |
Output is correct |
20 |
Correct |
139 ms |
328976 KB |
Output is correct |
21 |
Correct |
139 ms |
329068 KB |
Output is correct |
22 |
Correct |
140 ms |
328952 KB |
Output is correct |
23 |
Correct |
154 ms |
329072 KB |
Output is correct |
24 |
Correct |
139 ms |
329072 KB |
Output is correct |
25 |
Correct |
144 ms |
329000 KB |
Output is correct |
26 |
Correct |
142 ms |
329072 KB |
Output is correct |
27 |
Correct |
139 ms |
328996 KB |
Output is correct |
28 |
Correct |
165 ms |
329044 KB |
Output is correct |
29 |
Correct |
140 ms |
329060 KB |
Output is correct |
30 |
Correct |
141 ms |
329000 KB |
Output is correct |
31 |
Correct |
142 ms |
329008 KB |
Output is correct |
32 |
Correct |
140 ms |
329060 KB |
Output is correct |
33 |
Correct |
142 ms |
329460 KB |
Output is correct |
34 |
Correct |
141 ms |
329084 KB |
Output is correct |
35 |
Correct |
142 ms |
329096 KB |
Output is correct |
36 |
Correct |
142 ms |
329220 KB |
Output is correct |
37 |
Correct |
144 ms |
329384 KB |
Output is correct |
38 |
Correct |
144 ms |
329736 KB |
Output is correct |
39 |
Correct |
140 ms |
329588 KB |
Output is correct |
40 |
Correct |
149 ms |
329460 KB |
Output is correct |
41 |
Correct |
142 ms |
329364 KB |
Output is correct |
42 |
Correct |
146 ms |
329416 KB |
Output is correct |
43 |
Correct |
143 ms |
329404 KB |
Output is correct |
44 |
Correct |
145 ms |
329528 KB |
Output is correct |
45 |
Correct |
144 ms |
329436 KB |
Output is correct |
46 |
Correct |
145 ms |
329544 KB |
Output is correct |
47 |
Correct |
144 ms |
329440 KB |
Output is correct |
48 |
Correct |
149 ms |
329452 KB |
Output is correct |
49 |
Correct |
151 ms |
329380 KB |
Output is correct |
50 |
Correct |
162 ms |
329336 KB |
Output is correct |
51 |
Correct |
175 ms |
329484 KB |
Output is correct |
52 |
Correct |
140 ms |
329324 KB |
Output is correct |
53 |
Correct |
142 ms |
329420 KB |
Output is correct |
54 |
Correct |
141 ms |
329424 KB |
Output is correct |
55 |
Correct |
145 ms |
330000 KB |
Output is correct |
56 |
Correct |
143 ms |
329428 KB |
Output is correct |
57 |
Correct |
190 ms |
330920 KB |
Output is correct |
58 |
Correct |
147 ms |
329788 KB |
Output is correct |
59 |
Correct |
162 ms |
330280 KB |
Output is correct |
60 |
Correct |
146 ms |
329896 KB |
Output is correct |
61 |
Correct |
146 ms |
329940 KB |
Output is correct |
62 |
Correct |
435 ms |
330640 KB |
Output is correct |
63 |
Correct |
141 ms |
329920 KB |
Output is correct |
64 |
Correct |
139 ms |
329880 KB |
Output is correct |
65 |
Correct |
147 ms |
329992 KB |
Output is correct |
66 |
Correct |
164 ms |
330088 KB |
Output is correct |
67 |
Correct |
146 ms |
330080 KB |
Output is correct |
68 |
Correct |
165 ms |
329976 KB |
Output is correct |
69 |
Correct |
206 ms |
330168 KB |
Output is correct |
70 |
Correct |
203 ms |
330080 KB |
Output is correct |
71 |
Correct |
225 ms |
330212 KB |
Output is correct |
72 |
Correct |
169 ms |
329980 KB |
Output is correct |
73 |
Correct |
145 ms |
329936 KB |
Output is correct |
74 |
Correct |
140 ms |
329920 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
158 ms |
329024 KB |
Output is correct |
2 |
Correct |
153 ms |
329076 KB |
Output is correct |
3 |
Correct |
173 ms |
329020 KB |
Output is correct |
4 |
Correct |
142 ms |
329136 KB |
Output is correct |
5 |
Correct |
138 ms |
329076 KB |
Output is correct |
6 |
Correct |
138 ms |
329080 KB |
Output is correct |
7 |
Correct |
141 ms |
329016 KB |
Output is correct |
8 |
Correct |
141 ms |
329076 KB |
Output is correct |
9 |
Correct |
138 ms |
329004 KB |
Output is correct |
10 |
Correct |
138 ms |
329036 KB |
Output is correct |
11 |
Correct |
138 ms |
328976 KB |
Output is correct |
12 |
Correct |
145 ms |
329132 KB |
Output is correct |
13 |
Correct |
137 ms |
329068 KB |
Output is correct |
14 |
Correct |
139 ms |
329076 KB |
Output is correct |
15 |
Correct |
139 ms |
328976 KB |
Output is correct |
16 |
Correct |
137 ms |
329036 KB |
Output is correct |
17 |
Correct |
138 ms |
328964 KB |
Output is correct |
18 |
Correct |
138 ms |
329000 KB |
Output is correct |
19 |
Correct |
140 ms |
329340 KB |
Output is correct |
20 |
Correct |
142 ms |
329304 KB |
Output is correct |
21 |
Correct |
146 ms |
329688 KB |
Output is correct |
22 |
Correct |
145 ms |
329576 KB |
Output is correct |
23 |
Correct |
143 ms |
329384 KB |
Output is correct |
24 |
Correct |
148 ms |
329508 KB |
Output is correct |
25 |
Correct |
141 ms |
329428 KB |
Output is correct |
26 |
Correct |
139 ms |
329436 KB |
Output is correct |
27 |
Correct |
139 ms |
329372 KB |
Output is correct |
28 |
Correct |
145 ms |
329452 KB |
Output is correct |
29 |
Correct |
143 ms |
329880 KB |
Output is correct |
30 |
Correct |
140 ms |
329448 KB |
Output is correct |
31 |
Correct |
140 ms |
330128 KB |
Output is correct |
32 |
Correct |
150 ms |
330056 KB |
Output is correct |
33 |
Correct |
144 ms |
329980 KB |
Output is correct |
34 |
Correct |
143 ms |
329996 KB |
Output is correct |
35 |
Correct |
158 ms |
329964 KB |
Output is correct |
36 |
Correct |
147 ms |
329992 KB |
Output is correct |
37 |
Correct |
148 ms |
329924 KB |
Output is correct |
38 |
Correct |
152 ms |
329988 KB |
Output is correct |
39 |
Correct |
194 ms |
337868 KB |
Output is correct |
40 |
Correct |
145 ms |
330376 KB |
Output is correct |
41 |
Correct |
144 ms |
330236 KB |
Output is correct |
42 |
Correct |
149 ms |
330256 KB |
Output is correct |
43 |
Correct |
144 ms |
330432 KB |
Output is correct |
44 |
Correct |
157 ms |
333724 KB |
Output is correct |
45 |
Correct |
153 ms |
334036 KB |
Output is correct |
46 |
Correct |
171 ms |
344164 KB |
Output is correct |
47 |
Correct |
204 ms |
337952 KB |
Output is correct |
48 |
Correct |
174 ms |
337964 KB |
Output is correct |
49 |
Correct |
158 ms |
337972 KB |
Output is correct |
50 |
Correct |
163 ms |
337980 KB |
Output is correct |
51 |
Correct |
185 ms |
338112 KB |
Output is correct |
52 |
Correct |
171 ms |
338036 KB |
Output is correct |
53 |
Correct |
184 ms |
338000 KB |
Output is correct |
54 |
Correct |
144 ms |
329036 KB |
Output is correct |
55 |
Correct |
160 ms |
329036 KB |
Output is correct |
56 |
Correct |
140 ms |
328956 KB |
Output is correct |
57 |
Correct |
146 ms |
329068 KB |
Output is correct |
58 |
Correct |
154 ms |
328956 KB |
Output is correct |
59 |
Correct |
141 ms |
329072 KB |
Output is correct |
60 |
Correct |
143 ms |
328976 KB |
Output is correct |
61 |
Correct |
140 ms |
328980 KB |
Output is correct |
62 |
Correct |
142 ms |
329028 KB |
Output is correct |
63 |
Correct |
139 ms |
329060 KB |
Output is correct |
64 |
Correct |
138 ms |
329028 KB |
Output is correct |
65 |
Correct |
137 ms |
329036 KB |
Output is correct |
66 |
Correct |
138 ms |
328968 KB |
Output is correct |
67 |
Correct |
142 ms |
329028 KB |
Output is correct |
68 |
Correct |
139 ms |
329000 KB |
Output is correct |
69 |
Correct |
144 ms |
329004 KB |
Output is correct |
70 |
Correct |
139 ms |
329084 KB |
Output is correct |
71 |
Correct |
139 ms |
328996 KB |
Output is correct |
72 |
Correct |
143 ms |
329192 KB |
Output is correct |
73 |
Correct |
139 ms |
328976 KB |
Output is correct |
74 |
Correct |
139 ms |
329068 KB |
Output is correct |
75 |
Correct |
140 ms |
328952 KB |
Output is correct |
76 |
Correct |
154 ms |
329072 KB |
Output is correct |
77 |
Correct |
139 ms |
329072 KB |
Output is correct |
78 |
Correct |
144 ms |
329000 KB |
Output is correct |
79 |
Correct |
142 ms |
329072 KB |
Output is correct |
80 |
Correct |
139 ms |
328996 KB |
Output is correct |
81 |
Correct |
165 ms |
329044 KB |
Output is correct |
82 |
Correct |
140 ms |
329060 KB |
Output is correct |
83 |
Correct |
141 ms |
329000 KB |
Output is correct |
84 |
Correct |
142 ms |
329008 KB |
Output is correct |
85 |
Correct |
140 ms |
329060 KB |
Output is correct |
86 |
Correct |
140 ms |
329044 KB |
Output is correct |
87 |
Correct |
141 ms |
328980 KB |
Output is correct |
88 |
Correct |
140 ms |
329036 KB |
Output is correct |
89 |
Correct |
140 ms |
329036 KB |
Output is correct |
90 |
Correct |
143 ms |
329104 KB |
Output is correct |
91 |
Correct |
141 ms |
329008 KB |
Output is correct |
92 |
Correct |
148 ms |
329076 KB |
Output is correct |
93 |
Correct |
142 ms |
329016 KB |
Output is correct |
94 |
Correct |
146 ms |
329012 KB |
Output is correct |
95 |
Correct |
141 ms |
329072 KB |
Output is correct |
96 |
Correct |
140 ms |
329076 KB |
Output is correct |
97 |
Correct |
138 ms |
329084 KB |
Output is correct |
98 |
Correct |
141 ms |
328976 KB |
Output is correct |
99 |
Correct |
140 ms |
329076 KB |
Output is correct |
100 |
Correct |
141 ms |
328956 KB |
Output is correct |
101 |
Correct |
143 ms |
329036 KB |
Output is correct |
102 |
Correct |
160 ms |
328960 KB |
Output is correct |
103 |
Correct |
141 ms |
329024 KB |
Output is correct |
104 |
Correct |
140 ms |
328984 KB |
Output is correct |
105 |
Correct |
140 ms |
329036 KB |
Output is correct |
106 |
Correct |
147 ms |
328972 KB |
Output is correct |
107 |
Correct |
141 ms |
329032 KB |
Output is correct |
108 |
Correct |
140 ms |
329080 KB |
Output is correct |
109 |
Correct |
140 ms |
329084 KB |
Output is correct |
110 |
Correct |
149 ms |
329272 KB |
Output is correct |
111 |
Correct |
146 ms |
329652 KB |
Output is correct |
112 |
Correct |
141 ms |
329676 KB |
Output is correct |
113 |
Correct |
149 ms |
329480 KB |
Output is correct |
114 |
Correct |
148 ms |
329376 KB |
Output is correct |
115 |
Correct |
143 ms |
329420 KB |
Output is correct |
116 |
Correct |
152 ms |
329440 KB |
Output is correct |
117 |
Correct |
145 ms |
329352 KB |
Output is correct |
118 |
Correct |
149 ms |
329548 KB |
Output is correct |
119 |
Correct |
192 ms |
330852 KB |
Output is correct |
120 |
Correct |
156 ms |
330068 KB |
Output is correct |
121 |
Correct |
429 ms |
330648 KB |
Output is correct |
122 |
Correct |
139 ms |
329916 KB |
Output is correct |
123 |
Correct |
143 ms |
329992 KB |
Output is correct |
124 |
Correct |
237 ms |
335708 KB |
Output is correct |
125 |
Correct |
473 ms |
347544 KB |
Output is correct |
126 |
Correct |
199 ms |
344196 KB |
Output is correct |
127 |
Execution timed out |
2099 ms |
342828 KB |
Time limit exceeded |
128 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
158 ms |
329024 KB |
Output is correct |
2 |
Correct |
153 ms |
329076 KB |
Output is correct |
3 |
Correct |
173 ms |
329020 KB |
Output is correct |
4 |
Correct |
142 ms |
329136 KB |
Output is correct |
5 |
Correct |
138 ms |
329076 KB |
Output is correct |
6 |
Correct |
138 ms |
329080 KB |
Output is correct |
7 |
Correct |
141 ms |
329016 KB |
Output is correct |
8 |
Correct |
141 ms |
329076 KB |
Output is correct |
9 |
Correct |
138 ms |
329004 KB |
Output is correct |
10 |
Correct |
138 ms |
329036 KB |
Output is correct |
11 |
Correct |
138 ms |
328976 KB |
Output is correct |
12 |
Correct |
145 ms |
329132 KB |
Output is correct |
13 |
Correct |
137 ms |
329068 KB |
Output is correct |
14 |
Correct |
139 ms |
329076 KB |
Output is correct |
15 |
Correct |
139 ms |
328976 KB |
Output is correct |
16 |
Correct |
137 ms |
329036 KB |
Output is correct |
17 |
Correct |
138 ms |
328964 KB |
Output is correct |
18 |
Correct |
138 ms |
329000 KB |
Output is correct |
19 |
Correct |
140 ms |
329340 KB |
Output is correct |
20 |
Correct |
142 ms |
329304 KB |
Output is correct |
21 |
Correct |
146 ms |
329688 KB |
Output is correct |
22 |
Correct |
145 ms |
329576 KB |
Output is correct |
23 |
Correct |
143 ms |
329384 KB |
Output is correct |
24 |
Correct |
148 ms |
329508 KB |
Output is correct |
25 |
Correct |
141 ms |
329428 KB |
Output is correct |
26 |
Correct |
139 ms |
329436 KB |
Output is correct |
27 |
Correct |
139 ms |
329372 KB |
Output is correct |
28 |
Correct |
145 ms |
329452 KB |
Output is correct |
29 |
Correct |
143 ms |
329880 KB |
Output is correct |
30 |
Correct |
140 ms |
329448 KB |
Output is correct |
31 |
Correct |
140 ms |
330128 KB |
Output is correct |
32 |
Correct |
150 ms |
330056 KB |
Output is correct |
33 |
Correct |
144 ms |
329980 KB |
Output is correct |
34 |
Correct |
143 ms |
329996 KB |
Output is correct |
35 |
Correct |
158 ms |
329964 KB |
Output is correct |
36 |
Correct |
147 ms |
329992 KB |
Output is correct |
37 |
Correct |
148 ms |
329924 KB |
Output is correct |
38 |
Correct |
152 ms |
329988 KB |
Output is correct |
39 |
Correct |
194 ms |
337868 KB |
Output is correct |
40 |
Correct |
145 ms |
330376 KB |
Output is correct |
41 |
Correct |
144 ms |
330236 KB |
Output is correct |
42 |
Correct |
149 ms |
330256 KB |
Output is correct |
43 |
Correct |
144 ms |
330432 KB |
Output is correct |
44 |
Correct |
157 ms |
333724 KB |
Output is correct |
45 |
Correct |
153 ms |
334036 KB |
Output is correct |
46 |
Correct |
171 ms |
344164 KB |
Output is correct |
47 |
Correct |
204 ms |
337952 KB |
Output is correct |
48 |
Correct |
174 ms |
337964 KB |
Output is correct |
49 |
Correct |
158 ms |
337972 KB |
Output is correct |
50 |
Correct |
163 ms |
337980 KB |
Output is correct |
51 |
Correct |
185 ms |
338112 KB |
Output is correct |
52 |
Correct |
171 ms |
338036 KB |
Output is correct |
53 |
Correct |
184 ms |
338000 KB |
Output is correct |
54 |
Correct |
144 ms |
329036 KB |
Output is correct |
55 |
Correct |
160 ms |
329036 KB |
Output is correct |
56 |
Correct |
140 ms |
328956 KB |
Output is correct |
57 |
Correct |
146 ms |
329068 KB |
Output is correct |
58 |
Correct |
154 ms |
328956 KB |
Output is correct |
59 |
Correct |
141 ms |
329072 KB |
Output is correct |
60 |
Correct |
143 ms |
328976 KB |
Output is correct |
61 |
Correct |
140 ms |
328980 KB |
Output is correct |
62 |
Correct |
142 ms |
329028 KB |
Output is correct |
63 |
Correct |
139 ms |
329060 KB |
Output is correct |
64 |
Correct |
138 ms |
329028 KB |
Output is correct |
65 |
Correct |
137 ms |
329036 KB |
Output is correct |
66 |
Correct |
138 ms |
328968 KB |
Output is correct |
67 |
Correct |
142 ms |
329028 KB |
Output is correct |
68 |
Correct |
139 ms |
329000 KB |
Output is correct |
69 |
Correct |
144 ms |
329004 KB |
Output is correct |
70 |
Correct |
139 ms |
329084 KB |
Output is correct |
71 |
Correct |
139 ms |
328996 KB |
Output is correct |
72 |
Correct |
143 ms |
329192 KB |
Output is correct |
73 |
Correct |
139 ms |
328976 KB |
Output is correct |
74 |
Correct |
139 ms |
329068 KB |
Output is correct |
75 |
Correct |
140 ms |
328952 KB |
Output is correct |
76 |
Correct |
154 ms |
329072 KB |
Output is correct |
77 |
Correct |
139 ms |
329072 KB |
Output is correct |
78 |
Correct |
144 ms |
329000 KB |
Output is correct |
79 |
Correct |
142 ms |
329072 KB |
Output is correct |
80 |
Correct |
139 ms |
328996 KB |
Output is correct |
81 |
Correct |
165 ms |
329044 KB |
Output is correct |
82 |
Correct |
140 ms |
329060 KB |
Output is correct |
83 |
Correct |
141 ms |
329000 KB |
Output is correct |
84 |
Correct |
142 ms |
329008 KB |
Output is correct |
85 |
Correct |
140 ms |
329060 KB |
Output is correct |
86 |
Correct |
140 ms |
329044 KB |
Output is correct |
87 |
Correct |
141 ms |
328980 KB |
Output is correct |
88 |
Correct |
140 ms |
329036 KB |
Output is correct |
89 |
Correct |
140 ms |
329036 KB |
Output is correct |
90 |
Correct |
143 ms |
329104 KB |
Output is correct |
91 |
Correct |
141 ms |
329008 KB |
Output is correct |
92 |
Correct |
148 ms |
329076 KB |
Output is correct |
93 |
Correct |
142 ms |
329016 KB |
Output is correct |
94 |
Correct |
146 ms |
329012 KB |
Output is correct |
95 |
Correct |
141 ms |
329072 KB |
Output is correct |
96 |
Correct |
140 ms |
329076 KB |
Output is correct |
97 |
Correct |
138 ms |
329084 KB |
Output is correct |
98 |
Correct |
141 ms |
328976 KB |
Output is correct |
99 |
Correct |
140 ms |
329076 KB |
Output is correct |
100 |
Correct |
141 ms |
328956 KB |
Output is correct |
101 |
Correct |
143 ms |
329036 KB |
Output is correct |
102 |
Correct |
160 ms |
328960 KB |
Output is correct |
103 |
Correct |
141 ms |
329024 KB |
Output is correct |
104 |
Correct |
140 ms |
328984 KB |
Output is correct |
105 |
Correct |
140 ms |
329036 KB |
Output is correct |
106 |
Correct |
147 ms |
328972 KB |
Output is correct |
107 |
Correct |
141 ms |
329032 KB |
Output is correct |
108 |
Correct |
140 ms |
329080 KB |
Output is correct |
109 |
Correct |
140 ms |
329084 KB |
Output is correct |
110 |
Correct |
149 ms |
329272 KB |
Output is correct |
111 |
Correct |
146 ms |
329652 KB |
Output is correct |
112 |
Correct |
141 ms |
329676 KB |
Output is correct |
113 |
Correct |
149 ms |
329480 KB |
Output is correct |
114 |
Correct |
148 ms |
329376 KB |
Output is correct |
115 |
Correct |
143 ms |
329420 KB |
Output is correct |
116 |
Correct |
152 ms |
329440 KB |
Output is correct |
117 |
Correct |
145 ms |
329352 KB |
Output is correct |
118 |
Correct |
149 ms |
329548 KB |
Output is correct |
119 |
Correct |
192 ms |
330852 KB |
Output is correct |
120 |
Correct |
156 ms |
330068 KB |
Output is correct |
121 |
Correct |
429 ms |
330648 KB |
Output is correct |
122 |
Correct |
139 ms |
329916 KB |
Output is correct |
123 |
Correct |
143 ms |
329992 KB |
Output is correct |
124 |
Correct |
237 ms |
335708 KB |
Output is correct |
125 |
Correct |
473 ms |
347544 KB |
Output is correct |
126 |
Correct |
199 ms |
344196 KB |
Output is correct |
127 |
Execution timed out |
2099 ms |
342828 KB |
Time limit exceeded |
128 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
158 ms |
329024 KB |
Output is correct |
2 |
Correct |
153 ms |
329076 KB |
Output is correct |
3 |
Correct |
173 ms |
329020 KB |
Output is correct |
4 |
Correct |
142 ms |
329136 KB |
Output is correct |
5 |
Correct |
138 ms |
329076 KB |
Output is correct |
6 |
Correct |
138 ms |
329080 KB |
Output is correct |
7 |
Correct |
141 ms |
329016 KB |
Output is correct |
8 |
Correct |
141 ms |
329076 KB |
Output is correct |
9 |
Correct |
138 ms |
329004 KB |
Output is correct |
10 |
Correct |
138 ms |
329036 KB |
Output is correct |
11 |
Correct |
138 ms |
328976 KB |
Output is correct |
12 |
Correct |
145 ms |
329132 KB |
Output is correct |
13 |
Correct |
137 ms |
329068 KB |
Output is correct |
14 |
Correct |
139 ms |
329076 KB |
Output is correct |
15 |
Correct |
139 ms |
328976 KB |
Output is correct |
16 |
Correct |
137 ms |
329036 KB |
Output is correct |
17 |
Correct |
138 ms |
328964 KB |
Output is correct |
18 |
Correct |
138 ms |
329000 KB |
Output is correct |
19 |
Correct |
140 ms |
329340 KB |
Output is correct |
20 |
Correct |
142 ms |
329304 KB |
Output is correct |
21 |
Correct |
146 ms |
329688 KB |
Output is correct |
22 |
Correct |
145 ms |
329576 KB |
Output is correct |
23 |
Correct |
143 ms |
329384 KB |
Output is correct |
24 |
Correct |
148 ms |
329508 KB |
Output is correct |
25 |
Correct |
141 ms |
329428 KB |
Output is correct |
26 |
Correct |
139 ms |
329436 KB |
Output is correct |
27 |
Correct |
139 ms |
329372 KB |
Output is correct |
28 |
Correct |
145 ms |
329452 KB |
Output is correct |
29 |
Correct |
143 ms |
329880 KB |
Output is correct |
30 |
Correct |
140 ms |
329448 KB |
Output is correct |
31 |
Correct |
140 ms |
330128 KB |
Output is correct |
32 |
Correct |
150 ms |
330056 KB |
Output is correct |
33 |
Correct |
144 ms |
329980 KB |
Output is correct |
34 |
Correct |
143 ms |
329996 KB |
Output is correct |
35 |
Correct |
158 ms |
329964 KB |
Output is correct |
36 |
Correct |
147 ms |
329992 KB |
Output is correct |
37 |
Correct |
148 ms |
329924 KB |
Output is correct |
38 |
Correct |
152 ms |
329988 KB |
Output is correct |
39 |
Correct |
194 ms |
337868 KB |
Output is correct |
40 |
Correct |
145 ms |
330376 KB |
Output is correct |
41 |
Correct |
144 ms |
330236 KB |
Output is correct |
42 |
Correct |
149 ms |
330256 KB |
Output is correct |
43 |
Correct |
144 ms |
330432 KB |
Output is correct |
44 |
Correct |
157 ms |
333724 KB |
Output is correct |
45 |
Correct |
153 ms |
334036 KB |
Output is correct |
46 |
Correct |
171 ms |
344164 KB |
Output is correct |
47 |
Correct |
204 ms |
337952 KB |
Output is correct |
48 |
Correct |
174 ms |
337964 KB |
Output is correct |
49 |
Correct |
158 ms |
337972 KB |
Output is correct |
50 |
Correct |
163 ms |
337980 KB |
Output is correct |
51 |
Correct |
185 ms |
338112 KB |
Output is correct |
52 |
Correct |
171 ms |
338036 KB |
Output is correct |
53 |
Correct |
184 ms |
338000 KB |
Output is correct |
54 |
Correct |
144 ms |
329036 KB |
Output is correct |
55 |
Correct |
160 ms |
329036 KB |
Output is correct |
56 |
Correct |
140 ms |
328956 KB |
Output is correct |
57 |
Correct |
146 ms |
329068 KB |
Output is correct |
58 |
Correct |
154 ms |
328956 KB |
Output is correct |
59 |
Correct |
141 ms |
329072 KB |
Output is correct |
60 |
Correct |
143 ms |
328976 KB |
Output is correct |
61 |
Correct |
140 ms |
328980 KB |
Output is correct |
62 |
Correct |
142 ms |
329028 KB |
Output is correct |
63 |
Correct |
139 ms |
329060 KB |
Output is correct |
64 |
Correct |
138 ms |
329028 KB |
Output is correct |
65 |
Correct |
137 ms |
329036 KB |
Output is correct |
66 |
Correct |
138 ms |
328968 KB |
Output is correct |
67 |
Correct |
142 ms |
329028 KB |
Output is correct |
68 |
Correct |
139 ms |
329000 KB |
Output is correct |
69 |
Correct |
144 ms |
329004 KB |
Output is correct |
70 |
Correct |
139 ms |
329084 KB |
Output is correct |
71 |
Correct |
139 ms |
328996 KB |
Output is correct |
72 |
Correct |
143 ms |
329192 KB |
Output is correct |
73 |
Correct |
139 ms |
328976 KB |
Output is correct |
74 |
Correct |
139 ms |
329068 KB |
Output is correct |
75 |
Correct |
140 ms |
328952 KB |
Output is correct |
76 |
Correct |
154 ms |
329072 KB |
Output is correct |
77 |
Correct |
139 ms |
329072 KB |
Output is correct |
78 |
Correct |
144 ms |
329000 KB |
Output is correct |
79 |
Correct |
142 ms |
329072 KB |
Output is correct |
80 |
Correct |
139 ms |
328996 KB |
Output is correct |
81 |
Correct |
165 ms |
329044 KB |
Output is correct |
82 |
Correct |
140 ms |
329060 KB |
Output is correct |
83 |
Correct |
141 ms |
329000 KB |
Output is correct |
84 |
Correct |
142 ms |
329008 KB |
Output is correct |
85 |
Correct |
140 ms |
329060 KB |
Output is correct |
86 |
Correct |
140 ms |
329044 KB |
Output is correct |
87 |
Correct |
141 ms |
328980 KB |
Output is correct |
88 |
Correct |
140 ms |
329036 KB |
Output is correct |
89 |
Correct |
140 ms |
329036 KB |
Output is correct |
90 |
Correct |
143 ms |
329104 KB |
Output is correct |
91 |
Correct |
141 ms |
329008 KB |
Output is correct |
92 |
Correct |
148 ms |
329076 KB |
Output is correct |
93 |
Correct |
142 ms |
329016 KB |
Output is correct |
94 |
Correct |
146 ms |
329012 KB |
Output is correct |
95 |
Correct |
141 ms |
329072 KB |
Output is correct |
96 |
Correct |
140 ms |
329076 KB |
Output is correct |
97 |
Correct |
138 ms |
329084 KB |
Output is correct |
98 |
Correct |
141 ms |
328976 KB |
Output is correct |
99 |
Correct |
140 ms |
329076 KB |
Output is correct |
100 |
Correct |
141 ms |
328956 KB |
Output is correct |
101 |
Correct |
143 ms |
329036 KB |
Output is correct |
102 |
Correct |
160 ms |
328960 KB |
Output is correct |
103 |
Correct |
141 ms |
329024 KB |
Output is correct |
104 |
Correct |
140 ms |
328984 KB |
Output is correct |
105 |
Correct |
140 ms |
329036 KB |
Output is correct |
106 |
Correct |
147 ms |
328972 KB |
Output is correct |
107 |
Correct |
141 ms |
329032 KB |
Output is correct |
108 |
Correct |
140 ms |
329080 KB |
Output is correct |
109 |
Correct |
140 ms |
329084 KB |
Output is correct |
110 |
Correct |
149 ms |
329272 KB |
Output is correct |
111 |
Correct |
146 ms |
329652 KB |
Output is correct |
112 |
Correct |
141 ms |
329676 KB |
Output is correct |
113 |
Correct |
149 ms |
329480 KB |
Output is correct |
114 |
Correct |
148 ms |
329376 KB |
Output is correct |
115 |
Correct |
143 ms |
329420 KB |
Output is correct |
116 |
Correct |
152 ms |
329440 KB |
Output is correct |
117 |
Correct |
145 ms |
329352 KB |
Output is correct |
118 |
Correct |
149 ms |
329548 KB |
Output is correct |
119 |
Correct |
192 ms |
330852 KB |
Output is correct |
120 |
Correct |
156 ms |
330068 KB |
Output is correct |
121 |
Correct |
429 ms |
330648 KB |
Output is correct |
122 |
Correct |
139 ms |
329916 KB |
Output is correct |
123 |
Correct |
143 ms |
329992 KB |
Output is correct |
124 |
Correct |
237 ms |
335708 KB |
Output is correct |
125 |
Correct |
473 ms |
347544 KB |
Output is correct |
126 |
Correct |
199 ms |
344196 KB |
Output is correct |
127 |
Execution timed out |
2099 ms |
342828 KB |
Time limit exceeded |
128 |
Halted |
0 ms |
0 KB |
- |