답안 #1061640

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1061640 2024-08-16T11:22:29 Z beaconmc Maze (JOI23_ho_t3) C++14
51 / 100
2000 ms 60820 KB
#include <bits/stdc++.h>
 
typedef long long ll;
#define FOR(i,x,y) for(ll i=x; i<y; i++)
#define FORNEG(i,x,y) for(ll i=x; i>y; i--)
 
using namespace std;

ll r,c,n;



vector<vector<ll>> grid;
vector<vector<ll>> visited;



bool iswithin(ll a, ll b, ll x, ll y){
	ll A = abs(x-a), B = abs(y-b);
	if ((A<=n && B < n) ||(A<n && B <= n)){
		return 1;
	}
	return 0;
}

vector<array<ll,2>> getvalid(ll a, ll b){
	vector<array<ll,2>> ans;

	FOR(i,-(n-1), n){
		ans.push_back({a-n, b+i});
		ans.push_back({a+n, b+i});
		ans.push_back({a+i, b-n});
		ans.push_back({a+i, b+n});
	}

	
	// FOR(i,a-n,a+n+1){
	// 	if (iswithin(a, b, i, c-1)) ans.push_back({i, c-1}); 
	// 	if (iswithin(a, b, i, 0)) ans.push_back({i, 0}); 
	// }
	// FOR(i,b-n,b+n+1){
	// 	if (iswithin(a,b,r-1,i)) ans.push_back({r-1, i});
	// 	if (iswithin(a,b,0,i)) ans.push_back({0, i});
	// }

	vector<array<ll,2>> realans;

	for (auto&i : ans){
		if (0<=i[0] && i[0]<r && 0<=i[1] && i[1]<c) realans.push_back(i);
	}

	return realans;
}



int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> r >> c >> n;

	ll a,b;
	ll x,y;
	cin >> a >> b >> x >> y;
	a--;b--;x--;y--;
	
	FOR(i,0,r){

		vector<ll> temp;
		vector<ll> idk;

		string temp2;
		cin >> temp2;
		FOR(j,0,c){
			temp.push_back(temp2[j]);
			idk.push_back(100000000);

		}
		grid.push_back(temp);
		visited.push_back(idk);

	}




	ll ans = -1;

	deque<vector<ll>> sus;



	sus.push_back({a,b,0});
	visited[a][b] = 0;

	while (sus.size()){
		vector<ll> node = sus.front();
		sus.pop_front();


		if (visited[node[0]][node[1]] != node[2]) continue;


		if (node[0] == x && node[1] == y){
			ans = node[2];
			break;
		}
		if (iswithin(node[0],node[1],x,y)){
			if (visited[x][y]> node[2]+1){
				visited[x][y] = node[2]+1;
				sus.push_back({x,y,node[2]+1});
			}
			
		}


		vector<array<ll,2>> pos = {{node[0]-1,node[1]},{node[0]+1,node[1]},{node[0],node[1]-1},{node[0],node[1]+1}};

		vector<array<ll,2>> temp = getvalid(node[0], node[1]);

		for (auto&i : pos){
			if (0<=i[0] && i[0]<r && 0<=i[1] && i[1]<c){

				if (grid[i[0]][i[1]] == '.'){
					if (visited[i[0]][i[1]] > node[2]){
						visited[i[0]][i[1]] = node[2];
						sus.push_front({i[0], i[1], node[2]});
					}
				}
			}
		}

		for (auto&i : temp){
			if (visited[i[0]][i[1]] > node[2]+1){
				visited[i[0]][i[1]] = node[2]+1;
				sus.push_back({i[0], i[1], node[2]+1});
			}
		}

	}

	cout << ans << endl;








}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 472 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 504 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 10 ms 1440 KB Output is correct
20 Correct 12 ms 2076 KB Output is correct
21 Correct 10 ms 2908 KB Output is correct
22 Correct 19 ms 1480 KB Output is correct
23 Correct 11 ms 1372 KB Output is correct
24 Correct 18 ms 2592 KB Output is correct
25 Correct 8 ms 2592 KB Output is correct
26 Correct 1 ms 1372 KB Output is correct
27 Correct 3 ms 1372 KB Output is correct
28 Correct 5 ms 1372 KB Output is correct
29 Correct 49 ms 2908 KB Output is correct
30 Correct 8 ms 2040 KB Output is correct
31 Correct 18 ms 5060 KB Output is correct
32 Correct 48 ms 2904 KB Output is correct
33 Correct 25 ms 2904 KB Output is correct
34 Correct 32 ms 5452 KB Output is correct
35 Correct 23 ms 5452 KB Output is correct
36 Correct 17 ms 3172 KB Output is correct
37 Correct 45 ms 2908 KB Output is correct
38 Correct 3 ms 2904 KB Output is correct
39 Correct 368 ms 28532 KB Output is correct
40 Correct 13 ms 3512 KB Output is correct
41 Correct 20 ms 6420 KB Output is correct
42 Correct 52 ms 4736 KB Output is correct
43 Correct 44 ms 6688 KB Output is correct
44 Correct 64 ms 14840 KB Output is correct
45 Correct 66 ms 16264 KB Output is correct
46 Correct 303 ms 43300 KB Output is correct
47 Correct 337 ms 28564 KB Output is correct
48 Correct 258 ms 28496 KB Output is correct
49 Correct 187 ms 53968 KB Output is correct
50 Correct 156 ms 51936 KB Output is correct
51 Correct 257 ms 29144 KB Output is correct
52 Correct 171 ms 28752 KB Output is correct
53 Correct 283 ms 28612 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 2 ms 344 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 344 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 0 ms 348 KB Output is correct
29 Correct 1 ms 344 KB Output is correct
30 Correct 0 ms 344 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 1 ms 512 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 2 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 1 ms 344 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 376 KB Output is correct
17 Correct 0 ms 356 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 344 KB Output is correct
25 Correct 3 ms 1116 KB Output is correct
26 Correct 27 ms 4524 KB Output is correct
27 Correct 10 ms 3144 KB Output is correct
28 Correct 375 ms 2424 KB Output is correct
29 Correct 1 ms 1372 KB Output is correct
30 Correct 1 ms 1372 KB Output is correct
31 Correct 95 ms 1620 KB Output is correct
32 Correct 2 ms 1372 KB Output is correct
33 Correct 2 ms 1372 KB Output is correct
34 Correct 9 ms 5064 KB Output is correct
35 Correct 15 ms 4956 KB Output is correct
36 Correct 1018 ms 4604 KB Output is correct
37 Correct 3 ms 3188 KB Output is correct
38 Correct 2 ms 3164 KB Output is correct
39 Correct 669 ms 34576 KB Output is correct
40 Execution timed out 2075 ms 60820 KB Time limit exceeded
41 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 2 ms 344 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 344 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 0 ms 348 KB Output is correct
29 Correct 1 ms 344 KB Output is correct
30 Correct 0 ms 344 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 1 ms 512 KB Output is correct
33 Correct 9 ms 1372 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 1 ms 612 KB Output is correct
36 Correct 3 ms 1116 KB Output is correct
37 Correct 8 ms 2080 KB Output is correct
38 Correct 33 ms 4452 KB Output is correct
39 Correct 10 ms 3124 KB Output is correct
40 Correct 11 ms 1372 KB Output is correct
41 Correct 11 ms 1428 KB Output is correct
42 Correct 404 ms 2384 KB Output is correct
43 Correct 1 ms 1372 KB Output is correct
44 Correct 1 ms 1372 KB Output is correct
45 Correct 11 ms 2592 KB Output is correct
46 Correct 7 ms 2592 KB Output is correct
47 Correct 14 ms 2048 KB Output is correct
48 Correct 61 ms 1372 KB Output is correct
49 Correct 71 ms 1372 KB Output is correct
50 Correct 171 ms 1372 KB Output is correct
51 Correct 95 ms 1788 KB Output is correct
52 Correct 2 ms 1372 KB Output is correct
53 Correct 1 ms 1372 KB Output is correct
54 Correct 11 ms 1476 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 2 ms 344 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 0 ms 344 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 0 ms 348 KB Output is correct
24 Correct 0 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 0 ms 348 KB Output is correct
28 Correct 0 ms 348 KB Output is correct
29 Correct 1 ms 344 KB Output is correct
30 Correct 0 ms 344 KB Output is correct
31 Correct 0 ms 348 KB Output is correct
32 Correct 1 ms 512 KB Output is correct
33 Correct 9 ms 1372 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 1 ms 612 KB Output is correct
36 Correct 3 ms 1116 KB Output is correct
37 Correct 8 ms 2080 KB Output is correct
38 Correct 33 ms 4452 KB Output is correct
39 Correct 10 ms 3124 KB Output is correct
40 Correct 11 ms 1372 KB Output is correct
41 Correct 11 ms 1428 KB Output is correct
42 Correct 404 ms 2384 KB Output is correct
43 Correct 1 ms 1372 KB Output is correct
44 Correct 1 ms 1372 KB Output is correct
45 Correct 11 ms 2592 KB Output is correct
46 Correct 7 ms 2592 KB Output is correct
47 Correct 14 ms 2048 KB Output is correct
48 Correct 61 ms 1372 KB Output is correct
49 Correct 71 ms 1372 KB Output is correct
50 Correct 171 ms 1372 KB Output is correct
51 Correct 95 ms 1788 KB Output is correct
52 Correct 2 ms 1372 KB Output is correct
53 Correct 1 ms 1372 KB Output is correct
54 Correct 11 ms 1476 KB Output is correct
55 Correct 32 ms 2908 KB Output is correct
56 Correct 8 ms 2036 KB Output is correct
57 Correct 13 ms 4956 KB Output is correct
58 Correct 46 ms 2820 KB Output is correct
59 Correct 15 ms 4956 KB Output is correct
60 Correct 55 ms 2956 KB Output is correct
61 Correct 25 ms 2908 KB Output is correct
62 Correct 980 ms 4604 KB Output is correct
63 Correct 3 ms 3164 KB Output is correct
64 Correct 3 ms 3164 KB Output is correct
65 Correct 26 ms 5452 KB Output is correct
66 Correct 22 ms 5464 KB Output is correct
67 Correct 42 ms 4336 KB Output is correct
68 Correct 234 ms 3164 KB Output is correct
69 Correct 396 ms 3144 KB Output is correct
70 Correct 629 ms 3496 KB Output is correct
71 Correct 823 ms 4132 KB Output is correct
72 Correct 23 ms 3636 KB Output is correct
73 Correct 27 ms 3120 KB Output is correct
74 Correct 4 ms 2908 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 472 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 504 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 10 ms 1440 KB Output is correct
20 Correct 12 ms 2076 KB Output is correct
21 Correct 10 ms 2908 KB Output is correct
22 Correct 19 ms 1480 KB Output is correct
23 Correct 11 ms 1372 KB Output is correct
24 Correct 18 ms 2592 KB Output is correct
25 Correct 8 ms 2592 KB Output is correct
26 Correct 1 ms 1372 KB Output is correct
27 Correct 3 ms 1372 KB Output is correct
28 Correct 5 ms 1372 KB Output is correct
29 Correct 49 ms 2908 KB Output is correct
30 Correct 8 ms 2040 KB Output is correct
31 Correct 18 ms 5060 KB Output is correct
32 Correct 48 ms 2904 KB Output is correct
33 Correct 25 ms 2904 KB Output is correct
34 Correct 32 ms 5452 KB Output is correct
35 Correct 23 ms 5452 KB Output is correct
36 Correct 17 ms 3172 KB Output is correct
37 Correct 45 ms 2908 KB Output is correct
38 Correct 3 ms 2904 KB Output is correct
39 Correct 368 ms 28532 KB Output is correct
40 Correct 13 ms 3512 KB Output is correct
41 Correct 20 ms 6420 KB Output is correct
42 Correct 52 ms 4736 KB Output is correct
43 Correct 44 ms 6688 KB Output is correct
44 Correct 64 ms 14840 KB Output is correct
45 Correct 66 ms 16264 KB Output is correct
46 Correct 303 ms 43300 KB Output is correct
47 Correct 337 ms 28564 KB Output is correct
48 Correct 258 ms 28496 KB Output is correct
49 Correct 187 ms 53968 KB Output is correct
50 Correct 156 ms 51936 KB Output is correct
51 Correct 257 ms 29144 KB Output is correct
52 Correct 171 ms 28752 KB Output is correct
53 Correct 283 ms 28612 KB Output is correct
54 Correct 1 ms 344 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 1 ms 348 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 0 ms 348 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 1 ms 348 KB Output is correct
61 Correct 1 ms 348 KB Output is correct
62 Correct 0 ms 348 KB Output is correct
63 Correct 1 ms 344 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 2 ms 344 KB Output is correct
66 Correct 0 ms 348 KB Output is correct
67 Correct 0 ms 348 KB Output is correct
68 Correct 0 ms 348 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 1 ms 348 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 0 ms 348 KB Output is correct
74 Correct 0 ms 344 KB Output is correct
75 Correct 1 ms 348 KB Output is correct
76 Correct 0 ms 348 KB Output is correct
77 Correct 0 ms 348 KB Output is correct
78 Correct 0 ms 348 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 0 ms 348 KB Output is correct
81 Correct 0 ms 348 KB Output is correct
82 Correct 1 ms 344 KB Output is correct
83 Correct 0 ms 344 KB Output is correct
84 Correct 0 ms 348 KB Output is correct
85 Correct 1 ms 512 KB Output is correct
86 Correct 1 ms 348 KB Output is correct
87 Correct 1 ms 348 KB Output is correct
88 Correct 0 ms 348 KB Output is correct
89 Correct 0 ms 348 KB Output is correct
90 Correct 0 ms 348 KB Output is correct
91 Correct 1 ms 348 KB Output is correct
92 Correct 1 ms 348 KB Output is correct
93 Correct 0 ms 348 KB Output is correct
94 Correct 2 ms 348 KB Output is correct
95 Correct 0 ms 348 KB Output is correct
96 Correct 0 ms 348 KB Output is correct
97 Correct 1 ms 344 KB Output is correct
98 Correct 1 ms 348 KB Output is correct
99 Correct 1 ms 344 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 0 ms 376 KB Output is correct
102 Correct 0 ms 356 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 0 ms 348 KB Output is correct
105 Correct 0 ms 348 KB Output is correct
106 Correct 0 ms 348 KB Output is correct
107 Correct 0 ms 348 KB Output is correct
108 Correct 0 ms 348 KB Output is correct
109 Correct 0 ms 344 KB Output is correct
110 Correct 3 ms 1116 KB Output is correct
111 Correct 27 ms 4524 KB Output is correct
112 Correct 10 ms 3144 KB Output is correct
113 Correct 375 ms 2424 KB Output is correct
114 Correct 1 ms 1372 KB Output is correct
115 Correct 1 ms 1372 KB Output is correct
116 Correct 95 ms 1620 KB Output is correct
117 Correct 2 ms 1372 KB Output is correct
118 Correct 2 ms 1372 KB Output is correct
119 Correct 9 ms 5064 KB Output is correct
120 Correct 15 ms 4956 KB Output is correct
121 Correct 1018 ms 4604 KB Output is correct
122 Correct 3 ms 3188 KB Output is correct
123 Correct 2 ms 3164 KB Output is correct
124 Correct 669 ms 34576 KB Output is correct
125 Execution timed out 2075 ms 60820 KB Time limit exceeded
126 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 472 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 504 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 10 ms 1440 KB Output is correct
20 Correct 12 ms 2076 KB Output is correct
21 Correct 10 ms 2908 KB Output is correct
22 Correct 19 ms 1480 KB Output is correct
23 Correct 11 ms 1372 KB Output is correct
24 Correct 18 ms 2592 KB Output is correct
25 Correct 8 ms 2592 KB Output is correct
26 Correct 1 ms 1372 KB Output is correct
27 Correct 3 ms 1372 KB Output is correct
28 Correct 5 ms 1372 KB Output is correct
29 Correct 49 ms 2908 KB Output is correct
30 Correct 8 ms 2040 KB Output is correct
31 Correct 18 ms 5060 KB Output is correct
32 Correct 48 ms 2904 KB Output is correct
33 Correct 25 ms 2904 KB Output is correct
34 Correct 32 ms 5452 KB Output is correct
35 Correct 23 ms 5452 KB Output is correct
36 Correct 17 ms 3172 KB Output is correct
37 Correct 45 ms 2908 KB Output is correct
38 Correct 3 ms 2904 KB Output is correct
39 Correct 368 ms 28532 KB Output is correct
40 Correct 13 ms 3512 KB Output is correct
41 Correct 20 ms 6420 KB Output is correct
42 Correct 52 ms 4736 KB Output is correct
43 Correct 44 ms 6688 KB Output is correct
44 Correct 64 ms 14840 KB Output is correct
45 Correct 66 ms 16264 KB Output is correct
46 Correct 303 ms 43300 KB Output is correct
47 Correct 337 ms 28564 KB Output is correct
48 Correct 258 ms 28496 KB Output is correct
49 Correct 187 ms 53968 KB Output is correct
50 Correct 156 ms 51936 KB Output is correct
51 Correct 257 ms 29144 KB Output is correct
52 Correct 171 ms 28752 KB Output is correct
53 Correct 283 ms 28612 KB Output is correct
54 Correct 1 ms 344 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 1 ms 348 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 0 ms 348 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 1 ms 348 KB Output is correct
61 Correct 1 ms 348 KB Output is correct
62 Correct 0 ms 348 KB Output is correct
63 Correct 1 ms 344 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 2 ms 344 KB Output is correct
66 Correct 0 ms 348 KB Output is correct
67 Correct 0 ms 348 KB Output is correct
68 Correct 0 ms 348 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 1 ms 348 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 0 ms 348 KB Output is correct
74 Correct 0 ms 344 KB Output is correct
75 Correct 1 ms 348 KB Output is correct
76 Correct 0 ms 348 KB Output is correct
77 Correct 0 ms 348 KB Output is correct
78 Correct 0 ms 348 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 0 ms 348 KB Output is correct
81 Correct 0 ms 348 KB Output is correct
82 Correct 1 ms 344 KB Output is correct
83 Correct 0 ms 344 KB Output is correct
84 Correct 0 ms 348 KB Output is correct
85 Correct 1 ms 512 KB Output is correct
86 Correct 1 ms 348 KB Output is correct
87 Correct 1 ms 348 KB Output is correct
88 Correct 0 ms 348 KB Output is correct
89 Correct 0 ms 348 KB Output is correct
90 Correct 0 ms 348 KB Output is correct
91 Correct 1 ms 348 KB Output is correct
92 Correct 1 ms 348 KB Output is correct
93 Correct 0 ms 348 KB Output is correct
94 Correct 2 ms 348 KB Output is correct
95 Correct 0 ms 348 KB Output is correct
96 Correct 0 ms 348 KB Output is correct
97 Correct 1 ms 344 KB Output is correct
98 Correct 1 ms 348 KB Output is correct
99 Correct 1 ms 344 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 0 ms 376 KB Output is correct
102 Correct 0 ms 356 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 0 ms 348 KB Output is correct
105 Correct 0 ms 348 KB Output is correct
106 Correct 0 ms 348 KB Output is correct
107 Correct 0 ms 348 KB Output is correct
108 Correct 0 ms 348 KB Output is correct
109 Correct 0 ms 344 KB Output is correct
110 Correct 3 ms 1116 KB Output is correct
111 Correct 27 ms 4524 KB Output is correct
112 Correct 10 ms 3144 KB Output is correct
113 Correct 375 ms 2424 KB Output is correct
114 Correct 1 ms 1372 KB Output is correct
115 Correct 1 ms 1372 KB Output is correct
116 Correct 95 ms 1620 KB Output is correct
117 Correct 2 ms 1372 KB Output is correct
118 Correct 2 ms 1372 KB Output is correct
119 Correct 9 ms 5064 KB Output is correct
120 Correct 15 ms 4956 KB Output is correct
121 Correct 1018 ms 4604 KB Output is correct
122 Correct 3 ms 3188 KB Output is correct
123 Correct 2 ms 3164 KB Output is correct
124 Correct 669 ms 34576 KB Output is correct
125 Execution timed out 2075 ms 60820 KB Time limit exceeded
126 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 472 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 504 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 10 ms 1440 KB Output is correct
20 Correct 12 ms 2076 KB Output is correct
21 Correct 10 ms 2908 KB Output is correct
22 Correct 19 ms 1480 KB Output is correct
23 Correct 11 ms 1372 KB Output is correct
24 Correct 18 ms 2592 KB Output is correct
25 Correct 8 ms 2592 KB Output is correct
26 Correct 1 ms 1372 KB Output is correct
27 Correct 3 ms 1372 KB Output is correct
28 Correct 5 ms 1372 KB Output is correct
29 Correct 49 ms 2908 KB Output is correct
30 Correct 8 ms 2040 KB Output is correct
31 Correct 18 ms 5060 KB Output is correct
32 Correct 48 ms 2904 KB Output is correct
33 Correct 25 ms 2904 KB Output is correct
34 Correct 32 ms 5452 KB Output is correct
35 Correct 23 ms 5452 KB Output is correct
36 Correct 17 ms 3172 KB Output is correct
37 Correct 45 ms 2908 KB Output is correct
38 Correct 3 ms 2904 KB Output is correct
39 Correct 368 ms 28532 KB Output is correct
40 Correct 13 ms 3512 KB Output is correct
41 Correct 20 ms 6420 KB Output is correct
42 Correct 52 ms 4736 KB Output is correct
43 Correct 44 ms 6688 KB Output is correct
44 Correct 64 ms 14840 KB Output is correct
45 Correct 66 ms 16264 KB Output is correct
46 Correct 303 ms 43300 KB Output is correct
47 Correct 337 ms 28564 KB Output is correct
48 Correct 258 ms 28496 KB Output is correct
49 Correct 187 ms 53968 KB Output is correct
50 Correct 156 ms 51936 KB Output is correct
51 Correct 257 ms 29144 KB Output is correct
52 Correct 171 ms 28752 KB Output is correct
53 Correct 283 ms 28612 KB Output is correct
54 Correct 1 ms 344 KB Output is correct
55 Correct 0 ms 348 KB Output is correct
56 Correct 1 ms 348 KB Output is correct
57 Correct 0 ms 348 KB Output is correct
58 Correct 0 ms 348 KB Output is correct
59 Correct 0 ms 348 KB Output is correct
60 Correct 1 ms 348 KB Output is correct
61 Correct 1 ms 348 KB Output is correct
62 Correct 0 ms 348 KB Output is correct
63 Correct 1 ms 344 KB Output is correct
64 Correct 1 ms 348 KB Output is correct
65 Correct 2 ms 344 KB Output is correct
66 Correct 0 ms 348 KB Output is correct
67 Correct 0 ms 348 KB Output is correct
68 Correct 0 ms 348 KB Output is correct
69 Correct 1 ms 348 KB Output is correct
70 Correct 1 ms 348 KB Output is correct
71 Correct 1 ms 348 KB Output is correct
72 Correct 1 ms 348 KB Output is correct
73 Correct 0 ms 348 KB Output is correct
74 Correct 0 ms 344 KB Output is correct
75 Correct 1 ms 348 KB Output is correct
76 Correct 0 ms 348 KB Output is correct
77 Correct 0 ms 348 KB Output is correct
78 Correct 0 ms 348 KB Output is correct
79 Correct 0 ms 348 KB Output is correct
80 Correct 0 ms 348 KB Output is correct
81 Correct 0 ms 348 KB Output is correct
82 Correct 1 ms 344 KB Output is correct
83 Correct 0 ms 344 KB Output is correct
84 Correct 0 ms 348 KB Output is correct
85 Correct 1 ms 512 KB Output is correct
86 Correct 1 ms 348 KB Output is correct
87 Correct 1 ms 348 KB Output is correct
88 Correct 0 ms 348 KB Output is correct
89 Correct 0 ms 348 KB Output is correct
90 Correct 0 ms 348 KB Output is correct
91 Correct 1 ms 348 KB Output is correct
92 Correct 1 ms 348 KB Output is correct
93 Correct 0 ms 348 KB Output is correct
94 Correct 2 ms 348 KB Output is correct
95 Correct 0 ms 348 KB Output is correct
96 Correct 0 ms 348 KB Output is correct
97 Correct 1 ms 344 KB Output is correct
98 Correct 1 ms 348 KB Output is correct
99 Correct 1 ms 344 KB Output is correct
100 Correct 0 ms 348 KB Output is correct
101 Correct 0 ms 376 KB Output is correct
102 Correct 0 ms 356 KB Output is correct
103 Correct 0 ms 348 KB Output is correct
104 Correct 0 ms 348 KB Output is correct
105 Correct 0 ms 348 KB Output is correct
106 Correct 0 ms 348 KB Output is correct
107 Correct 0 ms 348 KB Output is correct
108 Correct 0 ms 348 KB Output is correct
109 Correct 0 ms 344 KB Output is correct
110 Correct 3 ms 1116 KB Output is correct
111 Correct 27 ms 4524 KB Output is correct
112 Correct 10 ms 3144 KB Output is correct
113 Correct 375 ms 2424 KB Output is correct
114 Correct 1 ms 1372 KB Output is correct
115 Correct 1 ms 1372 KB Output is correct
116 Correct 95 ms 1620 KB Output is correct
117 Correct 2 ms 1372 KB Output is correct
118 Correct 2 ms 1372 KB Output is correct
119 Correct 9 ms 5064 KB Output is correct
120 Correct 15 ms 4956 KB Output is correct
121 Correct 1018 ms 4604 KB Output is correct
122 Correct 3 ms 3188 KB Output is correct
123 Correct 2 ms 3164 KB Output is correct
124 Correct 669 ms 34576 KB Output is correct
125 Execution timed out 2075 ms 60820 KB Time limit exceeded
126 Halted 0 ms 0 KB -