Submission #990937

# Submission time Handle Problem Language Result Execution time Memory
990937 2024-05-31T20:36:25 Z tincamatei Maze (JOI23_ho_t3) C++14
27 / 100
2000 ms 12636 KB
// If this is correct, God forgive my soul for trying to code the legit solution.
#include <bits/stdc++.h>

int dl[] = {1, 0, -1, 0};
int dc[] = {0, 1,  0,-1};

struct Matrix {
    int R, C, N;
    std::vector<std::string> matr;
    std::vector<int> dist;

    int size;
    std::tuple<int, int, int> buffer[100000];

    explicit Matrix(int _R, int _C, int _N): R(_R), C(_C), N(_N) {
        matr.resize(_R);
        dist.resize(R * C, R * C + 1);
    }

    bool in_matrix(int l, int c) {
        return 0 <= l && l < R && 0 <= c && c < C;
    }

    int coord_to_index(int l, int c) {
        return l * C + c;
    }

    void create_adjacency_list(int l, int c) {
        size = 0;

        for (int i = 0; i < 4; i++) {
            int ln = l + dl[i];
            int cn = c + dc[i];

            if (in_matrix(ln, cn) && matr[ln][cn] == '.')
                buffer[size++] = {ln, cn, 0};
        }

        for (int ln = l - N; ln <= l + N; ln++)
            for (int cn = c - N; cn <= c + N; cn++) {
                if ((std::abs(l - ln) != N || std::abs(c - cn) != N) && in_matrix(ln, cn) &&
                        (ln != l || cn != c)) {
                    buffer[size++] = {ln, cn, 1};
                }
            }
    }

    int run_bfs(int Sl, int Sc, int Dl, int Dc) {
        std::deque<std::pair<int, int>> q;
        dist[coord_to_index(Sl, Sc)] = 0;
        q.push_back({Sl, Sc});

        while (!q.empty()) {
            int l = q.front().first;
            int c = q.front().second;
            int node = coord_to_index(l, c);

            if (l == Dl && c == Dc)
                return dist[node];

            q.pop_front();

            create_adjacency_list(l, c);

            for (int i = 0; i < size; i++) {
                auto [ln, cn, cost] = buffer[i];
                int node_to = coord_to_index(ln, cn);
                
                if (dist[node] + cost < dist[node_to]) {
                    dist[node_to] = dist[node] + cost;

                    if (cost == 0)
                        q.push_front({ln, cn});
                    else
                        q.push_back({ln, cn});
                }
            }
        }
        
        return dist[coord_to_index(Dl, Dc)];
    }
};

int main() {
    std::cin.tie(NULL);
    std::iostream::sync_with_stdio(false);

    int R, C, N;

    std::cin >> R >> C >> N;

    int Sl, Sc, Dl, Dc;
    std::cin >> Sl >> Sc >> Dl >> Dc;

    Sl--; Sc--; Dl--; Dc--;

    Matrix M(R, C, N);

    for (int i = 0; i < R; i++)
        std::cin >> M.matr[i];

    std::cout << M.run_bfs(Sl, Sc, Dl, Dc);
    
    return 0;
}

Compilation message

Main.cpp: In member function 'int Matrix::run_bfs(int, int, int, int)':
Main.cpp:66:22: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   66 |                 auto [ln, cn, cost] = buffer[i];
      |                      ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1628 KB Output is correct
2 Correct 1 ms 1624 KB Output is correct
3 Correct 1 ms 1624 KB Output is correct
4 Correct 1 ms 1628 KB Output is correct
5 Correct 1 ms 1624 KB Output is correct
6 Correct 1 ms 1628 KB Output is correct
7 Correct 1 ms 1628 KB Output is correct
8 Correct 1 ms 1628 KB Output is correct
9 Correct 1 ms 1372 KB Output is correct
10 Correct 1 ms 1372 KB Output is correct
11 Correct 2 ms 1372 KB Output is correct
12 Correct 1 ms 1372 KB Output is correct
13 Correct 1 ms 1628 KB Output is correct
14 Correct 1 ms 1372 KB Output is correct
15 Correct 1 ms 1372 KB Output is correct
16 Correct 1 ms 1628 KB Output is correct
17 Correct 1 ms 1628 KB Output is correct
18 Correct 2 ms 1628 KB Output is correct
19 Correct 3 ms 1884 KB Output is correct
20 Correct 2 ms 1900 KB Output is correct
21 Correct 2 ms 1884 KB Output is correct
22 Correct 7 ms 1884 KB Output is correct
23 Correct 6 ms 1960 KB Output is correct
24 Correct 3 ms 1884 KB Output is correct
25 Correct 3 ms 1880 KB Output is correct
26 Correct 2 ms 1888 KB Output is correct
27 Correct 2 ms 1884 KB Output is correct
28 Correct 2 ms 1884 KB Output is correct
29 Correct 12 ms 2396 KB Output is correct
30 Correct 3 ms 1880 KB Output is correct
31 Correct 4 ms 2904 KB Output is correct
32 Correct 11 ms 2396 KB Output is correct
33 Correct 6 ms 2392 KB Output is correct
34 Correct 10 ms 2668 KB Output is correct
35 Correct 6 ms 2652 KB Output is correct
36 Correct 10 ms 2464 KB Output is correct
37 Correct 9 ms 2408 KB Output is correct
38 Correct 2 ms 2396 KB Output is correct
39 Correct 82 ms 10588 KB Output is correct
40 Correct 5 ms 2652 KB Output is correct
41 Correct 4 ms 2792 KB Output is correct
42 Correct 14 ms 2908 KB Output is correct
43 Correct 9 ms 3164 KB Output is correct
44 Correct 18 ms 6252 KB Output is correct
45 Correct 17 ms 6464 KB Output is correct
46 Correct 17 ms 12636 KB Output is correct
47 Correct 105 ms 10620 KB Output is correct
48 Correct 61 ms 10588 KB Output is correct
49 Correct 33 ms 10744 KB Output is correct
50 Correct 32 ms 10744 KB Output is correct
51 Correct 84 ms 10800 KB Output is correct
52 Correct 54 ms 10672 KB Output is correct
53 Correct 62 ms 10588 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1620 KB Output is correct
2 Correct 1 ms 1628 KB Output is correct
3 Correct 2 ms 1628 KB Output is correct
4 Correct 1 ms 1624 KB Output is correct
5 Correct 1 ms 1628 KB Output is correct
6 Correct 1 ms 1628 KB Output is correct
7 Correct 1 ms 1372 KB Output is correct
8 Correct 1 ms 1628 KB Output is correct
9 Correct 2 ms 1624 KB Output is correct
10 Correct 1 ms 1628 KB Output is correct
11 Correct 1 ms 1628 KB Output is correct
12 Correct 4 ms 1628 KB Output is correct
13 Correct 6 ms 1624 KB Output is correct
14 Correct 7 ms 1628 KB Output is correct
15 Correct 1 ms 1628 KB Output is correct
16 Correct 1 ms 1628 KB Output is correct
17 Correct 1 ms 1628 KB Output is correct
18 Correct 1 ms 1368 KB Output is correct
19 Correct 2 ms 1628 KB Output is correct
20 Correct 2 ms 1628 KB Output is correct
21 Correct 1 ms 1628 KB Output is correct
22 Correct 1 ms 1372 KB Output is correct
23 Correct 1 ms 1372 KB Output is correct
24 Correct 1 ms 1372 KB Output is correct
25 Correct 1 ms 1628 KB Output is correct
26 Correct 1 ms 1628 KB Output is correct
27 Correct 1 ms 1632 KB Output is correct
28 Correct 1 ms 1628 KB Output is correct
29 Correct 1 ms 1372 KB Output is correct
30 Correct 1 ms 1628 KB Output is correct
31 Correct 1 ms 1628 KB Output is correct
32 Correct 1 ms 1628 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1624 KB Output is correct
2 Correct 1 ms 1628 KB Output is correct
3 Correct 1 ms 1624 KB Output is correct
4 Correct 1 ms 1624 KB Output is correct
5 Correct 1 ms 1376 KB Output is correct
6 Correct 1 ms 1636 KB Output is correct
7 Correct 1 ms 1636 KB Output is correct
8 Correct 2 ms 1636 KB Output is correct
9 Correct 4 ms 1632 KB Output is correct
10 Correct 6 ms 1632 KB Output is correct
11 Correct 8 ms 1640 KB Output is correct
12 Correct 1 ms 1632 KB Output is correct
13 Correct 1 ms 1452 KB Output is correct
14 Correct 2 ms 1628 KB Output is correct
15 Correct 1 ms 1368 KB Output is correct
16 Correct 1 ms 1372 KB Output is correct
17 Correct 2 ms 1628 KB Output is correct
18 Correct 2 ms 1472 KB Output is correct
19 Correct 1 ms 1628 KB Output is correct
20 Correct 1 ms 1628 KB Output is correct
21 Correct 1 ms 1624 KB Output is correct
22 Correct 1 ms 1628 KB Output is correct
23 Correct 1 ms 1628 KB Output is correct
24 Correct 8 ms 1664 KB Output is correct
25 Correct 2 ms 1880 KB Output is correct
26 Correct 22 ms 2396 KB Output is correct
27 Correct 3 ms 1884 KB Output is correct
28 Execution timed out 2090 ms 2484 KB Time limit exceeded
29 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1620 KB Output is correct
2 Correct 1 ms 1628 KB Output is correct
3 Correct 2 ms 1628 KB Output is correct
4 Correct 1 ms 1624 KB Output is correct
5 Correct 1 ms 1628 KB Output is correct
6 Correct 1 ms 1628 KB Output is correct
7 Correct 1 ms 1372 KB Output is correct
8 Correct 1 ms 1628 KB Output is correct
9 Correct 2 ms 1624 KB Output is correct
10 Correct 1 ms 1628 KB Output is correct
11 Correct 1 ms 1628 KB Output is correct
12 Correct 4 ms 1628 KB Output is correct
13 Correct 6 ms 1624 KB Output is correct
14 Correct 7 ms 1628 KB Output is correct
15 Correct 1 ms 1628 KB Output is correct
16 Correct 1 ms 1628 KB Output is correct
17 Correct 1 ms 1628 KB Output is correct
18 Correct 1 ms 1368 KB Output is correct
19 Correct 2 ms 1628 KB Output is correct
20 Correct 2 ms 1628 KB Output is correct
21 Correct 1 ms 1628 KB Output is correct
22 Correct 1 ms 1372 KB Output is correct
23 Correct 1 ms 1372 KB Output is correct
24 Correct 1 ms 1372 KB Output is correct
25 Correct 1 ms 1628 KB Output is correct
26 Correct 1 ms 1628 KB Output is correct
27 Correct 1 ms 1632 KB Output is correct
28 Correct 1 ms 1628 KB Output is correct
29 Correct 1 ms 1372 KB Output is correct
30 Correct 1 ms 1628 KB Output is correct
31 Correct 1 ms 1628 KB Output is correct
32 Correct 1 ms 1628 KB Output is correct
33 Correct 3 ms 1880 KB Output is correct
34 Correct 5 ms 1628 KB Output is correct
35 Correct 1 ms 1628 KB Output is correct
36 Correct 2 ms 1680 KB Output is correct
37 Correct 2 ms 1884 KB Output is correct
38 Correct 22 ms 2444 KB Output is correct
39 Correct 3 ms 1884 KB Output is correct
40 Correct 5 ms 1884 KB Output is correct
41 Correct 4 ms 1880 KB Output is correct
42 Execution timed out 2072 ms 2484 KB Time limit exceeded
43 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1620 KB Output is correct
2 Correct 1 ms 1628 KB Output is correct
3 Correct 2 ms 1628 KB Output is correct
4 Correct 1 ms 1624 KB Output is correct
5 Correct 1 ms 1628 KB Output is correct
6 Correct 1 ms 1628 KB Output is correct
7 Correct 1 ms 1372 KB Output is correct
8 Correct 1 ms 1628 KB Output is correct
9 Correct 2 ms 1624 KB Output is correct
10 Correct 1 ms 1628 KB Output is correct
11 Correct 1 ms 1628 KB Output is correct
12 Correct 4 ms 1628 KB Output is correct
13 Correct 6 ms 1624 KB Output is correct
14 Correct 7 ms 1628 KB Output is correct
15 Correct 1 ms 1628 KB Output is correct
16 Correct 1 ms 1628 KB Output is correct
17 Correct 1 ms 1628 KB Output is correct
18 Correct 1 ms 1368 KB Output is correct
19 Correct 2 ms 1628 KB Output is correct
20 Correct 2 ms 1628 KB Output is correct
21 Correct 1 ms 1628 KB Output is correct
22 Correct 1 ms 1372 KB Output is correct
23 Correct 1 ms 1372 KB Output is correct
24 Correct 1 ms 1372 KB Output is correct
25 Correct 1 ms 1628 KB Output is correct
26 Correct 1 ms 1628 KB Output is correct
27 Correct 1 ms 1632 KB Output is correct
28 Correct 1 ms 1628 KB Output is correct
29 Correct 1 ms 1372 KB Output is correct
30 Correct 1 ms 1628 KB Output is correct
31 Correct 1 ms 1628 KB Output is correct
32 Correct 1 ms 1628 KB Output is correct
33 Correct 3 ms 1880 KB Output is correct
34 Correct 5 ms 1628 KB Output is correct
35 Correct 1 ms 1628 KB Output is correct
36 Correct 2 ms 1680 KB Output is correct
37 Correct 2 ms 1884 KB Output is correct
38 Correct 22 ms 2444 KB Output is correct
39 Correct 3 ms 1884 KB Output is correct
40 Correct 5 ms 1884 KB Output is correct
41 Correct 4 ms 1880 KB Output is correct
42 Execution timed out 2072 ms 2484 KB Time limit exceeded
43 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1628 KB Output is correct
2 Correct 1 ms 1624 KB Output is correct
3 Correct 1 ms 1624 KB Output is correct
4 Correct 1 ms 1628 KB Output is correct
5 Correct 1 ms 1624 KB Output is correct
6 Correct 1 ms 1628 KB Output is correct
7 Correct 1 ms 1628 KB Output is correct
8 Correct 1 ms 1628 KB Output is correct
9 Correct 1 ms 1372 KB Output is correct
10 Correct 1 ms 1372 KB Output is correct
11 Correct 2 ms 1372 KB Output is correct
12 Correct 1 ms 1372 KB Output is correct
13 Correct 1 ms 1628 KB Output is correct
14 Correct 1 ms 1372 KB Output is correct
15 Correct 1 ms 1372 KB Output is correct
16 Correct 1 ms 1628 KB Output is correct
17 Correct 1 ms 1628 KB Output is correct
18 Correct 2 ms 1628 KB Output is correct
19 Correct 3 ms 1884 KB Output is correct
20 Correct 2 ms 1900 KB Output is correct
21 Correct 2 ms 1884 KB Output is correct
22 Correct 7 ms 1884 KB Output is correct
23 Correct 6 ms 1960 KB Output is correct
24 Correct 3 ms 1884 KB Output is correct
25 Correct 3 ms 1880 KB Output is correct
26 Correct 2 ms 1888 KB Output is correct
27 Correct 2 ms 1884 KB Output is correct
28 Correct 2 ms 1884 KB Output is correct
29 Correct 12 ms 2396 KB Output is correct
30 Correct 3 ms 1880 KB Output is correct
31 Correct 4 ms 2904 KB Output is correct
32 Correct 11 ms 2396 KB Output is correct
33 Correct 6 ms 2392 KB Output is correct
34 Correct 10 ms 2668 KB Output is correct
35 Correct 6 ms 2652 KB Output is correct
36 Correct 10 ms 2464 KB Output is correct
37 Correct 9 ms 2408 KB Output is correct
38 Correct 2 ms 2396 KB Output is correct
39 Correct 82 ms 10588 KB Output is correct
40 Correct 5 ms 2652 KB Output is correct
41 Correct 4 ms 2792 KB Output is correct
42 Correct 14 ms 2908 KB Output is correct
43 Correct 9 ms 3164 KB Output is correct
44 Correct 18 ms 6252 KB Output is correct
45 Correct 17 ms 6464 KB Output is correct
46 Correct 17 ms 12636 KB Output is correct
47 Correct 105 ms 10620 KB Output is correct
48 Correct 61 ms 10588 KB Output is correct
49 Correct 33 ms 10744 KB Output is correct
50 Correct 32 ms 10744 KB Output is correct
51 Correct 84 ms 10800 KB Output is correct
52 Correct 54 ms 10672 KB Output is correct
53 Correct 62 ms 10588 KB Output is correct
54 Correct 2 ms 1620 KB Output is correct
55 Correct 1 ms 1628 KB Output is correct
56 Correct 2 ms 1628 KB Output is correct
57 Correct 1 ms 1624 KB Output is correct
58 Correct 1 ms 1628 KB Output is correct
59 Correct 1 ms 1628 KB Output is correct
60 Correct 1 ms 1372 KB Output is correct
61 Correct 1 ms 1628 KB Output is correct
62 Correct 2 ms 1624 KB Output is correct
63 Correct 1 ms 1628 KB Output is correct
64 Correct 1 ms 1628 KB Output is correct
65 Correct 4 ms 1628 KB Output is correct
66 Correct 6 ms 1624 KB Output is correct
67 Correct 7 ms 1628 KB Output is correct
68 Correct 1 ms 1628 KB Output is correct
69 Correct 1 ms 1628 KB Output is correct
70 Correct 1 ms 1628 KB Output is correct
71 Correct 1 ms 1368 KB Output is correct
72 Correct 2 ms 1628 KB Output is correct
73 Correct 2 ms 1628 KB Output is correct
74 Correct 1 ms 1628 KB Output is correct
75 Correct 1 ms 1372 KB Output is correct
76 Correct 1 ms 1372 KB Output is correct
77 Correct 1 ms 1372 KB Output is correct
78 Correct 1 ms 1628 KB Output is correct
79 Correct 1 ms 1628 KB Output is correct
80 Correct 1 ms 1632 KB Output is correct
81 Correct 1 ms 1628 KB Output is correct
82 Correct 1 ms 1372 KB Output is correct
83 Correct 1 ms 1628 KB Output is correct
84 Correct 1 ms 1628 KB Output is correct
85 Correct 1 ms 1628 KB Output is correct
86 Correct 1 ms 1624 KB Output is correct
87 Correct 1 ms 1628 KB Output is correct
88 Correct 1 ms 1624 KB Output is correct
89 Correct 1 ms 1624 KB Output is correct
90 Correct 1 ms 1376 KB Output is correct
91 Correct 1 ms 1636 KB Output is correct
92 Correct 1 ms 1636 KB Output is correct
93 Correct 2 ms 1636 KB Output is correct
94 Correct 4 ms 1632 KB Output is correct
95 Correct 6 ms 1632 KB Output is correct
96 Correct 8 ms 1640 KB Output is correct
97 Correct 1 ms 1632 KB Output is correct
98 Correct 1 ms 1452 KB Output is correct
99 Correct 2 ms 1628 KB Output is correct
100 Correct 1 ms 1368 KB Output is correct
101 Correct 1 ms 1372 KB Output is correct
102 Correct 2 ms 1628 KB Output is correct
103 Correct 2 ms 1472 KB Output is correct
104 Correct 1 ms 1628 KB Output is correct
105 Correct 1 ms 1628 KB Output is correct
106 Correct 1 ms 1624 KB Output is correct
107 Correct 1 ms 1628 KB Output is correct
108 Correct 1 ms 1628 KB Output is correct
109 Correct 8 ms 1664 KB Output is correct
110 Correct 2 ms 1880 KB Output is correct
111 Correct 22 ms 2396 KB Output is correct
112 Correct 3 ms 1884 KB Output is correct
113 Execution timed out 2090 ms 2484 KB Time limit exceeded
114 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1628 KB Output is correct
2 Correct 1 ms 1624 KB Output is correct
3 Correct 1 ms 1624 KB Output is correct
4 Correct 1 ms 1628 KB Output is correct
5 Correct 1 ms 1624 KB Output is correct
6 Correct 1 ms 1628 KB Output is correct
7 Correct 1 ms 1628 KB Output is correct
8 Correct 1 ms 1628 KB Output is correct
9 Correct 1 ms 1372 KB Output is correct
10 Correct 1 ms 1372 KB Output is correct
11 Correct 2 ms 1372 KB Output is correct
12 Correct 1 ms 1372 KB Output is correct
13 Correct 1 ms 1628 KB Output is correct
14 Correct 1 ms 1372 KB Output is correct
15 Correct 1 ms 1372 KB Output is correct
16 Correct 1 ms 1628 KB Output is correct
17 Correct 1 ms 1628 KB Output is correct
18 Correct 2 ms 1628 KB Output is correct
19 Correct 3 ms 1884 KB Output is correct
20 Correct 2 ms 1900 KB Output is correct
21 Correct 2 ms 1884 KB Output is correct
22 Correct 7 ms 1884 KB Output is correct
23 Correct 6 ms 1960 KB Output is correct
24 Correct 3 ms 1884 KB Output is correct
25 Correct 3 ms 1880 KB Output is correct
26 Correct 2 ms 1888 KB Output is correct
27 Correct 2 ms 1884 KB Output is correct
28 Correct 2 ms 1884 KB Output is correct
29 Correct 12 ms 2396 KB Output is correct
30 Correct 3 ms 1880 KB Output is correct
31 Correct 4 ms 2904 KB Output is correct
32 Correct 11 ms 2396 KB Output is correct
33 Correct 6 ms 2392 KB Output is correct
34 Correct 10 ms 2668 KB Output is correct
35 Correct 6 ms 2652 KB Output is correct
36 Correct 10 ms 2464 KB Output is correct
37 Correct 9 ms 2408 KB Output is correct
38 Correct 2 ms 2396 KB Output is correct
39 Correct 82 ms 10588 KB Output is correct
40 Correct 5 ms 2652 KB Output is correct
41 Correct 4 ms 2792 KB Output is correct
42 Correct 14 ms 2908 KB Output is correct
43 Correct 9 ms 3164 KB Output is correct
44 Correct 18 ms 6252 KB Output is correct
45 Correct 17 ms 6464 KB Output is correct
46 Correct 17 ms 12636 KB Output is correct
47 Correct 105 ms 10620 KB Output is correct
48 Correct 61 ms 10588 KB Output is correct
49 Correct 33 ms 10744 KB Output is correct
50 Correct 32 ms 10744 KB Output is correct
51 Correct 84 ms 10800 KB Output is correct
52 Correct 54 ms 10672 KB Output is correct
53 Correct 62 ms 10588 KB Output is correct
54 Correct 2 ms 1620 KB Output is correct
55 Correct 1 ms 1628 KB Output is correct
56 Correct 2 ms 1628 KB Output is correct
57 Correct 1 ms 1624 KB Output is correct
58 Correct 1 ms 1628 KB Output is correct
59 Correct 1 ms 1628 KB Output is correct
60 Correct 1 ms 1372 KB Output is correct
61 Correct 1 ms 1628 KB Output is correct
62 Correct 2 ms 1624 KB Output is correct
63 Correct 1 ms 1628 KB Output is correct
64 Correct 1 ms 1628 KB Output is correct
65 Correct 4 ms 1628 KB Output is correct
66 Correct 6 ms 1624 KB Output is correct
67 Correct 7 ms 1628 KB Output is correct
68 Correct 1 ms 1628 KB Output is correct
69 Correct 1 ms 1628 KB Output is correct
70 Correct 1 ms 1628 KB Output is correct
71 Correct 1 ms 1368 KB Output is correct
72 Correct 2 ms 1628 KB Output is correct
73 Correct 2 ms 1628 KB Output is correct
74 Correct 1 ms 1628 KB Output is correct
75 Correct 1 ms 1372 KB Output is correct
76 Correct 1 ms 1372 KB Output is correct
77 Correct 1 ms 1372 KB Output is correct
78 Correct 1 ms 1628 KB Output is correct
79 Correct 1 ms 1628 KB Output is correct
80 Correct 1 ms 1632 KB Output is correct
81 Correct 1 ms 1628 KB Output is correct
82 Correct 1 ms 1372 KB Output is correct
83 Correct 1 ms 1628 KB Output is correct
84 Correct 1 ms 1628 KB Output is correct
85 Correct 1 ms 1628 KB Output is correct
86 Correct 1 ms 1624 KB Output is correct
87 Correct 1 ms 1628 KB Output is correct
88 Correct 1 ms 1624 KB Output is correct
89 Correct 1 ms 1624 KB Output is correct
90 Correct 1 ms 1376 KB Output is correct
91 Correct 1 ms 1636 KB Output is correct
92 Correct 1 ms 1636 KB Output is correct
93 Correct 2 ms 1636 KB Output is correct
94 Correct 4 ms 1632 KB Output is correct
95 Correct 6 ms 1632 KB Output is correct
96 Correct 8 ms 1640 KB Output is correct
97 Correct 1 ms 1632 KB Output is correct
98 Correct 1 ms 1452 KB Output is correct
99 Correct 2 ms 1628 KB Output is correct
100 Correct 1 ms 1368 KB Output is correct
101 Correct 1 ms 1372 KB Output is correct
102 Correct 2 ms 1628 KB Output is correct
103 Correct 2 ms 1472 KB Output is correct
104 Correct 1 ms 1628 KB Output is correct
105 Correct 1 ms 1628 KB Output is correct
106 Correct 1 ms 1624 KB Output is correct
107 Correct 1 ms 1628 KB Output is correct
108 Correct 1 ms 1628 KB Output is correct
109 Correct 8 ms 1664 KB Output is correct
110 Correct 2 ms 1880 KB Output is correct
111 Correct 22 ms 2396 KB Output is correct
112 Correct 3 ms 1884 KB Output is correct
113 Execution timed out 2090 ms 2484 KB Time limit exceeded
114 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 1628 KB Output is correct
2 Correct 1 ms 1624 KB Output is correct
3 Correct 1 ms 1624 KB Output is correct
4 Correct 1 ms 1628 KB Output is correct
5 Correct 1 ms 1624 KB Output is correct
6 Correct 1 ms 1628 KB Output is correct
7 Correct 1 ms 1628 KB Output is correct
8 Correct 1 ms 1628 KB Output is correct
9 Correct 1 ms 1372 KB Output is correct
10 Correct 1 ms 1372 KB Output is correct
11 Correct 2 ms 1372 KB Output is correct
12 Correct 1 ms 1372 KB Output is correct
13 Correct 1 ms 1628 KB Output is correct
14 Correct 1 ms 1372 KB Output is correct
15 Correct 1 ms 1372 KB Output is correct
16 Correct 1 ms 1628 KB Output is correct
17 Correct 1 ms 1628 KB Output is correct
18 Correct 2 ms 1628 KB Output is correct
19 Correct 3 ms 1884 KB Output is correct
20 Correct 2 ms 1900 KB Output is correct
21 Correct 2 ms 1884 KB Output is correct
22 Correct 7 ms 1884 KB Output is correct
23 Correct 6 ms 1960 KB Output is correct
24 Correct 3 ms 1884 KB Output is correct
25 Correct 3 ms 1880 KB Output is correct
26 Correct 2 ms 1888 KB Output is correct
27 Correct 2 ms 1884 KB Output is correct
28 Correct 2 ms 1884 KB Output is correct
29 Correct 12 ms 2396 KB Output is correct
30 Correct 3 ms 1880 KB Output is correct
31 Correct 4 ms 2904 KB Output is correct
32 Correct 11 ms 2396 KB Output is correct
33 Correct 6 ms 2392 KB Output is correct
34 Correct 10 ms 2668 KB Output is correct
35 Correct 6 ms 2652 KB Output is correct
36 Correct 10 ms 2464 KB Output is correct
37 Correct 9 ms 2408 KB Output is correct
38 Correct 2 ms 2396 KB Output is correct
39 Correct 82 ms 10588 KB Output is correct
40 Correct 5 ms 2652 KB Output is correct
41 Correct 4 ms 2792 KB Output is correct
42 Correct 14 ms 2908 KB Output is correct
43 Correct 9 ms 3164 KB Output is correct
44 Correct 18 ms 6252 KB Output is correct
45 Correct 17 ms 6464 KB Output is correct
46 Correct 17 ms 12636 KB Output is correct
47 Correct 105 ms 10620 KB Output is correct
48 Correct 61 ms 10588 KB Output is correct
49 Correct 33 ms 10744 KB Output is correct
50 Correct 32 ms 10744 KB Output is correct
51 Correct 84 ms 10800 KB Output is correct
52 Correct 54 ms 10672 KB Output is correct
53 Correct 62 ms 10588 KB Output is correct
54 Correct 2 ms 1620 KB Output is correct
55 Correct 1 ms 1628 KB Output is correct
56 Correct 2 ms 1628 KB Output is correct
57 Correct 1 ms 1624 KB Output is correct
58 Correct 1 ms 1628 KB Output is correct
59 Correct 1 ms 1628 KB Output is correct
60 Correct 1 ms 1372 KB Output is correct
61 Correct 1 ms 1628 KB Output is correct
62 Correct 2 ms 1624 KB Output is correct
63 Correct 1 ms 1628 KB Output is correct
64 Correct 1 ms 1628 KB Output is correct
65 Correct 4 ms 1628 KB Output is correct
66 Correct 6 ms 1624 KB Output is correct
67 Correct 7 ms 1628 KB Output is correct
68 Correct 1 ms 1628 KB Output is correct
69 Correct 1 ms 1628 KB Output is correct
70 Correct 1 ms 1628 KB Output is correct
71 Correct 1 ms 1368 KB Output is correct
72 Correct 2 ms 1628 KB Output is correct
73 Correct 2 ms 1628 KB Output is correct
74 Correct 1 ms 1628 KB Output is correct
75 Correct 1 ms 1372 KB Output is correct
76 Correct 1 ms 1372 KB Output is correct
77 Correct 1 ms 1372 KB Output is correct
78 Correct 1 ms 1628 KB Output is correct
79 Correct 1 ms 1628 KB Output is correct
80 Correct 1 ms 1632 KB Output is correct
81 Correct 1 ms 1628 KB Output is correct
82 Correct 1 ms 1372 KB Output is correct
83 Correct 1 ms 1628 KB Output is correct
84 Correct 1 ms 1628 KB Output is correct
85 Correct 1 ms 1628 KB Output is correct
86 Correct 1 ms 1624 KB Output is correct
87 Correct 1 ms 1628 KB Output is correct
88 Correct 1 ms 1624 KB Output is correct
89 Correct 1 ms 1624 KB Output is correct
90 Correct 1 ms 1376 KB Output is correct
91 Correct 1 ms 1636 KB Output is correct
92 Correct 1 ms 1636 KB Output is correct
93 Correct 2 ms 1636 KB Output is correct
94 Correct 4 ms 1632 KB Output is correct
95 Correct 6 ms 1632 KB Output is correct
96 Correct 8 ms 1640 KB Output is correct
97 Correct 1 ms 1632 KB Output is correct
98 Correct 1 ms 1452 KB Output is correct
99 Correct 2 ms 1628 KB Output is correct
100 Correct 1 ms 1368 KB Output is correct
101 Correct 1 ms 1372 KB Output is correct
102 Correct 2 ms 1628 KB Output is correct
103 Correct 2 ms 1472 KB Output is correct
104 Correct 1 ms 1628 KB Output is correct
105 Correct 1 ms 1628 KB Output is correct
106 Correct 1 ms 1624 KB Output is correct
107 Correct 1 ms 1628 KB Output is correct
108 Correct 1 ms 1628 KB Output is correct
109 Correct 8 ms 1664 KB Output is correct
110 Correct 2 ms 1880 KB Output is correct
111 Correct 22 ms 2396 KB Output is correct
112 Correct 3 ms 1884 KB Output is correct
113 Execution timed out 2090 ms 2484 KB Time limit exceeded
114 Halted 0 ms 0 KB -