답안 #828007

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
828007 2023-08-17T01:16:55 Z null_awe Maze (JOI23_ho_t3) C++14
100 / 100
642 ms 168952 KB
#include <bits/stdc++.h>
using namespace std;
 
#define pii pair<int, int>

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

int main() {
  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
  int r, c, n; cin >> r >> c >> n;
  int sx, sy; cin >> sx >> sy; --sx, --sy;
  int gx, gy; cin >> gx >> gy; --gx, --gy;
  vector<string> arr(r);
  for (int i = 0; i < r; ++i) cin >> arr[i];
  // . = empty
  // # = wall
  vector<vector<bool>> vis(r, vector<bool>(c));
  vis[sx][sy] = true;
  vector<pii> q; q.push_back({sx, sy});
  queue<pii> rq; for (pii _p : q) rq.push(_p);
  while (rq.size()) {
    pii front = rq.front(); rq.pop();
    int xx = front.first, yy = front.second;
    for (int d = 0; d < 4; ++d) {
      int nx = xx + dx[d], ny = yy + dy[d];
      if (nx < 0 || ny < 0 || nx >= r || ny >= c) continue;
      if (arr[nx][ny] == '#' || vis[nx][ny]) continue;
      rq.push({nx, ny});
      q.push_back({nx, ny});
      vis[nx][ny] = true;
    }
  }
  if (vis[gx][gy]) {
    cout << 0 << '\n';
    return 0;
  }
  vector<vector<pii>> dists(r, vector<pii>(c));
  for (int dist = 1;; ++dist) {
    if (!q.size()) break;
    // cout << "here" << endl;
    vector<pii> nq;
    queue<pii> rq; for (pii _p : q) rq.push(_p), dists[_p.first][_p.second] = _p;
    while (rq.size()) {
      pii front = rq.front(); rq.pop();
      int xx = front.first, yy = front.second;
      for (int d = 0; d < 4; ++d) {
        int nx = xx + dx[d], ny = yy + dy[d];
        if (nx < 0 || ny < 0 || nx >= r || ny >= c) continue;
        if (vis[nx][ny] || max(abs(nx - dists[xx][yy].first), abs(ny - dists[xx][yy].second)) > n ||
            abs(nx - dists[xx][yy].first) + abs(ny - dists[xx][yy].second) == 2 * n) continue;
        vis[nx][ny] = true;
        dists[nx][ny] = dists[xx][yy];
        rq.push({nx, ny});
        nq.push_back({nx, ny});
      }
    }
    for (pii _p : nq) rq.push(_p);
    while (rq.size()) {
      pii front = rq.front(); rq.pop();
      int xx = front.first, yy = front.second;
      // cout << xx << ' ' << yy << endl;
      for (int d = 0; d < 4; ++d) {
        int nx = xx + dx[d], ny = yy + dy[d];
        if (nx < 0 || ny < 0 || nx >= r || ny >= c) continue;
        if (arr[nx][ny] == '#' || vis[nx][ny]) continue;
        rq.push({nx, ny});
        nq.push_back({nx, ny});
        vis[nx][ny] = true;
      }
    }
    if (vis[gx][gy]) {
      cout << dist << '\n';
      return 0;
    }
    q = nq;
  }
  return 0;
}
# 결과 실행 시간 메모리 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 340 KB Output is correct
5 Correct 0 ms 340 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 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 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 4 ms 852 KB Output is correct
20 Correct 4 ms 1108 KB Output is correct
21 Correct 2 ms 976 KB Output is correct
22 Correct 5 ms 976 KB Output is correct
23 Correct 4 ms 928 KB Output is correct
24 Correct 3 ms 1364 KB Output is correct
25 Correct 4 ms 1364 KB Output is correct
26 Correct 1 ms 980 KB Output is correct
27 Correct 1 ms 852 KB Output is correct
28 Correct 2 ms 852 KB Output is correct
29 Correct 12 ms 1748 KB Output is correct
30 Correct 4 ms 1108 KB Output is correct
31 Correct 5 ms 2632 KB Output is correct
32 Correct 13 ms 1860 KB Output is correct
33 Correct 10 ms 1764 KB Output is correct
34 Correct 7 ms 2912 KB Output is correct
35 Correct 12 ms 2912 KB Output is correct
36 Correct 9 ms 2220 KB Output is correct
37 Correct 11 ms 1960 KB Output is correct
38 Correct 2 ms 1748 KB Output is correct
39 Correct 133 ms 14036 KB Output is correct
40 Correct 4 ms 1876 KB Output is correct
41 Correct 5 ms 3424 KB Output is correct
42 Correct 20 ms 2260 KB Output is correct
43 Correct 20 ms 3540 KB Output is correct
44 Correct 21 ms 8020 KB Output is correct
45 Correct 31 ms 8688 KB Output is correct
46 Correct 57 ms 18752 KB Output is correct
47 Correct 139 ms 14400 KB Output is correct
48 Correct 104 ms 14028 KB Output is correct
49 Correct 45 ms 25592 KB Output is correct
50 Correct 80 ms 25596 KB Output is correct
51 Correct 97 ms 16324 KB Output is correct
52 Correct 76 ms 14980 KB Output is correct
53 Correct 117 ms 14172 KB Output is correct
# 결과 실행 시간 메모리 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 340 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 0 ms 212 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 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 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 0 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 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 340 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 1 ms 340 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 0 ms 212 KB Output is correct
19 Correct 1 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 1 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 340 KB Output is correct
25 Correct 1 ms 596 KB Output is correct
26 Correct 2 ms 976 KB Output is correct
27 Correct 2 ms 976 KB Output is correct
28 Correct 2 ms 976 KB Output is correct
29 Correct 4 ms 1740 KB Output is correct
30 Correct 3 ms 1868 KB Output is correct
31 Correct 3 ms 980 KB Output is correct
32 Correct 1 ms 980 KB Output is correct
33 Correct 1 ms 852 KB Output is correct
34 Correct 5 ms 1620 KB Output is correct
35 Correct 6 ms 2632 KB Output is correct
36 Correct 5 ms 2632 KB Output is correct
37 Correct 10 ms 4036 KB Output is correct
38 Correct 7 ms 4036 KB Output is correct
39 Correct 16 ms 5068 KB Output is correct
40 Correct 42 ms 10284 KB Output is correct
41 Correct 46 ms 18740 KB Output is correct
42 Correct 47 ms 18728 KB Output is correct
43 Correct 107 ms 38012 KB Output is correct
44 Correct 78 ms 37956 KB Output is correct
45 Correct 44 ms 10548 KB Output is correct
46 Correct 47 ms 10536 KB Output is correct
# 결과 실행 시간 메모리 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 340 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 0 ms 212 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 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 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 0 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 4 ms 852 KB Output is correct
34 Correct 0 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 596 KB Output is correct
37 Correct 3 ms 1108 KB Output is correct
38 Correct 2 ms 976 KB Output is correct
39 Correct 2 ms 976 KB Output is correct
40 Correct 6 ms 852 KB Output is correct
41 Correct 4 ms 852 KB Output is correct
42 Correct 2 ms 976 KB Output is correct
43 Correct 4 ms 1740 KB Output is correct
44 Correct 3 ms 1740 KB Output is correct
45 Correct 2 ms 1364 KB Output is correct
46 Correct 4 ms 1364 KB Output is correct
47 Correct 4 ms 1108 KB Output is correct
48 Correct 4 ms 852 KB Output is correct
49 Correct 3 ms 852 KB Output is correct
50 Correct 6 ms 944 KB Output is correct
51 Correct 2 ms 980 KB Output is correct
52 Correct 1 ms 980 KB Output is correct
53 Correct 1 ms 852 KB Output is correct
54 Correct 2 ms 852 KB Output is correct
# 결과 실행 시간 메모리 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 340 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 0 ms 212 KB Output is correct
10 Correct 0 ms 340 KB Output is correct
11 Correct 0 ms 340 KB Output is correct
12 Correct 0 ms 340 KB Output is correct
13 Correct 1 ms 340 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 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 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 0 ms 212 KB Output is correct
29 Correct 0 ms 212 KB Output is correct
30 Correct 0 ms 212 KB Output is correct
31 Correct 0 ms 340 KB Output is correct
32 Correct 0 ms 340 KB Output is correct
33 Correct 4 ms 852 KB Output is correct
34 Correct 0 ms 340 KB Output is correct
35 Correct 1 ms 340 KB Output is correct
36 Correct 1 ms 596 KB Output is correct
37 Correct 3 ms 1108 KB Output is correct
38 Correct 2 ms 976 KB Output is correct
39 Correct 2 ms 976 KB Output is correct
40 Correct 6 ms 852 KB Output is correct
41 Correct 4 ms 852 KB Output is correct
42 Correct 2 ms 976 KB Output is correct
43 Correct 4 ms 1740 KB Output is correct
44 Correct 3 ms 1740 KB Output is correct
45 Correct 2 ms 1364 KB Output is correct
46 Correct 4 ms 1364 KB Output is correct
47 Correct 4 ms 1108 KB Output is correct
48 Correct 4 ms 852 KB Output is correct
49 Correct 3 ms 852 KB Output is correct
50 Correct 6 ms 944 KB Output is correct
51 Correct 2 ms 980 KB Output is correct
52 Correct 1 ms 980 KB Output is correct
53 Correct 1 ms 852 KB Output is correct
54 Correct 2 ms 852 KB Output is correct
55 Correct 12 ms 1764 KB Output is correct
56 Correct 4 ms 1108 KB Output is correct
57 Correct 4 ms 1620 KB Output is correct
58 Correct 9 ms 1620 KB Output is correct
59 Correct 5 ms 2632 KB Output is correct
60 Correct 14 ms 1972 KB Output is correct
61 Correct 10 ms 1748 KB Output is correct
62 Correct 5 ms 2632 KB Output is correct
63 Correct 10 ms 4036 KB Output is correct
64 Correct 8 ms 4036 KB Output is correct
65 Correct 7 ms 2912 KB Output is correct
66 Correct 12 ms 2912 KB Output is correct
67 Correct 12 ms 2324 KB Output is correct
68 Correct 11 ms 1748 KB Output is correct
69 Correct 11 ms 1748 KB Output is correct
70 Correct 15 ms 1876 KB Output is correct
71 Correct 10 ms 2188 KB Output is correct
72 Correct 8 ms 2188 KB Output is correct
73 Correct 11 ms 1960 KB Output is correct
74 Correct 2 ms 1748 KB Output is correct
# 결과 실행 시간 메모리 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 340 KB Output is correct
5 Correct 0 ms 340 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 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 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 4 ms 852 KB Output is correct
20 Correct 4 ms 1108 KB Output is correct
21 Correct 2 ms 976 KB Output is correct
22 Correct 5 ms 976 KB Output is correct
23 Correct 4 ms 928 KB Output is correct
24 Correct 3 ms 1364 KB Output is correct
25 Correct 4 ms 1364 KB Output is correct
26 Correct 1 ms 980 KB Output is correct
27 Correct 1 ms 852 KB Output is correct
28 Correct 2 ms 852 KB Output is correct
29 Correct 12 ms 1748 KB Output is correct
30 Correct 4 ms 1108 KB Output is correct
31 Correct 5 ms 2632 KB Output is correct
32 Correct 13 ms 1860 KB Output is correct
33 Correct 10 ms 1764 KB Output is correct
34 Correct 7 ms 2912 KB Output is correct
35 Correct 12 ms 2912 KB Output is correct
36 Correct 9 ms 2220 KB Output is correct
37 Correct 11 ms 1960 KB Output is correct
38 Correct 2 ms 1748 KB Output is correct
39 Correct 133 ms 14036 KB Output is correct
40 Correct 4 ms 1876 KB Output is correct
41 Correct 5 ms 3424 KB Output is correct
42 Correct 20 ms 2260 KB Output is correct
43 Correct 20 ms 3540 KB Output is correct
44 Correct 21 ms 8020 KB Output is correct
45 Correct 31 ms 8688 KB Output is correct
46 Correct 57 ms 18752 KB Output is correct
47 Correct 139 ms 14400 KB Output is correct
48 Correct 104 ms 14028 KB Output is correct
49 Correct 45 ms 25592 KB Output is correct
50 Correct 80 ms 25596 KB Output is correct
51 Correct 97 ms 16324 KB Output is correct
52 Correct 76 ms 14980 KB Output is correct
53 Correct 117 ms 14172 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 340 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 0 ms 212 KB Output is correct
63 Correct 0 ms 340 KB Output is correct
64 Correct 0 ms 340 KB Output is correct
65 Correct 0 ms 340 KB Output is correct
66 Correct 1 ms 340 KB Output is correct
67 Correct 0 ms 340 KB Output is correct
68 Correct 1 ms 212 KB Output is correct
69 Correct 0 ms 212 KB Output is correct
70 Correct 1 ms 212 KB Output is correct
71 Correct 0 ms 212 KB Output is correct
72 Correct 1 ms 212 KB Output is correct
73 Correct 1 ms 212 KB Output is correct
74 Correct 1 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 0 ms 212 KB Output is correct
82 Correct 0 ms 212 KB Output is correct
83 Correct 0 ms 212 KB Output is correct
84 Correct 0 ms 340 KB Output is correct
85 Correct 0 ms 340 KB Output is correct
86 Correct 0 ms 212 KB Output is correct
87 Correct 1 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 340 KB Output is correct
93 Correct 0 ms 340 KB Output is correct
94 Correct 0 ms 212 KB Output is correct
95 Correct 0 ms 340 KB Output is correct
96 Correct 1 ms 340 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 0 ms 212 KB Output is correct
104 Correct 1 ms 212 KB Output is correct
105 Correct 0 ms 212 KB Output is correct
106 Correct 0 ms 212 KB Output is correct
107 Correct 1 ms 212 KB Output is correct
108 Correct 0 ms 212 KB Output is correct
109 Correct 0 ms 340 KB Output is correct
110 Correct 1 ms 596 KB Output is correct
111 Correct 2 ms 976 KB Output is correct
112 Correct 2 ms 976 KB Output is correct
113 Correct 2 ms 976 KB Output is correct
114 Correct 4 ms 1740 KB Output is correct
115 Correct 3 ms 1868 KB Output is correct
116 Correct 3 ms 980 KB Output is correct
117 Correct 1 ms 980 KB Output is correct
118 Correct 1 ms 852 KB Output is correct
119 Correct 5 ms 1620 KB Output is correct
120 Correct 6 ms 2632 KB Output is correct
121 Correct 5 ms 2632 KB Output is correct
122 Correct 10 ms 4036 KB Output is correct
123 Correct 7 ms 4036 KB Output is correct
124 Correct 16 ms 5068 KB Output is correct
125 Correct 42 ms 10284 KB Output is correct
126 Correct 46 ms 18740 KB Output is correct
127 Correct 47 ms 18728 KB Output is correct
128 Correct 107 ms 38012 KB Output is correct
129 Correct 78 ms 37956 KB Output is correct
130 Correct 44 ms 10548 KB Output is correct
131 Correct 47 ms 10536 KB Output is correct
132 Correct 4 ms 852 KB Output is correct
133 Correct 0 ms 340 KB Output is correct
134 Correct 1 ms 340 KB Output is correct
135 Correct 1 ms 596 KB Output is correct
136 Correct 3 ms 1108 KB Output is correct
137 Correct 2 ms 976 KB Output is correct
138 Correct 2 ms 976 KB Output is correct
139 Correct 6 ms 852 KB Output is correct
140 Correct 4 ms 852 KB Output is correct
141 Correct 2 ms 976 KB Output is correct
142 Correct 4 ms 1740 KB Output is correct
143 Correct 3 ms 1740 KB Output is correct
144 Correct 2 ms 1364 KB Output is correct
145 Correct 4 ms 1364 KB Output is correct
146 Correct 4 ms 1108 KB Output is correct
147 Correct 4 ms 852 KB Output is correct
148 Correct 3 ms 852 KB Output is correct
149 Correct 6 ms 944 KB Output is correct
150 Correct 2 ms 980 KB Output is correct
151 Correct 1 ms 980 KB Output is correct
152 Correct 1 ms 852 KB Output is correct
153 Correct 2 ms 852 KB Output is correct
154 Correct 12 ms 1764 KB Output is correct
155 Correct 4 ms 1108 KB Output is correct
156 Correct 4 ms 1620 KB Output is correct
157 Correct 9 ms 1620 KB Output is correct
158 Correct 5 ms 2632 KB Output is correct
159 Correct 14 ms 1972 KB Output is correct
160 Correct 10 ms 1748 KB Output is correct
161 Correct 5 ms 2632 KB Output is correct
162 Correct 10 ms 4036 KB Output is correct
163 Correct 8 ms 4036 KB Output is correct
164 Correct 7 ms 2912 KB Output is correct
165 Correct 12 ms 2912 KB Output is correct
166 Correct 12 ms 2324 KB Output is correct
167 Correct 11 ms 1748 KB Output is correct
168 Correct 11 ms 1748 KB Output is correct
169 Correct 15 ms 1876 KB Output is correct
170 Correct 10 ms 2188 KB Output is correct
171 Correct 8 ms 2188 KB Output is correct
172 Correct 11 ms 1960 KB Output is correct
173 Correct 2 ms 1748 KB Output is correct
174 Correct 5 ms 2260 KB Output is correct
175 Correct 23 ms 3524 KB Output is correct
176 Correct 28 ms 9208 KB Output is correct
177 Correct 53 ms 9812 KB Output is correct
178 Correct 13 ms 12500 KB Output is correct
179 Correct 63 ms 14284 KB Output is correct
180 Correct 115 ms 14500 KB Output is correct
181 Correct 120 ms 15100 KB Output is correct
182 Correct 131 ms 17208 KB Output is correct
183 Correct 119 ms 19156 KB Output is correct
# 결과 실행 시간 메모리 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 340 KB Output is correct
5 Correct 0 ms 340 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 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 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 4 ms 852 KB Output is correct
20 Correct 4 ms 1108 KB Output is correct
21 Correct 2 ms 976 KB Output is correct
22 Correct 5 ms 976 KB Output is correct
23 Correct 4 ms 928 KB Output is correct
24 Correct 3 ms 1364 KB Output is correct
25 Correct 4 ms 1364 KB Output is correct
26 Correct 1 ms 980 KB Output is correct
27 Correct 1 ms 852 KB Output is correct
28 Correct 2 ms 852 KB Output is correct
29 Correct 12 ms 1748 KB Output is correct
30 Correct 4 ms 1108 KB Output is correct
31 Correct 5 ms 2632 KB Output is correct
32 Correct 13 ms 1860 KB Output is correct
33 Correct 10 ms 1764 KB Output is correct
34 Correct 7 ms 2912 KB Output is correct
35 Correct 12 ms 2912 KB Output is correct
36 Correct 9 ms 2220 KB Output is correct
37 Correct 11 ms 1960 KB Output is correct
38 Correct 2 ms 1748 KB Output is correct
39 Correct 133 ms 14036 KB Output is correct
40 Correct 4 ms 1876 KB Output is correct
41 Correct 5 ms 3424 KB Output is correct
42 Correct 20 ms 2260 KB Output is correct
43 Correct 20 ms 3540 KB Output is correct
44 Correct 21 ms 8020 KB Output is correct
45 Correct 31 ms 8688 KB Output is correct
46 Correct 57 ms 18752 KB Output is correct
47 Correct 139 ms 14400 KB Output is correct
48 Correct 104 ms 14028 KB Output is correct
49 Correct 45 ms 25592 KB Output is correct
50 Correct 80 ms 25596 KB Output is correct
51 Correct 97 ms 16324 KB Output is correct
52 Correct 76 ms 14980 KB Output is correct
53 Correct 117 ms 14172 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 340 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 0 ms 212 KB Output is correct
63 Correct 0 ms 340 KB Output is correct
64 Correct 0 ms 340 KB Output is correct
65 Correct 0 ms 340 KB Output is correct
66 Correct 1 ms 340 KB Output is correct
67 Correct 0 ms 340 KB Output is correct
68 Correct 1 ms 212 KB Output is correct
69 Correct 0 ms 212 KB Output is correct
70 Correct 1 ms 212 KB Output is correct
71 Correct 0 ms 212 KB Output is correct
72 Correct 1 ms 212 KB Output is correct
73 Correct 1 ms 212 KB Output is correct
74 Correct 1 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 0 ms 212 KB Output is correct
82 Correct 0 ms 212 KB Output is correct
83 Correct 0 ms 212 KB Output is correct
84 Correct 0 ms 340 KB Output is correct
85 Correct 0 ms 340 KB Output is correct
86 Correct 0 ms 212 KB Output is correct
87 Correct 1 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 340 KB Output is correct
93 Correct 0 ms 340 KB Output is correct
94 Correct 0 ms 212 KB Output is correct
95 Correct 0 ms 340 KB Output is correct
96 Correct 1 ms 340 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 0 ms 212 KB Output is correct
104 Correct 1 ms 212 KB Output is correct
105 Correct 0 ms 212 KB Output is correct
106 Correct 0 ms 212 KB Output is correct
107 Correct 1 ms 212 KB Output is correct
108 Correct 0 ms 212 KB Output is correct
109 Correct 0 ms 340 KB Output is correct
110 Correct 1 ms 596 KB Output is correct
111 Correct 2 ms 976 KB Output is correct
112 Correct 2 ms 976 KB Output is correct
113 Correct 2 ms 976 KB Output is correct
114 Correct 4 ms 1740 KB Output is correct
115 Correct 3 ms 1868 KB Output is correct
116 Correct 3 ms 980 KB Output is correct
117 Correct 1 ms 980 KB Output is correct
118 Correct 1 ms 852 KB Output is correct
119 Correct 5 ms 1620 KB Output is correct
120 Correct 6 ms 2632 KB Output is correct
121 Correct 5 ms 2632 KB Output is correct
122 Correct 10 ms 4036 KB Output is correct
123 Correct 7 ms 4036 KB Output is correct
124 Correct 16 ms 5068 KB Output is correct
125 Correct 42 ms 10284 KB Output is correct
126 Correct 46 ms 18740 KB Output is correct
127 Correct 47 ms 18728 KB Output is correct
128 Correct 107 ms 38012 KB Output is correct
129 Correct 78 ms 37956 KB Output is correct
130 Correct 44 ms 10548 KB Output is correct
131 Correct 47 ms 10536 KB Output is correct
132 Correct 4 ms 852 KB Output is correct
133 Correct 0 ms 340 KB Output is correct
134 Correct 1 ms 340 KB Output is correct
135 Correct 1 ms 596 KB Output is correct
136 Correct 3 ms 1108 KB Output is correct
137 Correct 2 ms 976 KB Output is correct
138 Correct 2 ms 976 KB Output is correct
139 Correct 6 ms 852 KB Output is correct
140 Correct 4 ms 852 KB Output is correct
141 Correct 2 ms 976 KB Output is correct
142 Correct 4 ms 1740 KB Output is correct
143 Correct 3 ms 1740 KB Output is correct
144 Correct 2 ms 1364 KB Output is correct
145 Correct 4 ms 1364 KB Output is correct
146 Correct 4 ms 1108 KB Output is correct
147 Correct 4 ms 852 KB Output is correct
148 Correct 3 ms 852 KB Output is correct
149 Correct 6 ms 944 KB Output is correct
150 Correct 2 ms 980 KB Output is correct
151 Correct 1 ms 980 KB Output is correct
152 Correct 1 ms 852 KB Output is correct
153 Correct 2 ms 852 KB Output is correct
154 Correct 12 ms 1764 KB Output is correct
155 Correct 4 ms 1108 KB Output is correct
156 Correct 4 ms 1620 KB Output is correct
157 Correct 9 ms 1620 KB Output is correct
158 Correct 5 ms 2632 KB Output is correct
159 Correct 14 ms 1972 KB Output is correct
160 Correct 10 ms 1748 KB Output is correct
161 Correct 5 ms 2632 KB Output is correct
162 Correct 10 ms 4036 KB Output is correct
163 Correct 8 ms 4036 KB Output is correct
164 Correct 7 ms 2912 KB Output is correct
165 Correct 12 ms 2912 KB Output is correct
166 Correct 12 ms 2324 KB Output is correct
167 Correct 11 ms 1748 KB Output is correct
168 Correct 11 ms 1748 KB Output is correct
169 Correct 15 ms 1876 KB Output is correct
170 Correct 10 ms 2188 KB Output is correct
171 Correct 8 ms 2188 KB Output is correct
172 Correct 11 ms 1960 KB Output is correct
173 Correct 2 ms 1748 KB Output is correct
174 Correct 5 ms 2260 KB Output is correct
175 Correct 23 ms 3524 KB Output is correct
176 Correct 28 ms 9208 KB Output is correct
177 Correct 53 ms 9812 KB Output is correct
178 Correct 13 ms 12500 KB Output is correct
179 Correct 63 ms 14284 KB Output is correct
180 Correct 115 ms 14500 KB Output is correct
181 Correct 120 ms 15100 KB Output is correct
182 Correct 131 ms 17208 KB Output is correct
183 Correct 119 ms 19156 KB Output is correct
184 Correct 301 ms 27656 KB Output is correct
185 Correct 37 ms 17236 KB Output is correct
186 Correct 63 ms 20868 KB Output is correct
187 Correct 37 ms 24592 KB Output is correct
188 Correct 97 ms 39808 KB Output is correct
189 Correct 229 ms 31148 KB Output is correct
190 Correct 98 ms 30540 KB Output is correct
191 Correct 96 ms 39840 KB Output is correct
192 Correct 257 ms 78468 KB Output is correct
193 Correct 175 ms 78532 KB Output is correct
194 Correct 128 ms 53888 KB Output is correct
195 Correct 172 ms 53800 KB Output is correct
196 Correct 225 ms 30720 KB Output is correct
197 Correct 124 ms 31516 KB Output is correct
198 Correct 136 ms 32448 KB Output is correct
199 Correct 260 ms 34556 KB Output is correct
200 Correct 108 ms 34844 KB Output is correct
201 Correct 193 ms 32064 KB Output is correct
202 Correct 305 ms 30832 KB Output is correct
# 결과 실행 시간 메모리 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 340 KB Output is correct
5 Correct 0 ms 340 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 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 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 4 ms 852 KB Output is correct
20 Correct 4 ms 1108 KB Output is correct
21 Correct 2 ms 976 KB Output is correct
22 Correct 5 ms 976 KB Output is correct
23 Correct 4 ms 928 KB Output is correct
24 Correct 3 ms 1364 KB Output is correct
25 Correct 4 ms 1364 KB Output is correct
26 Correct 1 ms 980 KB Output is correct
27 Correct 1 ms 852 KB Output is correct
28 Correct 2 ms 852 KB Output is correct
29 Correct 12 ms 1748 KB Output is correct
30 Correct 4 ms 1108 KB Output is correct
31 Correct 5 ms 2632 KB Output is correct
32 Correct 13 ms 1860 KB Output is correct
33 Correct 10 ms 1764 KB Output is correct
34 Correct 7 ms 2912 KB Output is correct
35 Correct 12 ms 2912 KB Output is correct
36 Correct 9 ms 2220 KB Output is correct
37 Correct 11 ms 1960 KB Output is correct
38 Correct 2 ms 1748 KB Output is correct
39 Correct 133 ms 14036 KB Output is correct
40 Correct 4 ms 1876 KB Output is correct
41 Correct 5 ms 3424 KB Output is correct
42 Correct 20 ms 2260 KB Output is correct
43 Correct 20 ms 3540 KB Output is correct
44 Correct 21 ms 8020 KB Output is correct
45 Correct 31 ms 8688 KB Output is correct
46 Correct 57 ms 18752 KB Output is correct
47 Correct 139 ms 14400 KB Output is correct
48 Correct 104 ms 14028 KB Output is correct
49 Correct 45 ms 25592 KB Output is correct
50 Correct 80 ms 25596 KB Output is correct
51 Correct 97 ms 16324 KB Output is correct
52 Correct 76 ms 14980 KB Output is correct
53 Correct 117 ms 14172 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 340 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 0 ms 212 KB Output is correct
63 Correct 0 ms 340 KB Output is correct
64 Correct 0 ms 340 KB Output is correct
65 Correct 0 ms 340 KB Output is correct
66 Correct 1 ms 340 KB Output is correct
67 Correct 0 ms 340 KB Output is correct
68 Correct 1 ms 212 KB Output is correct
69 Correct 0 ms 212 KB Output is correct
70 Correct 1 ms 212 KB Output is correct
71 Correct 0 ms 212 KB Output is correct
72 Correct 1 ms 212 KB Output is correct
73 Correct 1 ms 212 KB Output is correct
74 Correct 1 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 0 ms 212 KB Output is correct
82 Correct 0 ms 212 KB Output is correct
83 Correct 0 ms 212 KB Output is correct
84 Correct 0 ms 340 KB Output is correct
85 Correct 0 ms 340 KB Output is correct
86 Correct 0 ms 212 KB Output is correct
87 Correct 1 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 340 KB Output is correct
93 Correct 0 ms 340 KB Output is correct
94 Correct 0 ms 212 KB Output is correct
95 Correct 0 ms 340 KB Output is correct
96 Correct 1 ms 340 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 0 ms 212 KB Output is correct
104 Correct 1 ms 212 KB Output is correct
105 Correct 0 ms 212 KB Output is correct
106 Correct 0 ms 212 KB Output is correct
107 Correct 1 ms 212 KB Output is correct
108 Correct 0 ms 212 KB Output is correct
109 Correct 0 ms 340 KB Output is correct
110 Correct 1 ms 596 KB Output is correct
111 Correct 2 ms 976 KB Output is correct
112 Correct 2 ms 976 KB Output is correct
113 Correct 2 ms 976 KB Output is correct
114 Correct 4 ms 1740 KB Output is correct
115 Correct 3 ms 1868 KB Output is correct
116 Correct 3 ms 980 KB Output is correct
117 Correct 1 ms 980 KB Output is correct
118 Correct 1 ms 852 KB Output is correct
119 Correct 5 ms 1620 KB Output is correct
120 Correct 6 ms 2632 KB Output is correct
121 Correct 5 ms 2632 KB Output is correct
122 Correct 10 ms 4036 KB Output is correct
123 Correct 7 ms 4036 KB Output is correct
124 Correct 16 ms 5068 KB Output is correct
125 Correct 42 ms 10284 KB Output is correct
126 Correct 46 ms 18740 KB Output is correct
127 Correct 47 ms 18728 KB Output is correct
128 Correct 107 ms 38012 KB Output is correct
129 Correct 78 ms 37956 KB Output is correct
130 Correct 44 ms 10548 KB Output is correct
131 Correct 47 ms 10536 KB Output is correct
132 Correct 4 ms 852 KB Output is correct
133 Correct 0 ms 340 KB Output is correct
134 Correct 1 ms 340 KB Output is correct
135 Correct 1 ms 596 KB Output is correct
136 Correct 3 ms 1108 KB Output is correct
137 Correct 2 ms 976 KB Output is correct
138 Correct 2 ms 976 KB Output is correct
139 Correct 6 ms 852 KB Output is correct
140 Correct 4 ms 852 KB Output is correct
141 Correct 2 ms 976 KB Output is correct
142 Correct 4 ms 1740 KB Output is correct
143 Correct 3 ms 1740 KB Output is correct
144 Correct 2 ms 1364 KB Output is correct
145 Correct 4 ms 1364 KB Output is correct
146 Correct 4 ms 1108 KB Output is correct
147 Correct 4 ms 852 KB Output is correct
148 Correct 3 ms 852 KB Output is correct
149 Correct 6 ms 944 KB Output is correct
150 Correct 2 ms 980 KB Output is correct
151 Correct 1 ms 980 KB Output is correct
152 Correct 1 ms 852 KB Output is correct
153 Correct 2 ms 852 KB Output is correct
154 Correct 12 ms 1764 KB Output is correct
155 Correct 4 ms 1108 KB Output is correct
156 Correct 4 ms 1620 KB Output is correct
157 Correct 9 ms 1620 KB Output is correct
158 Correct 5 ms 2632 KB Output is correct
159 Correct 14 ms 1972 KB Output is correct
160 Correct 10 ms 1748 KB Output is correct
161 Correct 5 ms 2632 KB Output is correct
162 Correct 10 ms 4036 KB Output is correct
163 Correct 8 ms 4036 KB Output is correct
164 Correct 7 ms 2912 KB Output is correct
165 Correct 12 ms 2912 KB Output is correct
166 Correct 12 ms 2324 KB Output is correct
167 Correct 11 ms 1748 KB Output is correct
168 Correct 11 ms 1748 KB Output is correct
169 Correct 15 ms 1876 KB Output is correct
170 Correct 10 ms 2188 KB Output is correct
171 Correct 8 ms 2188 KB Output is correct
172 Correct 11 ms 1960 KB Output is correct
173 Correct 2 ms 1748 KB Output is correct
174 Correct 5 ms 2260 KB Output is correct
175 Correct 23 ms 3524 KB Output is correct
176 Correct 28 ms 9208 KB Output is correct
177 Correct 53 ms 9812 KB Output is correct
178 Correct 13 ms 12500 KB Output is correct
179 Correct 63 ms 14284 KB Output is correct
180 Correct 115 ms 14500 KB Output is correct
181 Correct 120 ms 15100 KB Output is correct
182 Correct 131 ms 17208 KB Output is correct
183 Correct 119 ms 19156 KB Output is correct
184 Correct 301 ms 27656 KB Output is correct
185 Correct 37 ms 17236 KB Output is correct
186 Correct 63 ms 20868 KB Output is correct
187 Correct 37 ms 24592 KB Output is correct
188 Correct 97 ms 39808 KB Output is correct
189 Correct 229 ms 31148 KB Output is correct
190 Correct 98 ms 30540 KB Output is correct
191 Correct 96 ms 39840 KB Output is correct
192 Correct 257 ms 78468 KB Output is correct
193 Correct 175 ms 78532 KB Output is correct
194 Correct 128 ms 53888 KB Output is correct
195 Correct 172 ms 53800 KB Output is correct
196 Correct 225 ms 30720 KB Output is correct
197 Correct 124 ms 31516 KB Output is correct
198 Correct 136 ms 32448 KB Output is correct
199 Correct 260 ms 34556 KB Output is correct
200 Correct 108 ms 34844 KB Output is correct
201 Correct 193 ms 32064 KB Output is correct
202 Correct 305 ms 30832 KB Output is correct
203 Correct 642 ms 60812 KB Output is correct
204 Correct 208 ms 44276 KB Output is correct
205 Correct 292 ms 38720 KB Output is correct
206 Correct 125 ms 61052 KB Output is correct
207 Correct 193 ms 79212 KB Output is correct
208 Correct 497 ms 61676 KB Output is correct
209 Correct 614 ms 60648 KB Output is correct
210 Correct 217 ms 79184 KB Output is correct
211 Correct 486 ms 156532 KB Output is correct
212 Correct 390 ms 156624 KB Output is correct
213 Correct 167 ms 107432 KB Output is correct
214 Correct 392 ms 107448 KB Output is correct
215 Correct 423 ms 60756 KB Output is correct
216 Correct 388 ms 61356 KB Output is correct
217 Correct 452 ms 64088 KB Output is correct
218 Correct 383 ms 68128 KB Output is correct
219 Correct 366 ms 104380 KB Output is correct
220 Correct 124 ms 45988 KB Output is correct
221 Correct 186 ms 46108 KB Output is correct
222 Correct 538 ms 168952 KB Output is correct
223 Correct 433 ms 65852 KB Output is correct
224 Correct 434 ms 62684 KB Output is correct
225 Correct 299 ms 61012 KB Output is correct