답안 #1040055

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1040055 2024-07-31T14:51:42 Z TAhmed33 Maze (JOI23_ho_t3) C++
27 / 100
2000 ms 36372 KB
#include <bits/stdc++.h>
using namespace std;
int n, m, x;
int sr, sc, gr, gc;
vector <vector <char>> a;
deque <array <int, 3>> pq;
vector <vector <int>> dist;
int dx[4] = {0, -1, 0, 1};
int dy[4] = {1, 0, -1, 0};
void solve () {
    cin >> n >> m >> x >> sr >> sc >> gr >> gc;
    a.resize(n);
    dist.resize(n);
    for (auto &i : dist) {
        i.resize(m);
        for (auto &j : i) {
            j = 1e9;
        }
    }
    for (auto &i : a) {
        i.resize(m);
        for (auto &j : i) {
            cin >> j;
        }
    }
    sr--; sc--; gr--; gc--;   
    dist[sr][sc] = 0;

    pq.push_back({0, sr, sc}); 
    while (!pq.empty()) {
        auto k = pq.front();
        pq.pop_front();
        if (k[0] > dist[k[1]][k[2]]) {
            continue;
        }
        for (int g = -x; g <= x; g++) {
            for (int h = -x; h <= x; h++) {
                int j = k[1] + g, l = k[2] + h;
                if (j < 0 || j >= n || l < 0 || l >= m) {
                    continue;
                }
                bool flag = abs(j - k[1]) < x;
                flag |= abs(l - k[2]) < x;
                if (!flag) continue;
                if (k[0] + 1 < dist[j][l]) {
                    dist[j][l] = k[0] + 1;
                    pq.push_back({dist[j][l], j, l});
                }
            }
        }
        for (int i = 0; i < 4; i++) {
            int x = k[1] + dx[i], y = k[2] + dy[i];
            if (x >= 0 && x < n && y >= 0 && y < m) {
                if (a[x][y] != '#') {
                    if (dist[x][y] > k[0]) {
                        dist[x][y] = k[0];
                        pq.push_front({dist[x][y], x, y});
                    }
                }
            }
        }
    }
    cout << dist[gr][gc] << '\n';
}       
signed main () {

    ios::sync_with_stdio(0); cin.tie(0);
    int tc = 1; //cin >> tc;
    while (tc--) solve();
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 2 ms 604 KB Output is correct
20 Correct 1 ms 604 KB Output is correct
21 Correct 3 ms 1884 KB Output is correct
22 Correct 4 ms 604 KB Output is correct
23 Correct 2 ms 604 KB Output is correct
24 Correct 3 ms 980 KB Output is correct
25 Correct 2 ms 604 KB Output is correct
26 Correct 4 ms 956 KB Output is correct
27 Correct 4 ms 860 KB Output is correct
28 Correct 2 ms 776 KB Output is correct
29 Correct 6 ms 1380 KB Output is correct
30 Correct 3 ms 820 KB Output is correct
31 Correct 7 ms 3932 KB Output is correct
32 Correct 9 ms 1372 KB Output is correct
33 Correct 5 ms 1288 KB Output is correct
34 Correct 5 ms 1364 KB Output is correct
35 Correct 4 ms 1116 KB Output is correct
36 Correct 9 ms 1552 KB Output is correct
37 Correct 8 ms 1444 KB Output is correct
38 Correct 5 ms 1372 KB Output is correct
39 Correct 64 ms 9448 KB Output is correct
40 Correct 11 ms 1460 KB Output is correct
41 Correct 7 ms 1372 KB Output is correct
42 Correct 9 ms 1624 KB Output is correct
43 Correct 10 ms 1884 KB Output is correct
44 Correct 38 ms 4844 KB Output is correct
45 Correct 33 ms 4956 KB Output is correct
46 Correct 76 ms 36372 KB Output is correct
47 Correct 100 ms 9556 KB Output is correct
48 Correct 51 ms 9304 KB Output is correct
49 Correct 39 ms 9204 KB Output is correct
50 Correct 36 ms 9052 KB Output is correct
51 Correct 86 ms 10008 KB Output is correct
52 Correct 94 ms 9600 KB Output is correct
53 Correct 55 ms 9304 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 352 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 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 4 ms 472 KB Output is correct
13 Correct 4 ms 348 KB Output is correct
14 Correct 4 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 600 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 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 0 ms 348 KB Output is correct
29 Correct 0 ms 600 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 4 ms 348 KB Output is correct
10 Correct 5 ms 472 KB Output is correct
11 Correct 5 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 344 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 5 ms 348 KB Output is correct
25 Correct 5 ms 600 KB Output is correct
26 Correct 12 ms 1372 KB Output is correct
27 Correct 3 ms 1628 KB Output is correct
28 Execution timed out 2091 ms 1796 KB Time limit exceeded
29 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 352 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 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 4 ms 472 KB Output is correct
13 Correct 4 ms 348 KB Output is correct
14 Correct 4 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 600 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 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 0 ms 348 KB Output is correct
29 Correct 0 ms 600 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
33 Correct 3 ms 604 KB Output is correct
34 Correct 5 ms 348 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 4 ms 704 KB Output is correct
37 Correct 1 ms 604 KB Output is correct
38 Correct 12 ms 1600 KB Output is correct
39 Correct 2 ms 1884 KB Output is correct
40 Correct 3 ms 604 KB Output is correct
41 Correct 4 ms 604 KB Output is correct
42 Execution timed out 2065 ms 1620 KB Time limit exceeded
43 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 352 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 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 4 ms 472 KB Output is correct
13 Correct 4 ms 348 KB Output is correct
14 Correct 4 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 600 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 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 0 ms 348 KB Output is correct
29 Correct 0 ms 600 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
33 Correct 3 ms 604 KB Output is correct
34 Correct 5 ms 348 KB Output is correct
35 Correct 0 ms 348 KB Output is correct
36 Correct 4 ms 704 KB Output is correct
37 Correct 1 ms 604 KB Output is correct
38 Correct 12 ms 1600 KB Output is correct
39 Correct 2 ms 1884 KB Output is correct
40 Correct 3 ms 604 KB Output is correct
41 Correct 4 ms 604 KB Output is correct
42 Execution timed out 2065 ms 1620 KB Time limit exceeded
43 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 2 ms 604 KB Output is correct
20 Correct 1 ms 604 KB Output is correct
21 Correct 3 ms 1884 KB Output is correct
22 Correct 4 ms 604 KB Output is correct
23 Correct 2 ms 604 KB Output is correct
24 Correct 3 ms 980 KB Output is correct
25 Correct 2 ms 604 KB Output is correct
26 Correct 4 ms 956 KB Output is correct
27 Correct 4 ms 860 KB Output is correct
28 Correct 2 ms 776 KB Output is correct
29 Correct 6 ms 1380 KB Output is correct
30 Correct 3 ms 820 KB Output is correct
31 Correct 7 ms 3932 KB Output is correct
32 Correct 9 ms 1372 KB Output is correct
33 Correct 5 ms 1288 KB Output is correct
34 Correct 5 ms 1364 KB Output is correct
35 Correct 4 ms 1116 KB Output is correct
36 Correct 9 ms 1552 KB Output is correct
37 Correct 8 ms 1444 KB Output is correct
38 Correct 5 ms 1372 KB Output is correct
39 Correct 64 ms 9448 KB Output is correct
40 Correct 11 ms 1460 KB Output is correct
41 Correct 7 ms 1372 KB Output is correct
42 Correct 9 ms 1624 KB Output is correct
43 Correct 10 ms 1884 KB Output is correct
44 Correct 38 ms 4844 KB Output is correct
45 Correct 33 ms 4956 KB Output is correct
46 Correct 76 ms 36372 KB Output is correct
47 Correct 100 ms 9556 KB Output is correct
48 Correct 51 ms 9304 KB Output is correct
49 Correct 39 ms 9204 KB Output is correct
50 Correct 36 ms 9052 KB Output is correct
51 Correct 86 ms 10008 KB Output is correct
52 Correct 94 ms 9600 KB Output is correct
53 Correct 55 ms 9304 KB Output is correct
54 Correct 0 ms 344 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 0 ms 352 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 0 ms 348 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 0 ms 344 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 1 ms 348 KB Output is correct
63 Correct 0 ms 348 KB Output is correct
64 Correct 0 ms 348 KB Output is correct
65 Correct 4 ms 472 KB Output is correct
66 Correct 4 ms 348 KB Output is correct
67 Correct 4 ms 348 KB Output is correct
68 Correct 0 ms 348 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 0 ms 348 KB Output is correct
71 Correct 0 ms 600 KB Output is correct
72 Correct 0 ms 348 KB Output is correct
73 Correct 0 ms 348 KB Output is correct
74 Correct 0 ms 348 KB Output is correct
75 Correct 0 ms 348 KB Output is correct
76 Correct 0 ms 348 KB Output is correct
77 Correct 1 ms 348 KB Output is correct
78 Correct 0 ms 348 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 0 ms 348 KB Output is correct
81 Correct 0 ms 348 KB Output is correct
82 Correct 0 ms 600 KB Output is correct
83 Correct 0 ms 348 KB Output is correct
84 Correct 0 ms 348 KB Output is correct
85 Correct 0 ms 348 KB Output is correct
86 Correct 0 ms 348 KB Output is correct
87 Correct 0 ms 348 KB Output is correct
88 Correct 0 ms 348 KB Output is correct
89 Correct 0 ms 348 KB Output is correct
90 Correct 0 ms 344 KB Output is correct
91 Correct 0 ms 348 KB Output is correct
92 Correct 0 ms 348 KB Output is correct
93 Correct 1 ms 348 KB Output is correct
94 Correct 4 ms 348 KB Output is correct
95 Correct 5 ms 472 KB Output is correct
96 Correct 5 ms 348 KB Output is correct
97 Correct 0 ms 348 KB Output is correct
98 Correct 0 ms 348 KB Output is correct
99 Correct 0 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 0 ms 344 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 1 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 0 ms 348 KB Output is correct
108 Correct 0 ms 348 KB Output is correct
109 Correct 5 ms 348 KB Output is correct
110 Correct 5 ms 600 KB Output is correct
111 Correct 12 ms 1372 KB Output is correct
112 Correct 3 ms 1628 KB Output is correct
113 Execution timed out 2091 ms 1796 KB Time limit exceeded
114 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 2 ms 604 KB Output is correct
20 Correct 1 ms 604 KB Output is correct
21 Correct 3 ms 1884 KB Output is correct
22 Correct 4 ms 604 KB Output is correct
23 Correct 2 ms 604 KB Output is correct
24 Correct 3 ms 980 KB Output is correct
25 Correct 2 ms 604 KB Output is correct
26 Correct 4 ms 956 KB Output is correct
27 Correct 4 ms 860 KB Output is correct
28 Correct 2 ms 776 KB Output is correct
29 Correct 6 ms 1380 KB Output is correct
30 Correct 3 ms 820 KB Output is correct
31 Correct 7 ms 3932 KB Output is correct
32 Correct 9 ms 1372 KB Output is correct
33 Correct 5 ms 1288 KB Output is correct
34 Correct 5 ms 1364 KB Output is correct
35 Correct 4 ms 1116 KB Output is correct
36 Correct 9 ms 1552 KB Output is correct
37 Correct 8 ms 1444 KB Output is correct
38 Correct 5 ms 1372 KB Output is correct
39 Correct 64 ms 9448 KB Output is correct
40 Correct 11 ms 1460 KB Output is correct
41 Correct 7 ms 1372 KB Output is correct
42 Correct 9 ms 1624 KB Output is correct
43 Correct 10 ms 1884 KB Output is correct
44 Correct 38 ms 4844 KB Output is correct
45 Correct 33 ms 4956 KB Output is correct
46 Correct 76 ms 36372 KB Output is correct
47 Correct 100 ms 9556 KB Output is correct
48 Correct 51 ms 9304 KB Output is correct
49 Correct 39 ms 9204 KB Output is correct
50 Correct 36 ms 9052 KB Output is correct
51 Correct 86 ms 10008 KB Output is correct
52 Correct 94 ms 9600 KB Output is correct
53 Correct 55 ms 9304 KB Output is correct
54 Correct 0 ms 344 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 0 ms 352 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 0 ms 348 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 0 ms 344 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 1 ms 348 KB Output is correct
63 Correct 0 ms 348 KB Output is correct
64 Correct 0 ms 348 KB Output is correct
65 Correct 4 ms 472 KB Output is correct
66 Correct 4 ms 348 KB Output is correct
67 Correct 4 ms 348 KB Output is correct
68 Correct 0 ms 348 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 0 ms 348 KB Output is correct
71 Correct 0 ms 600 KB Output is correct
72 Correct 0 ms 348 KB Output is correct
73 Correct 0 ms 348 KB Output is correct
74 Correct 0 ms 348 KB Output is correct
75 Correct 0 ms 348 KB Output is correct
76 Correct 0 ms 348 KB Output is correct
77 Correct 1 ms 348 KB Output is correct
78 Correct 0 ms 348 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 0 ms 348 KB Output is correct
81 Correct 0 ms 348 KB Output is correct
82 Correct 0 ms 600 KB Output is correct
83 Correct 0 ms 348 KB Output is correct
84 Correct 0 ms 348 KB Output is correct
85 Correct 0 ms 348 KB Output is correct
86 Correct 0 ms 348 KB Output is correct
87 Correct 0 ms 348 KB Output is correct
88 Correct 0 ms 348 KB Output is correct
89 Correct 0 ms 348 KB Output is correct
90 Correct 0 ms 344 KB Output is correct
91 Correct 0 ms 348 KB Output is correct
92 Correct 0 ms 348 KB Output is correct
93 Correct 1 ms 348 KB Output is correct
94 Correct 4 ms 348 KB Output is correct
95 Correct 5 ms 472 KB Output is correct
96 Correct 5 ms 348 KB Output is correct
97 Correct 0 ms 348 KB Output is correct
98 Correct 0 ms 348 KB Output is correct
99 Correct 0 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 0 ms 344 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 1 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 0 ms 348 KB Output is correct
108 Correct 0 ms 348 KB Output is correct
109 Correct 5 ms 348 KB Output is correct
110 Correct 5 ms 600 KB Output is correct
111 Correct 12 ms 1372 KB Output is correct
112 Correct 3 ms 1628 KB Output is correct
113 Execution timed out 2091 ms 1796 KB Time limit exceeded
114 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 2 ms 604 KB Output is correct
20 Correct 1 ms 604 KB Output is correct
21 Correct 3 ms 1884 KB Output is correct
22 Correct 4 ms 604 KB Output is correct
23 Correct 2 ms 604 KB Output is correct
24 Correct 3 ms 980 KB Output is correct
25 Correct 2 ms 604 KB Output is correct
26 Correct 4 ms 956 KB Output is correct
27 Correct 4 ms 860 KB Output is correct
28 Correct 2 ms 776 KB Output is correct
29 Correct 6 ms 1380 KB Output is correct
30 Correct 3 ms 820 KB Output is correct
31 Correct 7 ms 3932 KB Output is correct
32 Correct 9 ms 1372 KB Output is correct
33 Correct 5 ms 1288 KB Output is correct
34 Correct 5 ms 1364 KB Output is correct
35 Correct 4 ms 1116 KB Output is correct
36 Correct 9 ms 1552 KB Output is correct
37 Correct 8 ms 1444 KB Output is correct
38 Correct 5 ms 1372 KB Output is correct
39 Correct 64 ms 9448 KB Output is correct
40 Correct 11 ms 1460 KB Output is correct
41 Correct 7 ms 1372 KB Output is correct
42 Correct 9 ms 1624 KB Output is correct
43 Correct 10 ms 1884 KB Output is correct
44 Correct 38 ms 4844 KB Output is correct
45 Correct 33 ms 4956 KB Output is correct
46 Correct 76 ms 36372 KB Output is correct
47 Correct 100 ms 9556 KB Output is correct
48 Correct 51 ms 9304 KB Output is correct
49 Correct 39 ms 9204 KB Output is correct
50 Correct 36 ms 9052 KB Output is correct
51 Correct 86 ms 10008 KB Output is correct
52 Correct 94 ms 9600 KB Output is correct
53 Correct 55 ms 9304 KB Output is correct
54 Correct 0 ms 344 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 0 ms 352 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 0 ms 348 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 0 ms 344 KB Output is correct
61 Correct 0 ms 348 KB Output is correct
62 Correct 1 ms 348 KB Output is correct
63 Correct 0 ms 348 KB Output is correct
64 Correct 0 ms 348 KB Output is correct
65 Correct 4 ms 472 KB Output is correct
66 Correct 4 ms 348 KB Output is correct
67 Correct 4 ms 348 KB Output is correct
68 Correct 0 ms 348 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 0 ms 348 KB Output is correct
71 Correct 0 ms 600 KB Output is correct
72 Correct 0 ms 348 KB Output is correct
73 Correct 0 ms 348 KB Output is correct
74 Correct 0 ms 348 KB Output is correct
75 Correct 0 ms 348 KB Output is correct
76 Correct 0 ms 348 KB Output is correct
77 Correct 1 ms 348 KB Output is correct
78 Correct 0 ms 348 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 0 ms 348 KB Output is correct
81 Correct 0 ms 348 KB Output is correct
82 Correct 0 ms 600 KB Output is correct
83 Correct 0 ms 348 KB Output is correct
84 Correct 0 ms 348 KB Output is correct
85 Correct 0 ms 348 KB Output is correct
86 Correct 0 ms 348 KB Output is correct
87 Correct 0 ms 348 KB Output is correct
88 Correct 0 ms 348 KB Output is correct
89 Correct 0 ms 348 KB Output is correct
90 Correct 0 ms 344 KB Output is correct
91 Correct 0 ms 348 KB Output is correct
92 Correct 0 ms 348 KB Output is correct
93 Correct 1 ms 348 KB Output is correct
94 Correct 4 ms 348 KB Output is correct
95 Correct 5 ms 472 KB Output is correct
96 Correct 5 ms 348 KB Output is correct
97 Correct 0 ms 348 KB Output is correct
98 Correct 0 ms 348 KB Output is correct
99 Correct 0 ms 348 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 0 ms 344 KB Output is correct
102 Correct 0 ms 348 KB Output is correct
103 Correct 1 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 0 ms 348 KB Output is correct
108 Correct 0 ms 348 KB Output is correct
109 Correct 5 ms 348 KB Output is correct
110 Correct 5 ms 600 KB Output is correct
111 Correct 12 ms 1372 KB Output is correct
112 Correct 3 ms 1628 KB Output is correct
113 Execution timed out 2091 ms 1796 KB Time limit exceeded
114 Halted 0 ms 0 KB -