답안 #838048

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
838048 2023-08-26T06:27:11 Z gun_gan Maze (JOI23_ho_t3) C++17
51 / 100
2000 ms 215628 KB
#include <bits/stdc++.h>
using namespace std;

const int MX = 6e6 + 5;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

int N, R, C;
int sc, sr, gc, gr;
string s[MX];

vector<vector<int>> par;

int nxt(int r, int c) { // row, column
      return par[r][c] == c ? c : par[r][c] = nxt(r, par[r][c]);
}

void merge(int r, int c, int cc) {
      if(cc >= C) return;
      c = nxt(r, c); cc = nxt(r, cc);
      if(c == cc) return;
      par[r][c] = cc;
}

int main() {
      cin.tie(0); ios_base::sync_with_stdio(0);

      cin >> R >> C >> N;
      cin >> sr >> sc >> gr >> gc;
      for(int i = 0; i < R; i++) cin >> s[i];
      sc--, sr--, gc--, gr--;

      par = vector<vector<int>>(R, vector<int>(C));

      for(int i = 0; i < R; i++) {
            for(int j = 0; j < C; j++) {
                  par[i][j] = j;
            }
      }

      vector<vector<int>> dist(R, vector<int>(C, 1e9));
      vector<vector<bool>> vis(R, vector<bool>(C));

      deque<pair<int,int>> dq;
      dq.push_back({sr, sc});
      dist[sr][sc] = 0;
      while(!dq.empty()) {
            auto [x, y] = dq.front(); dq.pop_front();
            if(x == gr && y == gc) break;
            if(vis[x][y]) continue;
            vis[x][y] = 1;
            for(int k = 0; k < 4; k++) {
                  int r = x + dx[k], c = y + dy[k];
                  if(r >= 0 && r < R && c >= 0 && c < C && dist[r][c] > dist[x][y] && s[r][c] == '.') {
                        dist[r][c] = dist[x][y];
                        dq.push_front({r, c});
                        if(x == r && nxt(r, y) != nxt(r, c)) merge(r, min(y, c), max(y, c)); 
                  }
            }

            for(int r = max(0, x - N); r <= min(R - 1, x + N); r++) {
                  int b = abs(x - r) == N;
                  int c = nxt(r, max(0, y - N + b)), prv = -1;
                  while(c <= min(C - 1, y + N - b)) {
                        if(dist[r][c] > dist[x][y] + 1) {
                              dist[r][c] = dist[x][y] + 1;
                              dq.push_back({r, c});
                        }
                        if(prv != -1)
                              merge(r, prv, c);

                        prv = c;
                        if(nxt(r, c) + 1 < C)
                              c = nxt(r, nxt(r, c) + 1);
                        else
                              break;
                  }
            }
      }

      cout << dist[gr][gc] << '\n';
}
# 결과 실행 시간 메모리 Grader output
1 Correct 84 ms 188216 KB Output is correct
2 Correct 78 ms 188112 KB Output is correct
3 Correct 77 ms 188104 KB Output is correct
4 Correct 77 ms 188108 KB Output is correct
5 Correct 78 ms 188060 KB Output is correct
6 Correct 78 ms 188116 KB Output is correct
7 Correct 84 ms 188152 KB Output is correct
8 Correct 80 ms 188132 KB Output is correct
9 Correct 79 ms 188108 KB Output is correct
10 Correct 78 ms 188048 KB Output is correct
11 Correct 79 ms 188088 KB Output is correct
12 Correct 83 ms 188052 KB Output is correct
13 Correct 80 ms 188172 KB Output is correct
14 Correct 80 ms 188256 KB Output is correct
15 Correct 78 ms 188168 KB Output is correct
16 Correct 82 ms 188112 KB Output is correct
17 Correct 80 ms 188232 KB Output is correct
18 Correct 78 ms 188132 KB Output is correct
19 Correct 82 ms 188636 KB Output is correct
20 Correct 82 ms 188720 KB Output is correct
21 Correct 80 ms 188764 KB Output is correct
22 Correct 83 ms 188628 KB Output is correct
23 Correct 83 ms 188620 KB Output is correct
24 Correct 89 ms 188972 KB Output is correct
25 Correct 94 ms 189000 KB Output is correct
26 Correct 81 ms 188744 KB Output is correct
27 Correct 80 ms 188744 KB Output is correct
28 Correct 84 ms 188748 KB Output is correct
29 Correct 89 ms 189516 KB Output is correct
30 Correct 83 ms 188852 KB Output is correct
31 Correct 83 ms 189988 KB Output is correct
32 Correct 91 ms 189564 KB Output is correct
33 Correct 91 ms 189516 KB Output is correct
34 Correct 86 ms 189972 KB Output is correct
35 Correct 85 ms 190052 KB Output is correct
36 Correct 86 ms 189512 KB Output is correct
37 Correct 89 ms 189516 KB Output is correct
38 Correct 80 ms 189520 KB Output is correct
39 Correct 194 ms 201804 KB Output is correct
40 Correct 88 ms 189644 KB Output is correct
41 Correct 83 ms 190468 KB Output is correct
42 Correct 95 ms 190028 KB Output is correct
43 Correct 96 ms 190920 KB Output is correct
44 Correct 100 ms 195232 KB Output is correct
45 Correct 101 ms 195828 KB Output is correct
46 Correct 107 ms 204008 KB Output is correct
47 Correct 198 ms 201996 KB Output is correct
48 Correct 159 ms 201776 KB Output is correct
49 Correct 116 ms 207252 KB Output is correct
50 Correct 116 ms 207232 KB Output is correct
51 Correct 166 ms 202180 KB Output is correct
52 Correct 157 ms 201932 KB Output is correct
53 Correct 168 ms 201884 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 78 ms 188052 KB Output is correct
2 Correct 79 ms 188108 KB Output is correct
3 Correct 81 ms 188076 KB Output is correct
4 Correct 79 ms 188108 KB Output is correct
5 Correct 79 ms 188180 KB Output is correct
6 Correct 80 ms 188112 KB Output is correct
7 Correct 82 ms 188152 KB Output is correct
8 Correct 78 ms 188108 KB Output is correct
9 Correct 82 ms 188096 KB Output is correct
10 Correct 80 ms 188180 KB Output is correct
11 Correct 83 ms 188140 KB Output is correct
12 Correct 83 ms 188188 KB Output is correct
13 Correct 79 ms 188108 KB Output is correct
14 Correct 94 ms 188104 KB Output is correct
15 Correct 79 ms 188152 KB Output is correct
16 Correct 83 ms 188140 KB Output is correct
17 Correct 80 ms 188108 KB Output is correct
18 Correct 91 ms 188276 KB Output is correct
19 Correct 81 ms 188120 KB Output is correct
20 Correct 83 ms 188164 KB Output is correct
21 Correct 81 ms 188164 KB Output is correct
22 Correct 79 ms 188128 KB Output is correct
23 Correct 80 ms 188108 KB Output is correct
24 Correct 80 ms 188108 KB Output is correct
25 Correct 82 ms 188108 KB Output is correct
26 Correct 82 ms 188108 KB Output is correct
27 Correct 81 ms 188144 KB Output is correct
28 Correct 83 ms 188088 KB Output is correct
29 Correct 80 ms 188280 KB Output is correct
30 Correct 80 ms 188124 KB Output is correct
31 Correct 80 ms 188092 KB Output is correct
32 Correct 80 ms 188108 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 80 ms 188088 KB Output is correct
2 Correct 75 ms 188116 KB Output is correct
3 Correct 79 ms 188080 KB Output is correct
4 Correct 83 ms 188164 KB Output is correct
5 Correct 82 ms 188084 KB Output is correct
6 Correct 79 ms 188108 KB Output is correct
7 Correct 80 ms 188108 KB Output is correct
8 Correct 80 ms 188176 KB Output is correct
9 Correct 83 ms 188188 KB Output is correct
10 Correct 79 ms 188148 KB Output is correct
11 Correct 81 ms 188160 KB Output is correct
12 Correct 79 ms 188108 KB Output is correct
13 Correct 87 ms 188108 KB Output is correct
14 Correct 80 ms 188108 KB Output is correct
15 Correct 84 ms 188124 KB Output is correct
16 Correct 93 ms 188112 KB Output is correct
17 Correct 79 ms 188108 KB Output is correct
18 Correct 79 ms 188112 KB Output is correct
19 Correct 85 ms 188112 KB Output is correct
20 Correct 78 ms 188168 KB Output is correct
21 Correct 81 ms 188104 KB Output is correct
22 Correct 82 ms 188136 KB Output is correct
23 Correct 79 ms 188180 KB Output is correct
24 Correct 80 ms 188180 KB Output is correct
25 Correct 82 ms 188492 KB Output is correct
26 Correct 88 ms 189132 KB Output is correct
27 Correct 83 ms 188808 KB Output is correct
28 Correct 141 ms 189388 KB Output is correct
29 Correct 111 ms 189236 KB Output is correct
30 Correct 120 ms 189236 KB Output is correct
31 Correct 94 ms 188696 KB Output is correct
32 Correct 80 ms 188768 KB Output is correct
33 Correct 83 ms 188644 KB Output is correct
34 Correct 128 ms 190416 KB Output is correct
35 Correct 82 ms 189900 KB Output is correct
36 Correct 282 ms 191360 KB Output is correct
37 Correct 408 ms 190796 KB Output is correct
38 Correct 354 ms 190884 KB Output is correct
39 Correct 161 ms 196172 KB Output is correct
40 Correct 178 ms 205644 KB Output is correct
41 Correct 115 ms 203852 KB Output is correct
42 Execution timed out 2095 ms 215628 KB Time limit exceeded
43 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 78 ms 188052 KB Output is correct
2 Correct 79 ms 188108 KB Output is correct
3 Correct 81 ms 188076 KB Output is correct
4 Correct 79 ms 188108 KB Output is correct
5 Correct 79 ms 188180 KB Output is correct
6 Correct 80 ms 188112 KB Output is correct
7 Correct 82 ms 188152 KB Output is correct
8 Correct 78 ms 188108 KB Output is correct
9 Correct 82 ms 188096 KB Output is correct
10 Correct 80 ms 188180 KB Output is correct
11 Correct 83 ms 188140 KB Output is correct
12 Correct 83 ms 188188 KB Output is correct
13 Correct 79 ms 188108 KB Output is correct
14 Correct 94 ms 188104 KB Output is correct
15 Correct 79 ms 188152 KB Output is correct
16 Correct 83 ms 188140 KB Output is correct
17 Correct 80 ms 188108 KB Output is correct
18 Correct 91 ms 188276 KB Output is correct
19 Correct 81 ms 188120 KB Output is correct
20 Correct 83 ms 188164 KB Output is correct
21 Correct 81 ms 188164 KB Output is correct
22 Correct 79 ms 188128 KB Output is correct
23 Correct 80 ms 188108 KB Output is correct
24 Correct 80 ms 188108 KB Output is correct
25 Correct 82 ms 188108 KB Output is correct
26 Correct 82 ms 188108 KB Output is correct
27 Correct 81 ms 188144 KB Output is correct
28 Correct 83 ms 188088 KB Output is correct
29 Correct 80 ms 188280 KB Output is correct
30 Correct 80 ms 188124 KB Output is correct
31 Correct 80 ms 188092 KB Output is correct
32 Correct 80 ms 188108 KB Output is correct
33 Correct 86 ms 188620 KB Output is correct
34 Correct 81 ms 188104 KB Output is correct
35 Correct 80 ms 188168 KB Output is correct
36 Correct 81 ms 188480 KB Output is correct
37 Correct 80 ms 188784 KB Output is correct
38 Correct 92 ms 189200 KB Output is correct
39 Correct 87 ms 188876 KB Output is correct
40 Correct 84 ms 188744 KB Output is correct
41 Correct 81 ms 188620 KB Output is correct
42 Correct 131 ms 189480 KB Output is correct
43 Correct 108 ms 189236 KB Output is correct
44 Correct 119 ms 189160 KB Output is correct
45 Correct 89 ms 188952 KB Output is correct
46 Correct 80 ms 188896 KB Output is correct
47 Correct 82 ms 188752 KB Output is correct
48 Correct 87 ms 188620 KB Output is correct
49 Correct 87 ms 188668 KB Output is correct
50 Correct 100 ms 188624 KB Output is correct
51 Correct 92 ms 188808 KB Output is correct
52 Correct 82 ms 188652 KB Output is correct
53 Correct 80 ms 188748 KB Output is correct
54 Correct 87 ms 188780 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 78 ms 188052 KB Output is correct
2 Correct 79 ms 188108 KB Output is correct
3 Correct 81 ms 188076 KB Output is correct
4 Correct 79 ms 188108 KB Output is correct
5 Correct 79 ms 188180 KB Output is correct
6 Correct 80 ms 188112 KB Output is correct
7 Correct 82 ms 188152 KB Output is correct
8 Correct 78 ms 188108 KB Output is correct
9 Correct 82 ms 188096 KB Output is correct
10 Correct 80 ms 188180 KB Output is correct
11 Correct 83 ms 188140 KB Output is correct
12 Correct 83 ms 188188 KB Output is correct
13 Correct 79 ms 188108 KB Output is correct
14 Correct 94 ms 188104 KB Output is correct
15 Correct 79 ms 188152 KB Output is correct
16 Correct 83 ms 188140 KB Output is correct
17 Correct 80 ms 188108 KB Output is correct
18 Correct 91 ms 188276 KB Output is correct
19 Correct 81 ms 188120 KB Output is correct
20 Correct 83 ms 188164 KB Output is correct
21 Correct 81 ms 188164 KB Output is correct
22 Correct 79 ms 188128 KB Output is correct
23 Correct 80 ms 188108 KB Output is correct
24 Correct 80 ms 188108 KB Output is correct
25 Correct 82 ms 188108 KB Output is correct
26 Correct 82 ms 188108 KB Output is correct
27 Correct 81 ms 188144 KB Output is correct
28 Correct 83 ms 188088 KB Output is correct
29 Correct 80 ms 188280 KB Output is correct
30 Correct 80 ms 188124 KB Output is correct
31 Correct 80 ms 188092 KB Output is correct
32 Correct 80 ms 188108 KB Output is correct
33 Correct 86 ms 188620 KB Output is correct
34 Correct 81 ms 188104 KB Output is correct
35 Correct 80 ms 188168 KB Output is correct
36 Correct 81 ms 188480 KB Output is correct
37 Correct 80 ms 188784 KB Output is correct
38 Correct 92 ms 189200 KB Output is correct
39 Correct 87 ms 188876 KB Output is correct
40 Correct 84 ms 188744 KB Output is correct
41 Correct 81 ms 188620 KB Output is correct
42 Correct 131 ms 189480 KB Output is correct
43 Correct 108 ms 189236 KB Output is correct
44 Correct 119 ms 189160 KB Output is correct
45 Correct 89 ms 188952 KB Output is correct
46 Correct 80 ms 188896 KB Output is correct
47 Correct 82 ms 188752 KB Output is correct
48 Correct 87 ms 188620 KB Output is correct
49 Correct 87 ms 188668 KB Output is correct
50 Correct 100 ms 188624 KB Output is correct
51 Correct 92 ms 188808 KB Output is correct
52 Correct 82 ms 188652 KB Output is correct
53 Correct 80 ms 188748 KB Output is correct
54 Correct 87 ms 188780 KB Output is correct
55 Correct 90 ms 189552 KB Output is correct
56 Correct 84 ms 188804 KB Output is correct
57 Correct 116 ms 190432 KB Output is correct
58 Correct 91 ms 189468 KB Output is correct
59 Correct 86 ms 190028 KB Output is correct
60 Correct 92 ms 189516 KB Output is correct
61 Correct 86 ms 189516 KB Output is correct
62 Correct 290 ms 191364 KB Output is correct
63 Correct 410 ms 190812 KB Output is correct
64 Correct 336 ms 190808 KB Output is correct
65 Correct 85 ms 190092 KB Output is correct
66 Correct 88 ms 190064 KB Output is correct
67 Correct 89 ms 189904 KB Output is correct
68 Correct 110 ms 189536 KB Output is correct
69 Correct 129 ms 189516 KB Output is correct
70 Correct 160 ms 189516 KB Output is correct
71 Correct 164 ms 189696 KB Output is correct
72 Correct 86 ms 189548 KB Output is correct
73 Correct 96 ms 189516 KB Output is correct
74 Correct 87 ms 189532 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 84 ms 188216 KB Output is correct
2 Correct 78 ms 188112 KB Output is correct
3 Correct 77 ms 188104 KB Output is correct
4 Correct 77 ms 188108 KB Output is correct
5 Correct 78 ms 188060 KB Output is correct
6 Correct 78 ms 188116 KB Output is correct
7 Correct 84 ms 188152 KB Output is correct
8 Correct 80 ms 188132 KB Output is correct
9 Correct 79 ms 188108 KB Output is correct
10 Correct 78 ms 188048 KB Output is correct
11 Correct 79 ms 188088 KB Output is correct
12 Correct 83 ms 188052 KB Output is correct
13 Correct 80 ms 188172 KB Output is correct
14 Correct 80 ms 188256 KB Output is correct
15 Correct 78 ms 188168 KB Output is correct
16 Correct 82 ms 188112 KB Output is correct
17 Correct 80 ms 188232 KB Output is correct
18 Correct 78 ms 188132 KB Output is correct
19 Correct 82 ms 188636 KB Output is correct
20 Correct 82 ms 188720 KB Output is correct
21 Correct 80 ms 188764 KB Output is correct
22 Correct 83 ms 188628 KB Output is correct
23 Correct 83 ms 188620 KB Output is correct
24 Correct 89 ms 188972 KB Output is correct
25 Correct 94 ms 189000 KB Output is correct
26 Correct 81 ms 188744 KB Output is correct
27 Correct 80 ms 188744 KB Output is correct
28 Correct 84 ms 188748 KB Output is correct
29 Correct 89 ms 189516 KB Output is correct
30 Correct 83 ms 188852 KB Output is correct
31 Correct 83 ms 189988 KB Output is correct
32 Correct 91 ms 189564 KB Output is correct
33 Correct 91 ms 189516 KB Output is correct
34 Correct 86 ms 189972 KB Output is correct
35 Correct 85 ms 190052 KB Output is correct
36 Correct 86 ms 189512 KB Output is correct
37 Correct 89 ms 189516 KB Output is correct
38 Correct 80 ms 189520 KB Output is correct
39 Correct 194 ms 201804 KB Output is correct
40 Correct 88 ms 189644 KB Output is correct
41 Correct 83 ms 190468 KB Output is correct
42 Correct 95 ms 190028 KB Output is correct
43 Correct 96 ms 190920 KB Output is correct
44 Correct 100 ms 195232 KB Output is correct
45 Correct 101 ms 195828 KB Output is correct
46 Correct 107 ms 204008 KB Output is correct
47 Correct 198 ms 201996 KB Output is correct
48 Correct 159 ms 201776 KB Output is correct
49 Correct 116 ms 207252 KB Output is correct
50 Correct 116 ms 207232 KB Output is correct
51 Correct 166 ms 202180 KB Output is correct
52 Correct 157 ms 201932 KB Output is correct
53 Correct 168 ms 201884 KB Output is correct
54 Correct 78 ms 188052 KB Output is correct
55 Correct 79 ms 188108 KB Output is correct
56 Correct 81 ms 188076 KB Output is correct
57 Correct 79 ms 188108 KB Output is correct
58 Correct 79 ms 188180 KB Output is correct
59 Correct 80 ms 188112 KB Output is correct
60 Correct 82 ms 188152 KB Output is correct
61 Correct 78 ms 188108 KB Output is correct
62 Correct 82 ms 188096 KB Output is correct
63 Correct 80 ms 188180 KB Output is correct
64 Correct 83 ms 188140 KB Output is correct
65 Correct 83 ms 188188 KB Output is correct
66 Correct 79 ms 188108 KB Output is correct
67 Correct 94 ms 188104 KB Output is correct
68 Correct 79 ms 188152 KB Output is correct
69 Correct 83 ms 188140 KB Output is correct
70 Correct 80 ms 188108 KB Output is correct
71 Correct 91 ms 188276 KB Output is correct
72 Correct 81 ms 188120 KB Output is correct
73 Correct 83 ms 188164 KB Output is correct
74 Correct 81 ms 188164 KB Output is correct
75 Correct 79 ms 188128 KB Output is correct
76 Correct 80 ms 188108 KB Output is correct
77 Correct 80 ms 188108 KB Output is correct
78 Correct 82 ms 188108 KB Output is correct
79 Correct 82 ms 188108 KB Output is correct
80 Correct 81 ms 188144 KB Output is correct
81 Correct 83 ms 188088 KB Output is correct
82 Correct 80 ms 188280 KB Output is correct
83 Correct 80 ms 188124 KB Output is correct
84 Correct 80 ms 188092 KB Output is correct
85 Correct 80 ms 188108 KB Output is correct
86 Correct 80 ms 188088 KB Output is correct
87 Correct 75 ms 188116 KB Output is correct
88 Correct 79 ms 188080 KB Output is correct
89 Correct 83 ms 188164 KB Output is correct
90 Correct 82 ms 188084 KB Output is correct
91 Correct 79 ms 188108 KB Output is correct
92 Correct 80 ms 188108 KB Output is correct
93 Correct 80 ms 188176 KB Output is correct
94 Correct 83 ms 188188 KB Output is correct
95 Correct 79 ms 188148 KB Output is correct
96 Correct 81 ms 188160 KB Output is correct
97 Correct 79 ms 188108 KB Output is correct
98 Correct 87 ms 188108 KB Output is correct
99 Correct 80 ms 188108 KB Output is correct
100 Correct 84 ms 188124 KB Output is correct
101 Correct 93 ms 188112 KB Output is correct
102 Correct 79 ms 188108 KB Output is correct
103 Correct 79 ms 188112 KB Output is correct
104 Correct 85 ms 188112 KB Output is correct
105 Correct 78 ms 188168 KB Output is correct
106 Correct 81 ms 188104 KB Output is correct
107 Correct 82 ms 188136 KB Output is correct
108 Correct 79 ms 188180 KB Output is correct
109 Correct 80 ms 188180 KB Output is correct
110 Correct 82 ms 188492 KB Output is correct
111 Correct 88 ms 189132 KB Output is correct
112 Correct 83 ms 188808 KB Output is correct
113 Correct 141 ms 189388 KB Output is correct
114 Correct 111 ms 189236 KB Output is correct
115 Correct 120 ms 189236 KB Output is correct
116 Correct 94 ms 188696 KB Output is correct
117 Correct 80 ms 188768 KB Output is correct
118 Correct 83 ms 188644 KB Output is correct
119 Correct 128 ms 190416 KB Output is correct
120 Correct 82 ms 189900 KB Output is correct
121 Correct 282 ms 191360 KB Output is correct
122 Correct 408 ms 190796 KB Output is correct
123 Correct 354 ms 190884 KB Output is correct
124 Correct 161 ms 196172 KB Output is correct
125 Correct 178 ms 205644 KB Output is correct
126 Correct 115 ms 203852 KB Output is correct
127 Execution timed out 2095 ms 215628 KB Time limit exceeded
128 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 84 ms 188216 KB Output is correct
2 Correct 78 ms 188112 KB Output is correct
3 Correct 77 ms 188104 KB Output is correct
4 Correct 77 ms 188108 KB Output is correct
5 Correct 78 ms 188060 KB Output is correct
6 Correct 78 ms 188116 KB Output is correct
7 Correct 84 ms 188152 KB Output is correct
8 Correct 80 ms 188132 KB Output is correct
9 Correct 79 ms 188108 KB Output is correct
10 Correct 78 ms 188048 KB Output is correct
11 Correct 79 ms 188088 KB Output is correct
12 Correct 83 ms 188052 KB Output is correct
13 Correct 80 ms 188172 KB Output is correct
14 Correct 80 ms 188256 KB Output is correct
15 Correct 78 ms 188168 KB Output is correct
16 Correct 82 ms 188112 KB Output is correct
17 Correct 80 ms 188232 KB Output is correct
18 Correct 78 ms 188132 KB Output is correct
19 Correct 82 ms 188636 KB Output is correct
20 Correct 82 ms 188720 KB Output is correct
21 Correct 80 ms 188764 KB Output is correct
22 Correct 83 ms 188628 KB Output is correct
23 Correct 83 ms 188620 KB Output is correct
24 Correct 89 ms 188972 KB Output is correct
25 Correct 94 ms 189000 KB Output is correct
26 Correct 81 ms 188744 KB Output is correct
27 Correct 80 ms 188744 KB Output is correct
28 Correct 84 ms 188748 KB Output is correct
29 Correct 89 ms 189516 KB Output is correct
30 Correct 83 ms 188852 KB Output is correct
31 Correct 83 ms 189988 KB Output is correct
32 Correct 91 ms 189564 KB Output is correct
33 Correct 91 ms 189516 KB Output is correct
34 Correct 86 ms 189972 KB Output is correct
35 Correct 85 ms 190052 KB Output is correct
36 Correct 86 ms 189512 KB Output is correct
37 Correct 89 ms 189516 KB Output is correct
38 Correct 80 ms 189520 KB Output is correct
39 Correct 194 ms 201804 KB Output is correct
40 Correct 88 ms 189644 KB Output is correct
41 Correct 83 ms 190468 KB Output is correct
42 Correct 95 ms 190028 KB Output is correct
43 Correct 96 ms 190920 KB Output is correct
44 Correct 100 ms 195232 KB Output is correct
45 Correct 101 ms 195828 KB Output is correct
46 Correct 107 ms 204008 KB Output is correct
47 Correct 198 ms 201996 KB Output is correct
48 Correct 159 ms 201776 KB Output is correct
49 Correct 116 ms 207252 KB Output is correct
50 Correct 116 ms 207232 KB Output is correct
51 Correct 166 ms 202180 KB Output is correct
52 Correct 157 ms 201932 KB Output is correct
53 Correct 168 ms 201884 KB Output is correct
54 Correct 78 ms 188052 KB Output is correct
55 Correct 79 ms 188108 KB Output is correct
56 Correct 81 ms 188076 KB Output is correct
57 Correct 79 ms 188108 KB Output is correct
58 Correct 79 ms 188180 KB Output is correct
59 Correct 80 ms 188112 KB Output is correct
60 Correct 82 ms 188152 KB Output is correct
61 Correct 78 ms 188108 KB Output is correct
62 Correct 82 ms 188096 KB Output is correct
63 Correct 80 ms 188180 KB Output is correct
64 Correct 83 ms 188140 KB Output is correct
65 Correct 83 ms 188188 KB Output is correct
66 Correct 79 ms 188108 KB Output is correct
67 Correct 94 ms 188104 KB Output is correct
68 Correct 79 ms 188152 KB Output is correct
69 Correct 83 ms 188140 KB Output is correct
70 Correct 80 ms 188108 KB Output is correct
71 Correct 91 ms 188276 KB Output is correct
72 Correct 81 ms 188120 KB Output is correct
73 Correct 83 ms 188164 KB Output is correct
74 Correct 81 ms 188164 KB Output is correct
75 Correct 79 ms 188128 KB Output is correct
76 Correct 80 ms 188108 KB Output is correct
77 Correct 80 ms 188108 KB Output is correct
78 Correct 82 ms 188108 KB Output is correct
79 Correct 82 ms 188108 KB Output is correct
80 Correct 81 ms 188144 KB Output is correct
81 Correct 83 ms 188088 KB Output is correct
82 Correct 80 ms 188280 KB Output is correct
83 Correct 80 ms 188124 KB Output is correct
84 Correct 80 ms 188092 KB Output is correct
85 Correct 80 ms 188108 KB Output is correct
86 Correct 80 ms 188088 KB Output is correct
87 Correct 75 ms 188116 KB Output is correct
88 Correct 79 ms 188080 KB Output is correct
89 Correct 83 ms 188164 KB Output is correct
90 Correct 82 ms 188084 KB Output is correct
91 Correct 79 ms 188108 KB Output is correct
92 Correct 80 ms 188108 KB Output is correct
93 Correct 80 ms 188176 KB Output is correct
94 Correct 83 ms 188188 KB Output is correct
95 Correct 79 ms 188148 KB Output is correct
96 Correct 81 ms 188160 KB Output is correct
97 Correct 79 ms 188108 KB Output is correct
98 Correct 87 ms 188108 KB Output is correct
99 Correct 80 ms 188108 KB Output is correct
100 Correct 84 ms 188124 KB Output is correct
101 Correct 93 ms 188112 KB Output is correct
102 Correct 79 ms 188108 KB Output is correct
103 Correct 79 ms 188112 KB Output is correct
104 Correct 85 ms 188112 KB Output is correct
105 Correct 78 ms 188168 KB Output is correct
106 Correct 81 ms 188104 KB Output is correct
107 Correct 82 ms 188136 KB Output is correct
108 Correct 79 ms 188180 KB Output is correct
109 Correct 80 ms 188180 KB Output is correct
110 Correct 82 ms 188492 KB Output is correct
111 Correct 88 ms 189132 KB Output is correct
112 Correct 83 ms 188808 KB Output is correct
113 Correct 141 ms 189388 KB Output is correct
114 Correct 111 ms 189236 KB Output is correct
115 Correct 120 ms 189236 KB Output is correct
116 Correct 94 ms 188696 KB Output is correct
117 Correct 80 ms 188768 KB Output is correct
118 Correct 83 ms 188644 KB Output is correct
119 Correct 128 ms 190416 KB Output is correct
120 Correct 82 ms 189900 KB Output is correct
121 Correct 282 ms 191360 KB Output is correct
122 Correct 408 ms 190796 KB Output is correct
123 Correct 354 ms 190884 KB Output is correct
124 Correct 161 ms 196172 KB Output is correct
125 Correct 178 ms 205644 KB Output is correct
126 Correct 115 ms 203852 KB Output is correct
127 Execution timed out 2095 ms 215628 KB Time limit exceeded
128 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 84 ms 188216 KB Output is correct
2 Correct 78 ms 188112 KB Output is correct
3 Correct 77 ms 188104 KB Output is correct
4 Correct 77 ms 188108 KB Output is correct
5 Correct 78 ms 188060 KB Output is correct
6 Correct 78 ms 188116 KB Output is correct
7 Correct 84 ms 188152 KB Output is correct
8 Correct 80 ms 188132 KB Output is correct
9 Correct 79 ms 188108 KB Output is correct
10 Correct 78 ms 188048 KB Output is correct
11 Correct 79 ms 188088 KB Output is correct
12 Correct 83 ms 188052 KB Output is correct
13 Correct 80 ms 188172 KB Output is correct
14 Correct 80 ms 188256 KB Output is correct
15 Correct 78 ms 188168 KB Output is correct
16 Correct 82 ms 188112 KB Output is correct
17 Correct 80 ms 188232 KB Output is correct
18 Correct 78 ms 188132 KB Output is correct
19 Correct 82 ms 188636 KB Output is correct
20 Correct 82 ms 188720 KB Output is correct
21 Correct 80 ms 188764 KB Output is correct
22 Correct 83 ms 188628 KB Output is correct
23 Correct 83 ms 188620 KB Output is correct
24 Correct 89 ms 188972 KB Output is correct
25 Correct 94 ms 189000 KB Output is correct
26 Correct 81 ms 188744 KB Output is correct
27 Correct 80 ms 188744 KB Output is correct
28 Correct 84 ms 188748 KB Output is correct
29 Correct 89 ms 189516 KB Output is correct
30 Correct 83 ms 188852 KB Output is correct
31 Correct 83 ms 189988 KB Output is correct
32 Correct 91 ms 189564 KB Output is correct
33 Correct 91 ms 189516 KB Output is correct
34 Correct 86 ms 189972 KB Output is correct
35 Correct 85 ms 190052 KB Output is correct
36 Correct 86 ms 189512 KB Output is correct
37 Correct 89 ms 189516 KB Output is correct
38 Correct 80 ms 189520 KB Output is correct
39 Correct 194 ms 201804 KB Output is correct
40 Correct 88 ms 189644 KB Output is correct
41 Correct 83 ms 190468 KB Output is correct
42 Correct 95 ms 190028 KB Output is correct
43 Correct 96 ms 190920 KB Output is correct
44 Correct 100 ms 195232 KB Output is correct
45 Correct 101 ms 195828 KB Output is correct
46 Correct 107 ms 204008 KB Output is correct
47 Correct 198 ms 201996 KB Output is correct
48 Correct 159 ms 201776 KB Output is correct
49 Correct 116 ms 207252 KB Output is correct
50 Correct 116 ms 207232 KB Output is correct
51 Correct 166 ms 202180 KB Output is correct
52 Correct 157 ms 201932 KB Output is correct
53 Correct 168 ms 201884 KB Output is correct
54 Correct 78 ms 188052 KB Output is correct
55 Correct 79 ms 188108 KB Output is correct
56 Correct 81 ms 188076 KB Output is correct
57 Correct 79 ms 188108 KB Output is correct
58 Correct 79 ms 188180 KB Output is correct
59 Correct 80 ms 188112 KB Output is correct
60 Correct 82 ms 188152 KB Output is correct
61 Correct 78 ms 188108 KB Output is correct
62 Correct 82 ms 188096 KB Output is correct
63 Correct 80 ms 188180 KB Output is correct
64 Correct 83 ms 188140 KB Output is correct
65 Correct 83 ms 188188 KB Output is correct
66 Correct 79 ms 188108 KB Output is correct
67 Correct 94 ms 188104 KB Output is correct
68 Correct 79 ms 188152 KB Output is correct
69 Correct 83 ms 188140 KB Output is correct
70 Correct 80 ms 188108 KB Output is correct
71 Correct 91 ms 188276 KB Output is correct
72 Correct 81 ms 188120 KB Output is correct
73 Correct 83 ms 188164 KB Output is correct
74 Correct 81 ms 188164 KB Output is correct
75 Correct 79 ms 188128 KB Output is correct
76 Correct 80 ms 188108 KB Output is correct
77 Correct 80 ms 188108 KB Output is correct
78 Correct 82 ms 188108 KB Output is correct
79 Correct 82 ms 188108 KB Output is correct
80 Correct 81 ms 188144 KB Output is correct
81 Correct 83 ms 188088 KB Output is correct
82 Correct 80 ms 188280 KB Output is correct
83 Correct 80 ms 188124 KB Output is correct
84 Correct 80 ms 188092 KB Output is correct
85 Correct 80 ms 188108 KB Output is correct
86 Correct 80 ms 188088 KB Output is correct
87 Correct 75 ms 188116 KB Output is correct
88 Correct 79 ms 188080 KB Output is correct
89 Correct 83 ms 188164 KB Output is correct
90 Correct 82 ms 188084 KB Output is correct
91 Correct 79 ms 188108 KB Output is correct
92 Correct 80 ms 188108 KB Output is correct
93 Correct 80 ms 188176 KB Output is correct
94 Correct 83 ms 188188 KB Output is correct
95 Correct 79 ms 188148 KB Output is correct
96 Correct 81 ms 188160 KB Output is correct
97 Correct 79 ms 188108 KB Output is correct
98 Correct 87 ms 188108 KB Output is correct
99 Correct 80 ms 188108 KB Output is correct
100 Correct 84 ms 188124 KB Output is correct
101 Correct 93 ms 188112 KB Output is correct
102 Correct 79 ms 188108 KB Output is correct
103 Correct 79 ms 188112 KB Output is correct
104 Correct 85 ms 188112 KB Output is correct
105 Correct 78 ms 188168 KB Output is correct
106 Correct 81 ms 188104 KB Output is correct
107 Correct 82 ms 188136 KB Output is correct
108 Correct 79 ms 188180 KB Output is correct
109 Correct 80 ms 188180 KB Output is correct
110 Correct 82 ms 188492 KB Output is correct
111 Correct 88 ms 189132 KB Output is correct
112 Correct 83 ms 188808 KB Output is correct
113 Correct 141 ms 189388 KB Output is correct
114 Correct 111 ms 189236 KB Output is correct
115 Correct 120 ms 189236 KB Output is correct
116 Correct 94 ms 188696 KB Output is correct
117 Correct 80 ms 188768 KB Output is correct
118 Correct 83 ms 188644 KB Output is correct
119 Correct 128 ms 190416 KB Output is correct
120 Correct 82 ms 189900 KB Output is correct
121 Correct 282 ms 191360 KB Output is correct
122 Correct 408 ms 190796 KB Output is correct
123 Correct 354 ms 190884 KB Output is correct
124 Correct 161 ms 196172 KB Output is correct
125 Correct 178 ms 205644 KB Output is correct
126 Correct 115 ms 203852 KB Output is correct
127 Execution timed out 2095 ms 215628 KB Time limit exceeded
128 Halted 0 ms 0 KB -