Submission #928313

# Submission time Handle Problem Language Result Execution time Memory
928313 2024-02-16T08:01:35 Z GrandTiger1729 Maze (JOI23_ho_t3) C++17
51 / 100
2000 ms 109564 KB
#include <bits/stdc++.h>
using namespace std;

const int INF = 1e9 + 10;
int main()
{
    cin.tie(0)->sync_with_stdio(0);
    int n, m, K;
    cin >> n >> m >> K;
    pair<int, int> A, B;
    cin >> A.first >> A.second >> B.first >> B.second;
    A.first--, A.second--, B.first--, B.second--;
    vector<string> g(n);
    for (int i = 0; i < n; i++)
    {
        cin >> g[i];
    }
    vector<vector<int>> lft(n, vector<int>(m, -1)), rgt(n, vector<int>(m, -1));
    vector<set<int>> vis(n);
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            vis[i].insert(j);
        }
    }
    auto able = [&](int i, int j)
    {
        return 0 <= i && i < n && 0 <= j && j < m && vis[i].find(j) != vis[i].end() && g[i][j] == '.';
    };
    vector<vector<int>> dis(n, vector<int>(m, INF));
    deque<pair<int, int>> dq;
    dq.push_back(A);
    vis[A.first].erase(A.second);
    dis[A.first][A.second] = 0;
    while (dq.size())
    {
        vector<pair<int, int>> res;
        while (dq.size())
        {
            auto [i, j] = dq.front();
            res.emplace_back(i, j);
            dq.pop_front();
            for (auto &[dx, dy] : vector<pair<int, int>>{{1, 0}, {0, 1}, {-1, 0}, {0, -1}})
            {
                if (able(i + dx, j + dy))
                {
                    dq.emplace_front(i + dx, j + dy);
                    dis[i + dx][j + dy] = dis[i][j];
                    vis[i + dx].erase(j + dy);
                }
            }
        }
        while (res.size())
        {
            auto [i, j] = res.back();
            res.pop_back();
            for (int ii = max(0, i - K); ii <= min(n - 1, i + K); ii++)
            {
                auto it = vis[ii].lower_bound(j - (K - 1));
                while (it != vis[ii].end() && *it <= j + (K - 1))
                {
                    dq.emplace_back(ii, *it);
                    dis[ii][*it] = dis[i][j] + 1;
                    it = vis[ii].erase(it);
                }
            }
            for (int ii = max(0, i - (K - 1)); ii <= min(n - 1, i + (K - 1)); ii++)
            {
                auto it = vis[ii].lower_bound(j - K);
                while (it != vis[ii].end() && *it <= j + K)
                {
                    dq.emplace_back(ii, *it);
                    dis[ii][*it] = dis[i][j] + 1;
                    it = vis[ii].erase(it);
                }
            }
        }
    }
    int ans = dis[B.first][B.second];
    cout << ans << '\n';
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 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 1 ms 500 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 1 ms 600 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 600 KB Output is correct
17 Correct 1 ms 452 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 22 ms 3932 KB Output is correct
20 Correct 14 ms 3356 KB Output is correct
21 Correct 13 ms 4568 KB Output is correct
22 Correct 25 ms 4156 KB Output is correct
23 Correct 17 ms 3888 KB Output is correct
24 Correct 19 ms 4204 KB Output is correct
25 Correct 22 ms 4348 KB Output is correct
26 Correct 23 ms 4188 KB Output is correct
27 Correct 23 ms 3932 KB Output is correct
28 Correct 19 ms 3928 KB Output is correct
29 Correct 50 ms 9612 KB Output is correct
30 Correct 22 ms 4596 KB Output is correct
31 Correct 34 ms 11756 KB Output is correct
32 Correct 62 ms 9484 KB Output is correct
33 Correct 51 ms 9564 KB Output is correct
34 Correct 58 ms 10140 KB Output is correct
35 Correct 57 ms 10136 KB Output is correct
36 Correct 58 ms 9820 KB Output is correct
37 Correct 59 ms 9632 KB Output is correct
38 Correct 52 ms 9564 KB Output is correct
39 Correct 766 ms 91748 KB Output is correct
40 Correct 76 ms 10844 KB Output is correct
41 Correct 71 ms 12296 KB Output is correct
42 Correct 82 ms 13400 KB Output is correct
43 Correct 107 ms 15484 KB Output is correct
44 Correct 471 ms 46192 KB Output is correct
45 Correct 395 ms 49740 KB Output is correct
46 Correct 405 ms 109564 KB Output is correct
47 Correct 678 ms 91968 KB Output is correct
48 Correct 938 ms 91984 KB Output is correct
49 Correct 777 ms 97248 KB Output is correct
50 Correct 789 ms 97292 KB Output is correct
51 Correct 723 ms 92724 KB Output is correct
52 Correct 691 ms 92008 KB Output is correct
53 Correct 748 ms 91788 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 1 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 1 ms 348 KB Output is correct
8 Correct 0 ms 456 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 600 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 456 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 344 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 452 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 1 ms 348 KB Output is correct
27 Correct 1 ms 344 KB Output is correct
28 Correct 1 ms 344 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 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 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 456 KB Output is correct
6 Correct 0 ms 600 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 448 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 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 0 ms 348 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 344 KB Output is correct
23 Correct 1 ms 604 KB Output is correct
24 Correct 1 ms 604 KB Output is correct
25 Correct 13 ms 2800 KB Output is correct
26 Correct 23 ms 4312 KB Output is correct
27 Correct 14 ms 4564 KB Output is correct
28 Correct 58 ms 4588 KB Output is correct
29 Correct 50 ms 3932 KB Output is correct
30 Correct 46 ms 3932 KB Output is correct
31 Correct 111 ms 4188 KB Output is correct
32 Correct 23 ms 4184 KB Output is correct
33 Correct 23 ms 4188 KB Output is correct
34 Correct 101 ms 8860 KB Output is correct
35 Correct 35 ms 11748 KB Output is correct
36 Correct 185 ms 11748 KB Output is correct
37 Correct 168 ms 9560 KB Output is correct
38 Correct 172 ms 9560 KB Output is correct
39 Correct 291 ms 31796 KB Output is correct
40 Execution timed out 2043 ms 86344 KB Time limit exceeded
41 Halted 0 ms 0 KB -
# 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 1 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 1 ms 348 KB Output is correct
8 Correct 0 ms 456 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 600 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 456 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 344 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 452 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 1 ms 348 KB Output is correct
27 Correct 1 ms 344 KB Output is correct
28 Correct 1 ms 344 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 22 ms 3928 KB Output is correct
34 Correct 1 ms 604 KB Output is correct
35 Correct 2 ms 604 KB Output is correct
36 Correct 14 ms 2652 KB Output is correct
37 Correct 14 ms 3248 KB Output is correct
38 Correct 23 ms 4156 KB Output is correct
39 Correct 15 ms 4648 KB Output is correct
40 Correct 23 ms 3932 KB Output is correct
41 Correct 17 ms 3928 KB Output is correct
42 Correct 50 ms 4588 KB Output is correct
43 Correct 45 ms 3928 KB Output is correct
44 Correct 45 ms 4132 KB Output is correct
45 Correct 19 ms 4208 KB Output is correct
46 Correct 21 ms 4148 KB Output is correct
47 Correct 20 ms 4188 KB Output is correct
48 Correct 51 ms 3932 KB Output is correct
49 Correct 52 ms 4128 KB Output is correct
50 Correct 71 ms 3932 KB Output is correct
51 Correct 109 ms 4184 KB Output is correct
52 Correct 23 ms 4176 KB Output is correct
53 Correct 22 ms 4188 KB Output is correct
54 Correct 17 ms 3932 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 1 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 1 ms 348 KB Output is correct
8 Correct 0 ms 456 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 600 KB Output is correct
13 Correct 1 ms 344 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 456 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 344 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 452 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 1 ms 348 KB Output is correct
27 Correct 1 ms 344 KB Output is correct
28 Correct 1 ms 344 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 1 ms 348 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 22 ms 3928 KB Output is correct
34 Correct 1 ms 604 KB Output is correct
35 Correct 2 ms 604 KB Output is correct
36 Correct 14 ms 2652 KB Output is correct
37 Correct 14 ms 3248 KB Output is correct
38 Correct 23 ms 4156 KB Output is correct
39 Correct 15 ms 4648 KB Output is correct
40 Correct 23 ms 3932 KB Output is correct
41 Correct 17 ms 3928 KB Output is correct
42 Correct 50 ms 4588 KB Output is correct
43 Correct 45 ms 3928 KB Output is correct
44 Correct 45 ms 4132 KB Output is correct
45 Correct 19 ms 4208 KB Output is correct
46 Correct 21 ms 4148 KB Output is correct
47 Correct 20 ms 4188 KB Output is correct
48 Correct 51 ms 3932 KB Output is correct
49 Correct 52 ms 4128 KB Output is correct
50 Correct 71 ms 3932 KB Output is correct
51 Correct 109 ms 4184 KB Output is correct
52 Correct 23 ms 4176 KB Output is correct
53 Correct 22 ms 4188 KB Output is correct
54 Correct 17 ms 3932 KB Output is correct
55 Correct 49 ms 9564 KB Output is correct
56 Correct 22 ms 4184 KB Output is correct
57 Correct 96 ms 8916 KB Output is correct
58 Correct 74 ms 8796 KB Output is correct
59 Correct 35 ms 11736 KB Output is correct
60 Correct 59 ms 9564 KB Output is correct
61 Correct 54 ms 9464 KB Output is correct
62 Correct 181 ms 11732 KB Output is correct
63 Correct 174 ms 9640 KB Output is correct
64 Correct 166 ms 9636 KB Output is correct
65 Correct 58 ms 10124 KB Output is correct
66 Correct 57 ms 10084 KB Output is correct
67 Correct 62 ms 9764 KB Output is correct
68 Correct 144 ms 9816 KB Output is correct
69 Correct 217 ms 9632 KB Output is correct
70 Correct 389 ms 9696 KB Output is correct
71 Correct 472 ms 9808 KB Output is correct
72 Correct 61 ms 9816 KB Output is correct
73 Correct 58 ms 9564 KB Output is correct
74 Correct 52 ms 9560 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 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 1 ms 500 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 1 ms 600 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 600 KB Output is correct
17 Correct 1 ms 452 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 22 ms 3932 KB Output is correct
20 Correct 14 ms 3356 KB Output is correct
21 Correct 13 ms 4568 KB Output is correct
22 Correct 25 ms 4156 KB Output is correct
23 Correct 17 ms 3888 KB Output is correct
24 Correct 19 ms 4204 KB Output is correct
25 Correct 22 ms 4348 KB Output is correct
26 Correct 23 ms 4188 KB Output is correct
27 Correct 23 ms 3932 KB Output is correct
28 Correct 19 ms 3928 KB Output is correct
29 Correct 50 ms 9612 KB Output is correct
30 Correct 22 ms 4596 KB Output is correct
31 Correct 34 ms 11756 KB Output is correct
32 Correct 62 ms 9484 KB Output is correct
33 Correct 51 ms 9564 KB Output is correct
34 Correct 58 ms 10140 KB Output is correct
35 Correct 57 ms 10136 KB Output is correct
36 Correct 58 ms 9820 KB Output is correct
37 Correct 59 ms 9632 KB Output is correct
38 Correct 52 ms 9564 KB Output is correct
39 Correct 766 ms 91748 KB Output is correct
40 Correct 76 ms 10844 KB Output is correct
41 Correct 71 ms 12296 KB Output is correct
42 Correct 82 ms 13400 KB Output is correct
43 Correct 107 ms 15484 KB Output is correct
44 Correct 471 ms 46192 KB Output is correct
45 Correct 395 ms 49740 KB Output is correct
46 Correct 405 ms 109564 KB Output is correct
47 Correct 678 ms 91968 KB Output is correct
48 Correct 938 ms 91984 KB Output is correct
49 Correct 777 ms 97248 KB Output is correct
50 Correct 789 ms 97292 KB Output is correct
51 Correct 723 ms 92724 KB Output is correct
52 Correct 691 ms 92008 KB Output is correct
53 Correct 748 ms 91788 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 1 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 1 ms 348 KB Output is correct
61 Correct 0 ms 456 KB Output is correct
62 Correct 1 ms 348 KB Output is correct
63 Correct 1 ms 348 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 1 ms 600 KB Output is correct
66 Correct 1 ms 344 KB Output is correct
67 Correct 1 ms 348 KB Output is correct
68 Correct 1 ms 348 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 1 ms 456 KB Output is correct
71 Correct 0 ms 348 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 1 ms 344 KB Output is correct
74 Correct 0 ms 348 KB Output is correct
75 Correct 0 ms 452 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 1 ms 348 KB Output is correct
80 Correct 1 ms 344 KB Output is correct
81 Correct 1 ms 344 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 1 ms 348 KB Output is correct
84 Correct 1 ms 348 KB Output is correct
85 Correct 1 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 1 ms 348 KB Output is correct
89 Correct 0 ms 348 KB Output is correct
90 Correct 0 ms 456 KB Output is correct
91 Correct 0 ms 600 KB Output is correct
92 Correct 1 ms 348 KB Output is correct
93 Correct 1 ms 448 KB Output is correct
94 Correct 1 ms 348 KB Output is correct
95 Correct 1 ms 348 KB Output is correct
96 Correct 1 ms 348 KB Output is correct
97 Correct 1 ms 348 KB Output is correct
98 Correct 0 ms 348 KB Output is correct
99 Correct 1 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 1 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 0 ms 348 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 344 KB Output is correct
108 Correct 1 ms 604 KB Output is correct
109 Correct 1 ms 604 KB Output is correct
110 Correct 13 ms 2800 KB Output is correct
111 Correct 23 ms 4312 KB Output is correct
112 Correct 14 ms 4564 KB Output is correct
113 Correct 58 ms 4588 KB Output is correct
114 Correct 50 ms 3932 KB Output is correct
115 Correct 46 ms 3932 KB Output is correct
116 Correct 111 ms 4188 KB Output is correct
117 Correct 23 ms 4184 KB Output is correct
118 Correct 23 ms 4188 KB Output is correct
119 Correct 101 ms 8860 KB Output is correct
120 Correct 35 ms 11748 KB Output is correct
121 Correct 185 ms 11748 KB Output is correct
122 Correct 168 ms 9560 KB Output is correct
123 Correct 172 ms 9560 KB Output is correct
124 Correct 291 ms 31796 KB Output is correct
125 Execution timed out 2043 ms 86344 KB Time limit exceeded
126 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 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 1 ms 500 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 1 ms 600 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 600 KB Output is correct
17 Correct 1 ms 452 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 22 ms 3932 KB Output is correct
20 Correct 14 ms 3356 KB Output is correct
21 Correct 13 ms 4568 KB Output is correct
22 Correct 25 ms 4156 KB Output is correct
23 Correct 17 ms 3888 KB Output is correct
24 Correct 19 ms 4204 KB Output is correct
25 Correct 22 ms 4348 KB Output is correct
26 Correct 23 ms 4188 KB Output is correct
27 Correct 23 ms 3932 KB Output is correct
28 Correct 19 ms 3928 KB Output is correct
29 Correct 50 ms 9612 KB Output is correct
30 Correct 22 ms 4596 KB Output is correct
31 Correct 34 ms 11756 KB Output is correct
32 Correct 62 ms 9484 KB Output is correct
33 Correct 51 ms 9564 KB Output is correct
34 Correct 58 ms 10140 KB Output is correct
35 Correct 57 ms 10136 KB Output is correct
36 Correct 58 ms 9820 KB Output is correct
37 Correct 59 ms 9632 KB Output is correct
38 Correct 52 ms 9564 KB Output is correct
39 Correct 766 ms 91748 KB Output is correct
40 Correct 76 ms 10844 KB Output is correct
41 Correct 71 ms 12296 KB Output is correct
42 Correct 82 ms 13400 KB Output is correct
43 Correct 107 ms 15484 KB Output is correct
44 Correct 471 ms 46192 KB Output is correct
45 Correct 395 ms 49740 KB Output is correct
46 Correct 405 ms 109564 KB Output is correct
47 Correct 678 ms 91968 KB Output is correct
48 Correct 938 ms 91984 KB Output is correct
49 Correct 777 ms 97248 KB Output is correct
50 Correct 789 ms 97292 KB Output is correct
51 Correct 723 ms 92724 KB Output is correct
52 Correct 691 ms 92008 KB Output is correct
53 Correct 748 ms 91788 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 1 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 1 ms 348 KB Output is correct
61 Correct 0 ms 456 KB Output is correct
62 Correct 1 ms 348 KB Output is correct
63 Correct 1 ms 348 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 1 ms 600 KB Output is correct
66 Correct 1 ms 344 KB Output is correct
67 Correct 1 ms 348 KB Output is correct
68 Correct 1 ms 348 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 1 ms 456 KB Output is correct
71 Correct 0 ms 348 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 1 ms 344 KB Output is correct
74 Correct 0 ms 348 KB Output is correct
75 Correct 0 ms 452 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 1 ms 348 KB Output is correct
80 Correct 1 ms 344 KB Output is correct
81 Correct 1 ms 344 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 1 ms 348 KB Output is correct
84 Correct 1 ms 348 KB Output is correct
85 Correct 1 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 1 ms 348 KB Output is correct
89 Correct 0 ms 348 KB Output is correct
90 Correct 0 ms 456 KB Output is correct
91 Correct 0 ms 600 KB Output is correct
92 Correct 1 ms 348 KB Output is correct
93 Correct 1 ms 448 KB Output is correct
94 Correct 1 ms 348 KB Output is correct
95 Correct 1 ms 348 KB Output is correct
96 Correct 1 ms 348 KB Output is correct
97 Correct 1 ms 348 KB Output is correct
98 Correct 0 ms 348 KB Output is correct
99 Correct 1 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 1 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 0 ms 348 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 344 KB Output is correct
108 Correct 1 ms 604 KB Output is correct
109 Correct 1 ms 604 KB Output is correct
110 Correct 13 ms 2800 KB Output is correct
111 Correct 23 ms 4312 KB Output is correct
112 Correct 14 ms 4564 KB Output is correct
113 Correct 58 ms 4588 KB Output is correct
114 Correct 50 ms 3932 KB Output is correct
115 Correct 46 ms 3932 KB Output is correct
116 Correct 111 ms 4188 KB Output is correct
117 Correct 23 ms 4184 KB Output is correct
118 Correct 23 ms 4188 KB Output is correct
119 Correct 101 ms 8860 KB Output is correct
120 Correct 35 ms 11748 KB Output is correct
121 Correct 185 ms 11748 KB Output is correct
122 Correct 168 ms 9560 KB Output is correct
123 Correct 172 ms 9560 KB Output is correct
124 Correct 291 ms 31796 KB Output is correct
125 Execution timed out 2043 ms 86344 KB Time limit exceeded
126 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 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 1 ms 500 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 1 ms 600 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 600 KB Output is correct
17 Correct 1 ms 452 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 22 ms 3932 KB Output is correct
20 Correct 14 ms 3356 KB Output is correct
21 Correct 13 ms 4568 KB Output is correct
22 Correct 25 ms 4156 KB Output is correct
23 Correct 17 ms 3888 KB Output is correct
24 Correct 19 ms 4204 KB Output is correct
25 Correct 22 ms 4348 KB Output is correct
26 Correct 23 ms 4188 KB Output is correct
27 Correct 23 ms 3932 KB Output is correct
28 Correct 19 ms 3928 KB Output is correct
29 Correct 50 ms 9612 KB Output is correct
30 Correct 22 ms 4596 KB Output is correct
31 Correct 34 ms 11756 KB Output is correct
32 Correct 62 ms 9484 KB Output is correct
33 Correct 51 ms 9564 KB Output is correct
34 Correct 58 ms 10140 KB Output is correct
35 Correct 57 ms 10136 KB Output is correct
36 Correct 58 ms 9820 KB Output is correct
37 Correct 59 ms 9632 KB Output is correct
38 Correct 52 ms 9564 KB Output is correct
39 Correct 766 ms 91748 KB Output is correct
40 Correct 76 ms 10844 KB Output is correct
41 Correct 71 ms 12296 KB Output is correct
42 Correct 82 ms 13400 KB Output is correct
43 Correct 107 ms 15484 KB Output is correct
44 Correct 471 ms 46192 KB Output is correct
45 Correct 395 ms 49740 KB Output is correct
46 Correct 405 ms 109564 KB Output is correct
47 Correct 678 ms 91968 KB Output is correct
48 Correct 938 ms 91984 KB Output is correct
49 Correct 777 ms 97248 KB Output is correct
50 Correct 789 ms 97292 KB Output is correct
51 Correct 723 ms 92724 KB Output is correct
52 Correct 691 ms 92008 KB Output is correct
53 Correct 748 ms 91788 KB Output is correct
54 Correct 0 ms 348 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 1 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 1 ms 348 KB Output is correct
61 Correct 0 ms 456 KB Output is correct
62 Correct 1 ms 348 KB Output is correct
63 Correct 1 ms 348 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 1 ms 600 KB Output is correct
66 Correct 1 ms 344 KB Output is correct
67 Correct 1 ms 348 KB Output is correct
68 Correct 1 ms 348 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 1 ms 456 KB Output is correct
71 Correct 0 ms 348 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 1 ms 344 KB Output is correct
74 Correct 0 ms 348 KB Output is correct
75 Correct 0 ms 452 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 1 ms 348 KB Output is correct
80 Correct 1 ms 344 KB Output is correct
81 Correct 1 ms 344 KB Output is correct
82 Correct 0 ms 348 KB Output is correct
83 Correct 1 ms 348 KB Output is correct
84 Correct 1 ms 348 KB Output is correct
85 Correct 1 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 1 ms 348 KB Output is correct
89 Correct 0 ms 348 KB Output is correct
90 Correct 0 ms 456 KB Output is correct
91 Correct 0 ms 600 KB Output is correct
92 Correct 1 ms 348 KB Output is correct
93 Correct 1 ms 448 KB Output is correct
94 Correct 1 ms 348 KB Output is correct
95 Correct 1 ms 348 KB Output is correct
96 Correct 1 ms 348 KB Output is correct
97 Correct 1 ms 348 KB Output is correct
98 Correct 0 ms 348 KB Output is correct
99 Correct 1 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 1 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 0 ms 348 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 344 KB Output is correct
108 Correct 1 ms 604 KB Output is correct
109 Correct 1 ms 604 KB Output is correct
110 Correct 13 ms 2800 KB Output is correct
111 Correct 23 ms 4312 KB Output is correct
112 Correct 14 ms 4564 KB Output is correct
113 Correct 58 ms 4588 KB Output is correct
114 Correct 50 ms 3932 KB Output is correct
115 Correct 46 ms 3932 KB Output is correct
116 Correct 111 ms 4188 KB Output is correct
117 Correct 23 ms 4184 KB Output is correct
118 Correct 23 ms 4188 KB Output is correct
119 Correct 101 ms 8860 KB Output is correct
120 Correct 35 ms 11748 KB Output is correct
121 Correct 185 ms 11748 KB Output is correct
122 Correct 168 ms 9560 KB Output is correct
123 Correct 172 ms 9560 KB Output is correct
124 Correct 291 ms 31796 KB Output is correct
125 Execution timed out 2043 ms 86344 KB Time limit exceeded
126 Halted 0 ms 0 KB -