Submission #833004

# Submission time Handle Problem Language Result Execution time Memory
833004 2023-08-21T18:57:37 Z WLZ Maze (JOI23_ho_t3) C++17
86 / 100
2000 ms 39916 KB
#include <bits/stdc++.h>
using namespace std;

#ifdef DEBUG
#include "templates/debug.h"
#else
#define debug(...) 0
#endif


const vector<int> dx = {1, -1, 0, 0, 1, 1, -1, -1};
const vector<int> dy = {0, 0, 1, -1, -1, 1, -1, 1};

const int INF = 0x3f3f3f3f;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int r, c, n; cin >> r >> c >> n;
  int sr, sc, gr, gc; cin >> sr >> sc >> gr >> gc;
  sr--; sc--; gr--; gc--;
  vector<string> grid(r);
  for (int i = 0; i < r; i++) cin >> grid[i];
  vector< vector<int> > dist(r, vector<int>(c, INF)); dist[sr][sc] = 0;
  priority_queue< tuple<int, int, int>, vector< tuple<int, int, int> >, greater<> > pq; pq.push({0, sr, sc});
  queue< pair<int, int> > q, q2;
  while (!q.empty() || !q2.empty() || !pq.empty()) {
    int d, x, y;
    if (q.empty()) swap(q, q2);
    if (q.empty()) tie(d, x, y) = pq.top(), pq.pop();
    else {
      tie(x, y) = q.front(); q.pop();
      d = dist[x][y];
    }
    if (d > dist[x][y]) continue;
    for (int k = 0; k < 8; k++) {
      int nx = x + dx[k], ny = y + dy[k];
      if (nx < 0 || nx >= r || ny < 0 || ny >= c) continue;
      if (0 < d % (n + 1) && d % (n + 1) < n && d + 1 < dist[nx][ny]) {
        dist[nx][ny] = d + 1;
        q2.push({nx, ny});
      }
      if (k >= 4) continue;
      if (d % (n + 1) == 0 && d + 1 < dist[nx][ny]) {
        dist[nx][ny] = d + 1;
        q2.push({nx, ny});
      }
      if (d % (n + 1) == n && d + 2 < dist[nx][ny]) {
        dist[nx][ny] = d + 2;
        pq.push({dist[nx][ny], nx, ny});
      }
      if (grid[nx][ny] == '.' && (d + n) / (n + 1) * (n + 1) < dist[nx][ny]) {
        dist[nx][ny] = (d + n) / (n + 1) * (n + 1);
        if (d % (n + 1) == 0) q.push({nx, ny});
        else pq.push({dist[nx][ny], nx, ny});
      }
    }
  }
  debug(dist);
  cout << (dist[gr][gc] + n) / (n + 1) << '\n';
  return 0;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:7:20: warning: statement has no effect [-Wunused-value]
    7 | #define debug(...) 0
      |                    ^
Main.cpp:59:3: note: in expansion of macro 'debug'
   59 |   debug(dist);
      |   ^~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 10 ms 644 KB Output is correct
20 Correct 2 ms 724 KB Output is correct
21 Correct 9 ms 1136 KB Output is correct
22 Correct 11 ms 680 KB Output is correct
23 Correct 8 ms 596 KB Output is correct
24 Correct 6 ms 852 KB Output is correct
25 Correct 3 ms 852 KB Output is correct
26 Correct 11 ms 852 KB Output is correct
27 Correct 13 ms 724 KB Output is correct
28 Correct 9 ms 688 KB Output is correct
29 Correct 21 ms 1120 KB Output is correct
30 Correct 7 ms 724 KB Output is correct
31 Correct 24 ms 2308 KB Output is correct
32 Correct 26 ms 1180 KB Output is correct
33 Correct 21 ms 980 KB Output is correct
34 Correct 14 ms 1760 KB Output is correct
35 Correct 7 ms 1760 KB Output is correct
36 Correct 26 ms 1460 KB Output is correct
37 Correct 27 ms 1284 KB Output is correct
38 Correct 23 ms 1108 KB Output is correct
39 Correct 233 ms 7880 KB Output is correct
40 Correct 31 ms 1236 KB Output is correct
41 Correct 18 ms 2016 KB Output is correct
42 Correct 33 ms 1364 KB Output is correct
43 Correct 22 ms 2132 KB Output is correct
44 Correct 117 ms 4696 KB Output is correct
45 Correct 87 ms 4976 KB Output is correct
46 Correct 233 ms 20132 KB Output is correct
47 Correct 269 ms 8116 KB Output is correct
48 Correct 221 ms 7856 KB Output is correct
49 Correct 133 ms 13560 KB Output is correct
50 Correct 70 ms 13560 KB Output is correct
51 Correct 276 ms 8916 KB Output is correct
52 Correct 278 ms 8516 KB Output is correct
53 Correct 239 ms 8072 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 1 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 6 ms 540 KB Output is correct
26 Correct 8 ms 980 KB Output is correct
27 Correct 10 ms 1108 KB Output is correct
28 Correct 9 ms 1108 KB Output is correct
29 Correct 4 ms 596 KB Output is correct
30 Correct 3 ms 596 KB Output is correct
31 Correct 17 ms 596 KB Output is correct
32 Correct 10 ms 852 KB Output is correct
33 Correct 11 ms 724 KB Output is correct
34 Correct 16 ms 1876 KB Output is correct
35 Correct 23 ms 2200 KB Output is correct
36 Correct 23 ms 2244 KB Output is correct
37 Correct 10 ms 1096 KB Output is correct
38 Correct 6 ms 1100 KB Output is correct
39 Correct 57 ms 5948 KB Output is correct
40 Correct 172 ms 17036 KB Output is correct
41 Correct 231 ms 20144 KB Output is correct
42 Correct 237 ms 20120 KB Output is correct
43 Correct 105 ms 7852 KB Output is correct
44 Correct 62 ms 7852 KB Output is correct
45 Correct 192 ms 19240 KB Output is correct
46 Correct 186 ms 19488 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 1 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 9 ms 596 KB Output is correct
34 Correct 1 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 7 ms 468 KB Output is correct
37 Correct 2 ms 724 KB Output is correct
38 Correct 8 ms 980 KB Output is correct
39 Correct 9 ms 1108 KB Output is correct
40 Correct 12 ms 684 KB Output is correct
41 Correct 10 ms 596 KB Output is correct
42 Correct 10 ms 1080 KB Output is correct
43 Correct 4 ms 596 KB Output is correct
44 Correct 3 ms 596 KB Output is correct
45 Correct 6 ms 852 KB Output is correct
46 Correct 3 ms 852 KB Output is correct
47 Correct 5 ms 724 KB Output is correct
48 Correct 9 ms 596 KB Output is correct
49 Correct 11 ms 596 KB Output is correct
50 Correct 14 ms 596 KB Output is correct
51 Correct 17 ms 648 KB Output is correct
52 Correct 10 ms 852 KB Output is correct
53 Correct 11 ms 748 KB Output is correct
54 Correct 10 ms 596 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 0 ms 212 KB Output is correct
26 Correct 0 ms 212 KB Output is correct
27 Correct 0 ms 212 KB Output is correct
28 Correct 1 ms 212 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 1 ms 212 KB Output is correct
32 Correct 1 ms 212 KB Output is correct
33 Correct 9 ms 596 KB Output is correct
34 Correct 1 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 7 ms 468 KB Output is correct
37 Correct 2 ms 724 KB Output is correct
38 Correct 8 ms 980 KB Output is correct
39 Correct 9 ms 1108 KB Output is correct
40 Correct 12 ms 684 KB Output is correct
41 Correct 10 ms 596 KB Output is correct
42 Correct 10 ms 1080 KB Output is correct
43 Correct 4 ms 596 KB Output is correct
44 Correct 3 ms 596 KB Output is correct
45 Correct 6 ms 852 KB Output is correct
46 Correct 3 ms 852 KB Output is correct
47 Correct 5 ms 724 KB Output is correct
48 Correct 9 ms 596 KB Output is correct
49 Correct 11 ms 596 KB Output is correct
50 Correct 14 ms 596 KB Output is correct
51 Correct 17 ms 648 KB Output is correct
52 Correct 10 ms 852 KB Output is correct
53 Correct 11 ms 748 KB Output is correct
54 Correct 10 ms 596 KB Output is correct
55 Correct 22 ms 1112 KB Output is correct
56 Correct 7 ms 724 KB Output is correct
57 Correct 16 ms 1924 KB Output is correct
58 Correct 20 ms 1076 KB Output is correct
59 Correct 23 ms 2312 KB Output is correct
60 Correct 26 ms 1184 KB Output is correct
61 Correct 21 ms 1112 KB Output is correct
62 Correct 24 ms 2316 KB Output is correct
63 Correct 12 ms 1100 KB Output is correct
64 Correct 7 ms 1108 KB Output is correct
65 Correct 14 ms 1760 KB Output is correct
66 Correct 5 ms 1760 KB Output is correct
67 Correct 13 ms 1364 KB Output is correct
68 Correct 25 ms 1108 KB Output is correct
69 Correct 37 ms 980 KB Output is correct
70 Correct 50 ms 980 KB Output is correct
71 Correct 52 ms 1124 KB Output is correct
72 Correct 26 ms 1464 KB Output is correct
73 Correct 27 ms 1280 KB Output is correct
74 Correct 23 ms 1108 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 10 ms 644 KB Output is correct
20 Correct 2 ms 724 KB Output is correct
21 Correct 9 ms 1136 KB Output is correct
22 Correct 11 ms 680 KB Output is correct
23 Correct 8 ms 596 KB Output is correct
24 Correct 6 ms 852 KB Output is correct
25 Correct 3 ms 852 KB Output is correct
26 Correct 11 ms 852 KB Output is correct
27 Correct 13 ms 724 KB Output is correct
28 Correct 9 ms 688 KB Output is correct
29 Correct 21 ms 1120 KB Output is correct
30 Correct 7 ms 724 KB Output is correct
31 Correct 24 ms 2308 KB Output is correct
32 Correct 26 ms 1180 KB Output is correct
33 Correct 21 ms 980 KB Output is correct
34 Correct 14 ms 1760 KB Output is correct
35 Correct 7 ms 1760 KB Output is correct
36 Correct 26 ms 1460 KB Output is correct
37 Correct 27 ms 1284 KB Output is correct
38 Correct 23 ms 1108 KB Output is correct
39 Correct 233 ms 7880 KB Output is correct
40 Correct 31 ms 1236 KB Output is correct
41 Correct 18 ms 2016 KB Output is correct
42 Correct 33 ms 1364 KB Output is correct
43 Correct 22 ms 2132 KB Output is correct
44 Correct 117 ms 4696 KB Output is correct
45 Correct 87 ms 4976 KB Output is correct
46 Correct 233 ms 20132 KB Output is correct
47 Correct 269 ms 8116 KB Output is correct
48 Correct 221 ms 7856 KB Output is correct
49 Correct 133 ms 13560 KB Output is correct
50 Correct 70 ms 13560 KB Output is correct
51 Correct 276 ms 8916 KB Output is correct
52 Correct 278 ms 8516 KB Output is correct
53 Correct 239 ms 8072 KB Output is correct
54 Correct 0 ms 212 KB Output is correct
55 Correct 0 ms 212 KB Output is correct
56 Correct 0 ms 212 KB Output is correct
57 Correct 0 ms 212 KB Output is correct
58 Correct 0 ms 212 KB Output is correct
59 Correct 0 ms 212 KB Output is correct
60 Correct 0 ms 212 KB Output is correct
61 Correct 0 ms 212 KB Output is correct
62 Correct 1 ms 212 KB Output is correct
63 Correct 0 ms 212 KB Output is correct
64 Correct 1 ms 212 KB Output is correct
65 Correct 0 ms 212 KB Output is correct
66 Correct 0 ms 212 KB Output is correct
67 Correct 0 ms 212 KB Output is correct
68 Correct 1 ms 212 KB Output is correct
69 Correct 1 ms 212 KB Output is correct
70 Correct 0 ms 212 KB Output is correct
71 Correct 0 ms 212 KB Output is correct
72 Correct 0 ms 212 KB Output is correct
73 Correct 0 ms 212 KB Output is correct
74 Correct 0 ms 212 KB Output is correct
75 Correct 0 ms 212 KB Output is correct
76 Correct 0 ms 212 KB Output is correct
77 Correct 1 ms 212 KB Output is correct
78 Correct 0 ms 212 KB Output is correct
79 Correct 0 ms 212 KB Output is correct
80 Correct 0 ms 212 KB Output is correct
81 Correct 1 ms 212 KB Output is correct
82 Correct 1 ms 212 KB Output is correct
83 Correct 1 ms 212 KB Output is correct
84 Correct 1 ms 212 KB Output is correct
85 Correct 1 ms 212 KB Output is correct
86 Correct 1 ms 212 KB Output is correct
87 Correct 0 ms 212 KB Output is correct
88 Correct 0 ms 212 KB Output is correct
89 Correct 0 ms 212 KB Output is correct
90 Correct 0 ms 212 KB Output is correct
91 Correct 0 ms 212 KB Output is correct
92 Correct 1 ms 212 KB Output is correct
93 Correct 0 ms 212 KB Output is correct
94 Correct 0 ms 212 KB Output is correct
95 Correct 0 ms 212 KB Output is correct
96 Correct 0 ms 212 KB Output is correct
97 Correct 0 ms 212 KB Output is correct
98 Correct 0 ms 212 KB Output is correct
99 Correct 0 ms 212 KB Output is correct
100 Correct 0 ms 212 KB Output is correct
101 Correct 0 ms 212 KB Output is correct
102 Correct 0 ms 212 KB Output is correct
103 Correct 1 ms 212 KB Output is correct
104 Correct 0 ms 212 KB Output is correct
105 Correct 0 ms 212 KB Output is correct
106 Correct 1 ms 212 KB Output is correct
107 Correct 0 ms 212 KB Output is correct
108 Correct 0 ms 212 KB Output is correct
109 Correct 1 ms 340 KB Output is correct
110 Correct 6 ms 540 KB Output is correct
111 Correct 8 ms 980 KB Output is correct
112 Correct 10 ms 1108 KB Output is correct
113 Correct 9 ms 1108 KB Output is correct
114 Correct 4 ms 596 KB Output is correct
115 Correct 3 ms 596 KB Output is correct
116 Correct 17 ms 596 KB Output is correct
117 Correct 10 ms 852 KB Output is correct
118 Correct 11 ms 724 KB Output is correct
119 Correct 16 ms 1876 KB Output is correct
120 Correct 23 ms 2200 KB Output is correct
121 Correct 23 ms 2244 KB Output is correct
122 Correct 10 ms 1096 KB Output is correct
123 Correct 6 ms 1100 KB Output is correct
124 Correct 57 ms 5948 KB Output is correct
125 Correct 172 ms 17036 KB Output is correct
126 Correct 231 ms 20144 KB Output is correct
127 Correct 237 ms 20120 KB Output is correct
128 Correct 105 ms 7852 KB Output is correct
129 Correct 62 ms 7852 KB Output is correct
130 Correct 192 ms 19240 KB Output is correct
131 Correct 186 ms 19488 KB Output is correct
132 Correct 9 ms 596 KB Output is correct
133 Correct 1 ms 340 KB Output is correct
134 Correct 1 ms 340 KB Output is correct
135 Correct 7 ms 468 KB Output is correct
136 Correct 2 ms 724 KB Output is correct
137 Correct 8 ms 980 KB Output is correct
138 Correct 9 ms 1108 KB Output is correct
139 Correct 12 ms 684 KB Output is correct
140 Correct 10 ms 596 KB Output is correct
141 Correct 10 ms 1080 KB Output is correct
142 Correct 4 ms 596 KB Output is correct
143 Correct 3 ms 596 KB Output is correct
144 Correct 6 ms 852 KB Output is correct
145 Correct 3 ms 852 KB Output is correct
146 Correct 5 ms 724 KB Output is correct
147 Correct 9 ms 596 KB Output is correct
148 Correct 11 ms 596 KB Output is correct
149 Correct 14 ms 596 KB Output is correct
150 Correct 17 ms 648 KB Output is correct
151 Correct 10 ms 852 KB Output is correct
152 Correct 11 ms 748 KB Output is correct
153 Correct 10 ms 596 KB Output is correct
154 Correct 22 ms 1112 KB Output is correct
155 Correct 7 ms 724 KB Output is correct
156 Correct 16 ms 1924 KB Output is correct
157 Correct 20 ms 1076 KB Output is correct
158 Correct 23 ms 2312 KB Output is correct
159 Correct 26 ms 1184 KB Output is correct
160 Correct 21 ms 1112 KB Output is correct
161 Correct 24 ms 2316 KB Output is correct
162 Correct 12 ms 1100 KB Output is correct
163 Correct 7 ms 1108 KB Output is correct
164 Correct 14 ms 1760 KB Output is correct
165 Correct 5 ms 1760 KB Output is correct
166 Correct 13 ms 1364 KB Output is correct
167 Correct 25 ms 1108 KB Output is correct
168 Correct 37 ms 980 KB Output is correct
169 Correct 50 ms 980 KB Output is correct
170 Correct 52 ms 1124 KB Output is correct
171 Correct 26 ms 1464 KB Output is correct
172 Correct 27 ms 1280 KB Output is correct
173 Correct 23 ms 1108 KB Output is correct
174 Correct 30 ms 1364 KB Output is correct
175 Correct 74 ms 2064 KB Output is correct
176 Correct 80 ms 5112 KB Output is correct
177 Correct 155 ms 5588 KB Output is correct
178 Correct 286 ms 7124 KB Output is correct
179 Correct 378 ms 8020 KB Output is correct
180 Correct 505 ms 8020 KB Output is correct
181 Correct 709 ms 8100 KB Output is correct
182 Correct 971 ms 8080 KB Output is correct
183 Correct 189 ms 9432 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 10 ms 644 KB Output is correct
20 Correct 2 ms 724 KB Output is correct
21 Correct 9 ms 1136 KB Output is correct
22 Correct 11 ms 680 KB Output is correct
23 Correct 8 ms 596 KB Output is correct
24 Correct 6 ms 852 KB Output is correct
25 Correct 3 ms 852 KB Output is correct
26 Correct 11 ms 852 KB Output is correct
27 Correct 13 ms 724 KB Output is correct
28 Correct 9 ms 688 KB Output is correct
29 Correct 21 ms 1120 KB Output is correct
30 Correct 7 ms 724 KB Output is correct
31 Correct 24 ms 2308 KB Output is correct
32 Correct 26 ms 1180 KB Output is correct
33 Correct 21 ms 980 KB Output is correct
34 Correct 14 ms 1760 KB Output is correct
35 Correct 7 ms 1760 KB Output is correct
36 Correct 26 ms 1460 KB Output is correct
37 Correct 27 ms 1284 KB Output is correct
38 Correct 23 ms 1108 KB Output is correct
39 Correct 233 ms 7880 KB Output is correct
40 Correct 31 ms 1236 KB Output is correct
41 Correct 18 ms 2016 KB Output is correct
42 Correct 33 ms 1364 KB Output is correct
43 Correct 22 ms 2132 KB Output is correct
44 Correct 117 ms 4696 KB Output is correct
45 Correct 87 ms 4976 KB Output is correct
46 Correct 233 ms 20132 KB Output is correct
47 Correct 269 ms 8116 KB Output is correct
48 Correct 221 ms 7856 KB Output is correct
49 Correct 133 ms 13560 KB Output is correct
50 Correct 70 ms 13560 KB Output is correct
51 Correct 276 ms 8916 KB Output is correct
52 Correct 278 ms 8516 KB Output is correct
53 Correct 239 ms 8072 KB Output is correct
54 Correct 0 ms 212 KB Output is correct
55 Correct 0 ms 212 KB Output is correct
56 Correct 0 ms 212 KB Output is correct
57 Correct 0 ms 212 KB Output is correct
58 Correct 0 ms 212 KB Output is correct
59 Correct 0 ms 212 KB Output is correct
60 Correct 0 ms 212 KB Output is correct
61 Correct 0 ms 212 KB Output is correct
62 Correct 1 ms 212 KB Output is correct
63 Correct 0 ms 212 KB Output is correct
64 Correct 1 ms 212 KB Output is correct
65 Correct 0 ms 212 KB Output is correct
66 Correct 0 ms 212 KB Output is correct
67 Correct 0 ms 212 KB Output is correct
68 Correct 1 ms 212 KB Output is correct
69 Correct 1 ms 212 KB Output is correct
70 Correct 0 ms 212 KB Output is correct
71 Correct 0 ms 212 KB Output is correct
72 Correct 0 ms 212 KB Output is correct
73 Correct 0 ms 212 KB Output is correct
74 Correct 0 ms 212 KB Output is correct
75 Correct 0 ms 212 KB Output is correct
76 Correct 0 ms 212 KB Output is correct
77 Correct 1 ms 212 KB Output is correct
78 Correct 0 ms 212 KB Output is correct
79 Correct 0 ms 212 KB Output is correct
80 Correct 0 ms 212 KB Output is correct
81 Correct 1 ms 212 KB Output is correct
82 Correct 1 ms 212 KB Output is correct
83 Correct 1 ms 212 KB Output is correct
84 Correct 1 ms 212 KB Output is correct
85 Correct 1 ms 212 KB Output is correct
86 Correct 1 ms 212 KB Output is correct
87 Correct 0 ms 212 KB Output is correct
88 Correct 0 ms 212 KB Output is correct
89 Correct 0 ms 212 KB Output is correct
90 Correct 0 ms 212 KB Output is correct
91 Correct 0 ms 212 KB Output is correct
92 Correct 1 ms 212 KB Output is correct
93 Correct 0 ms 212 KB Output is correct
94 Correct 0 ms 212 KB Output is correct
95 Correct 0 ms 212 KB Output is correct
96 Correct 0 ms 212 KB Output is correct
97 Correct 0 ms 212 KB Output is correct
98 Correct 0 ms 212 KB Output is correct
99 Correct 0 ms 212 KB Output is correct
100 Correct 0 ms 212 KB Output is correct
101 Correct 0 ms 212 KB Output is correct
102 Correct 0 ms 212 KB Output is correct
103 Correct 1 ms 212 KB Output is correct
104 Correct 0 ms 212 KB Output is correct
105 Correct 0 ms 212 KB Output is correct
106 Correct 1 ms 212 KB Output is correct
107 Correct 0 ms 212 KB Output is correct
108 Correct 0 ms 212 KB Output is correct
109 Correct 1 ms 340 KB Output is correct
110 Correct 6 ms 540 KB Output is correct
111 Correct 8 ms 980 KB Output is correct
112 Correct 10 ms 1108 KB Output is correct
113 Correct 9 ms 1108 KB Output is correct
114 Correct 4 ms 596 KB Output is correct
115 Correct 3 ms 596 KB Output is correct
116 Correct 17 ms 596 KB Output is correct
117 Correct 10 ms 852 KB Output is correct
118 Correct 11 ms 724 KB Output is correct
119 Correct 16 ms 1876 KB Output is correct
120 Correct 23 ms 2200 KB Output is correct
121 Correct 23 ms 2244 KB Output is correct
122 Correct 10 ms 1096 KB Output is correct
123 Correct 6 ms 1100 KB Output is correct
124 Correct 57 ms 5948 KB Output is correct
125 Correct 172 ms 17036 KB Output is correct
126 Correct 231 ms 20144 KB Output is correct
127 Correct 237 ms 20120 KB Output is correct
128 Correct 105 ms 7852 KB Output is correct
129 Correct 62 ms 7852 KB Output is correct
130 Correct 192 ms 19240 KB Output is correct
131 Correct 186 ms 19488 KB Output is correct
132 Correct 9 ms 596 KB Output is correct
133 Correct 1 ms 340 KB Output is correct
134 Correct 1 ms 340 KB Output is correct
135 Correct 7 ms 468 KB Output is correct
136 Correct 2 ms 724 KB Output is correct
137 Correct 8 ms 980 KB Output is correct
138 Correct 9 ms 1108 KB Output is correct
139 Correct 12 ms 684 KB Output is correct
140 Correct 10 ms 596 KB Output is correct
141 Correct 10 ms 1080 KB Output is correct
142 Correct 4 ms 596 KB Output is correct
143 Correct 3 ms 596 KB Output is correct
144 Correct 6 ms 852 KB Output is correct
145 Correct 3 ms 852 KB Output is correct
146 Correct 5 ms 724 KB Output is correct
147 Correct 9 ms 596 KB Output is correct
148 Correct 11 ms 596 KB Output is correct
149 Correct 14 ms 596 KB Output is correct
150 Correct 17 ms 648 KB Output is correct
151 Correct 10 ms 852 KB Output is correct
152 Correct 11 ms 748 KB Output is correct
153 Correct 10 ms 596 KB Output is correct
154 Correct 22 ms 1112 KB Output is correct
155 Correct 7 ms 724 KB Output is correct
156 Correct 16 ms 1924 KB Output is correct
157 Correct 20 ms 1076 KB Output is correct
158 Correct 23 ms 2312 KB Output is correct
159 Correct 26 ms 1184 KB Output is correct
160 Correct 21 ms 1112 KB Output is correct
161 Correct 24 ms 2316 KB Output is correct
162 Correct 12 ms 1100 KB Output is correct
163 Correct 7 ms 1108 KB Output is correct
164 Correct 14 ms 1760 KB Output is correct
165 Correct 5 ms 1760 KB Output is correct
166 Correct 13 ms 1364 KB Output is correct
167 Correct 25 ms 1108 KB Output is correct
168 Correct 37 ms 980 KB Output is correct
169 Correct 50 ms 980 KB Output is correct
170 Correct 52 ms 1124 KB Output is correct
171 Correct 26 ms 1464 KB Output is correct
172 Correct 27 ms 1280 KB Output is correct
173 Correct 23 ms 1108 KB Output is correct
174 Correct 30 ms 1364 KB Output is correct
175 Correct 74 ms 2064 KB Output is correct
176 Correct 80 ms 5112 KB Output is correct
177 Correct 155 ms 5588 KB Output is correct
178 Correct 286 ms 7124 KB Output is correct
179 Correct 378 ms 8020 KB Output is correct
180 Correct 505 ms 8020 KB Output is correct
181 Correct 709 ms 8100 KB Output is correct
182 Correct 971 ms 8080 KB Output is correct
183 Correct 189 ms 9432 KB Output is correct
184 Correct 496 ms 15408 KB Output is correct
185 Correct 333 ms 8916 KB Output is correct
186 Correct 230 ms 23088 KB Output is correct
187 Correct 1248 ms 12624 KB Output is correct
188 Correct 466 ms 39916 KB Output is correct
189 Correct 555 ms 15612 KB Output is correct
190 Correct 465 ms 15392 KB Output is correct
191 Correct 490 ms 39808 KB Output is correct
192 Correct 198 ms 15480 KB Output is correct
193 Correct 135 ms 15344 KB Output is correct
194 Correct 276 ms 26880 KB Output is correct
195 Correct 124 ms 26792 KB Output is correct
196 Correct 894 ms 15700 KB Output is correct
197 Correct 1204 ms 15700 KB Output is correct
198 Correct 1635 ms 15640 KB Output is correct
199 Execution timed out 2061 ms 15748 KB Time limit exceeded
200 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 10 ms 644 KB Output is correct
20 Correct 2 ms 724 KB Output is correct
21 Correct 9 ms 1136 KB Output is correct
22 Correct 11 ms 680 KB Output is correct
23 Correct 8 ms 596 KB Output is correct
24 Correct 6 ms 852 KB Output is correct
25 Correct 3 ms 852 KB Output is correct
26 Correct 11 ms 852 KB Output is correct
27 Correct 13 ms 724 KB Output is correct
28 Correct 9 ms 688 KB Output is correct
29 Correct 21 ms 1120 KB Output is correct
30 Correct 7 ms 724 KB Output is correct
31 Correct 24 ms 2308 KB Output is correct
32 Correct 26 ms 1180 KB Output is correct
33 Correct 21 ms 980 KB Output is correct
34 Correct 14 ms 1760 KB Output is correct
35 Correct 7 ms 1760 KB Output is correct
36 Correct 26 ms 1460 KB Output is correct
37 Correct 27 ms 1284 KB Output is correct
38 Correct 23 ms 1108 KB Output is correct
39 Correct 233 ms 7880 KB Output is correct
40 Correct 31 ms 1236 KB Output is correct
41 Correct 18 ms 2016 KB Output is correct
42 Correct 33 ms 1364 KB Output is correct
43 Correct 22 ms 2132 KB Output is correct
44 Correct 117 ms 4696 KB Output is correct
45 Correct 87 ms 4976 KB Output is correct
46 Correct 233 ms 20132 KB Output is correct
47 Correct 269 ms 8116 KB Output is correct
48 Correct 221 ms 7856 KB Output is correct
49 Correct 133 ms 13560 KB Output is correct
50 Correct 70 ms 13560 KB Output is correct
51 Correct 276 ms 8916 KB Output is correct
52 Correct 278 ms 8516 KB Output is correct
53 Correct 239 ms 8072 KB Output is correct
54 Correct 0 ms 212 KB Output is correct
55 Correct 0 ms 212 KB Output is correct
56 Correct 0 ms 212 KB Output is correct
57 Correct 0 ms 212 KB Output is correct
58 Correct 0 ms 212 KB Output is correct
59 Correct 0 ms 212 KB Output is correct
60 Correct 0 ms 212 KB Output is correct
61 Correct 0 ms 212 KB Output is correct
62 Correct 1 ms 212 KB Output is correct
63 Correct 0 ms 212 KB Output is correct
64 Correct 1 ms 212 KB Output is correct
65 Correct 0 ms 212 KB Output is correct
66 Correct 0 ms 212 KB Output is correct
67 Correct 0 ms 212 KB Output is correct
68 Correct 1 ms 212 KB Output is correct
69 Correct 1 ms 212 KB Output is correct
70 Correct 0 ms 212 KB Output is correct
71 Correct 0 ms 212 KB Output is correct
72 Correct 0 ms 212 KB Output is correct
73 Correct 0 ms 212 KB Output is correct
74 Correct 0 ms 212 KB Output is correct
75 Correct 0 ms 212 KB Output is correct
76 Correct 0 ms 212 KB Output is correct
77 Correct 1 ms 212 KB Output is correct
78 Correct 0 ms 212 KB Output is correct
79 Correct 0 ms 212 KB Output is correct
80 Correct 0 ms 212 KB Output is correct
81 Correct 1 ms 212 KB Output is correct
82 Correct 1 ms 212 KB Output is correct
83 Correct 1 ms 212 KB Output is correct
84 Correct 1 ms 212 KB Output is correct
85 Correct 1 ms 212 KB Output is correct
86 Correct 1 ms 212 KB Output is correct
87 Correct 0 ms 212 KB Output is correct
88 Correct 0 ms 212 KB Output is correct
89 Correct 0 ms 212 KB Output is correct
90 Correct 0 ms 212 KB Output is correct
91 Correct 0 ms 212 KB Output is correct
92 Correct 1 ms 212 KB Output is correct
93 Correct 0 ms 212 KB Output is correct
94 Correct 0 ms 212 KB Output is correct
95 Correct 0 ms 212 KB Output is correct
96 Correct 0 ms 212 KB Output is correct
97 Correct 0 ms 212 KB Output is correct
98 Correct 0 ms 212 KB Output is correct
99 Correct 0 ms 212 KB Output is correct
100 Correct 0 ms 212 KB Output is correct
101 Correct 0 ms 212 KB Output is correct
102 Correct 0 ms 212 KB Output is correct
103 Correct 1 ms 212 KB Output is correct
104 Correct 0 ms 212 KB Output is correct
105 Correct 0 ms 212 KB Output is correct
106 Correct 1 ms 212 KB Output is correct
107 Correct 0 ms 212 KB Output is correct
108 Correct 0 ms 212 KB Output is correct
109 Correct 1 ms 340 KB Output is correct
110 Correct 6 ms 540 KB Output is correct
111 Correct 8 ms 980 KB Output is correct
112 Correct 10 ms 1108 KB Output is correct
113 Correct 9 ms 1108 KB Output is correct
114 Correct 4 ms 596 KB Output is correct
115 Correct 3 ms 596 KB Output is correct
116 Correct 17 ms 596 KB Output is correct
117 Correct 10 ms 852 KB Output is correct
118 Correct 11 ms 724 KB Output is correct
119 Correct 16 ms 1876 KB Output is correct
120 Correct 23 ms 2200 KB Output is correct
121 Correct 23 ms 2244 KB Output is correct
122 Correct 10 ms 1096 KB Output is correct
123 Correct 6 ms 1100 KB Output is correct
124 Correct 57 ms 5948 KB Output is correct
125 Correct 172 ms 17036 KB Output is correct
126 Correct 231 ms 20144 KB Output is correct
127 Correct 237 ms 20120 KB Output is correct
128 Correct 105 ms 7852 KB Output is correct
129 Correct 62 ms 7852 KB Output is correct
130 Correct 192 ms 19240 KB Output is correct
131 Correct 186 ms 19488 KB Output is correct
132 Correct 9 ms 596 KB Output is correct
133 Correct 1 ms 340 KB Output is correct
134 Correct 1 ms 340 KB Output is correct
135 Correct 7 ms 468 KB Output is correct
136 Correct 2 ms 724 KB Output is correct
137 Correct 8 ms 980 KB Output is correct
138 Correct 9 ms 1108 KB Output is correct
139 Correct 12 ms 684 KB Output is correct
140 Correct 10 ms 596 KB Output is correct
141 Correct 10 ms 1080 KB Output is correct
142 Correct 4 ms 596 KB Output is correct
143 Correct 3 ms 596 KB Output is correct
144 Correct 6 ms 852 KB Output is correct
145 Correct 3 ms 852 KB Output is correct
146 Correct 5 ms 724 KB Output is correct
147 Correct 9 ms 596 KB Output is correct
148 Correct 11 ms 596 KB Output is correct
149 Correct 14 ms 596 KB Output is correct
150 Correct 17 ms 648 KB Output is correct
151 Correct 10 ms 852 KB Output is correct
152 Correct 11 ms 748 KB Output is correct
153 Correct 10 ms 596 KB Output is correct
154 Correct 22 ms 1112 KB Output is correct
155 Correct 7 ms 724 KB Output is correct
156 Correct 16 ms 1924 KB Output is correct
157 Correct 20 ms 1076 KB Output is correct
158 Correct 23 ms 2312 KB Output is correct
159 Correct 26 ms 1184 KB Output is correct
160 Correct 21 ms 1112 KB Output is correct
161 Correct 24 ms 2316 KB Output is correct
162 Correct 12 ms 1100 KB Output is correct
163 Correct 7 ms 1108 KB Output is correct
164 Correct 14 ms 1760 KB Output is correct
165 Correct 5 ms 1760 KB Output is correct
166 Correct 13 ms 1364 KB Output is correct
167 Correct 25 ms 1108 KB Output is correct
168 Correct 37 ms 980 KB Output is correct
169 Correct 50 ms 980 KB Output is correct
170 Correct 52 ms 1124 KB Output is correct
171 Correct 26 ms 1464 KB Output is correct
172 Correct 27 ms 1280 KB Output is correct
173 Correct 23 ms 1108 KB Output is correct
174 Correct 30 ms 1364 KB Output is correct
175 Correct 74 ms 2064 KB Output is correct
176 Correct 80 ms 5112 KB Output is correct
177 Correct 155 ms 5588 KB Output is correct
178 Correct 286 ms 7124 KB Output is correct
179 Correct 378 ms 8020 KB Output is correct
180 Correct 505 ms 8020 KB Output is correct
181 Correct 709 ms 8100 KB Output is correct
182 Correct 971 ms 8080 KB Output is correct
183 Correct 189 ms 9432 KB Output is correct
184 Correct 496 ms 15408 KB Output is correct
185 Correct 333 ms 8916 KB Output is correct
186 Correct 230 ms 23088 KB Output is correct
187 Correct 1248 ms 12624 KB Output is correct
188 Correct 466 ms 39916 KB Output is correct
189 Correct 555 ms 15612 KB Output is correct
190 Correct 465 ms 15392 KB Output is correct
191 Correct 490 ms 39808 KB Output is correct
192 Correct 198 ms 15480 KB Output is correct
193 Correct 135 ms 15344 KB Output is correct
194 Correct 276 ms 26880 KB Output is correct
195 Correct 124 ms 26792 KB Output is correct
196 Correct 894 ms 15700 KB Output is correct
197 Correct 1204 ms 15700 KB Output is correct
198 Correct 1635 ms 15640 KB Output is correct
199 Execution timed out 2061 ms 15748 KB Time limit exceeded
200 Halted 0 ms 0 KB -