답안 #1041680

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1041680 2024-08-02T07:03:43 Z 김기범(#11055) Brought Down the Grading Server? (CEOI23_balance) C++17
100 / 100
353 ms 51800 KB
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

vector<vector<int>> ans;
vector<array<int, 2>> pos[100100];

void dnc(const vector<vector<int>> &a){
	if (a[0].size() == 1){
		for (int i=0;i<(int)a.size();i++) ans[i].push_back(a[i][0]);
		return;
	}

	int n = a.size(), s = a[0].size();
	vector<vector<int>> L(n), R(n), used(n, vector<int>(s));

	for (int i=0;i<n;i++){
		for (int j=0;j<s;j++) pos[a[i][j]].push_back({i, j});
	}

	int l = -1, r = -1, x = n-1, y = s-1;
	while(x >= 0 && y >= 0){
		if (used[x][y]){
			if (y==0) x--, y = s-1;
			else y--;
			continue;
		}

		L[x].push_back(a[x][y]); used[x][y] = 1;
		r = a[x][y];

		R[x].push_back(a[x][y-1]); used[x][y-1] = 1;
		l = a[x][y-1];

		if (l == r) continue;

		while(!pos[l].empty() && used[pos[l].back()[0]][pos[l].back()[1]]) pos[l].pop_back();
		while(!pos[r].empty() && used[pos[r].back()[0]][pos[r].back()[1]]) pos[r].pop_back();

		if (pos[l].empty() && pos[r].empty()){l = r = -1; continue;}

		while(!pos[l].empty() && l!=r){
			auto [cx, cy] = pos[l].back();
			pos[l].pop_back();

			L[cx].push_back(a[cx][cy]); used[cx][cy] = 1;
			R[cx].push_back(a[cx][cy^1]); used[cx][cy^1] = 1;

			l = a[cx][cy^1];
			while(!pos[l].empty() && used[pos[l].back()[0]][pos[l].back()[1]]) pos[l].pop_back();
		}

		if (l==r) continue;
		l = -1;

		while(!pos[r].empty()){
			auto [cx, cy] = pos[r].back();
			pos[r].pop_back();

			L[cx].push_back(a[cx][cy^1]); used[cx][cy^1] = 1;
			R[cx].push_back(a[cx][cy]); used[cx][cy] = 1;

			r = a[cx][cy^1];
			while(!pos[r].empty() && used[pos[r].back()[0]][pos[r].back()[1]]) pos[r].pop_back();
		}

		r = -1;

	}

	for (int i=0;i<n;i++){
		for (int j=0;j<s;j++) pos[a[i][j]].clear();
	}

	dnc(L); dnc(R);

}

int main(){
	int n, s, t;
	scanf("%d %d %d", &n, &s, &t);

	vector<vector<int>> a(n, vector<int>(s));
	ans.resize(n);

	for (int i=0;i<n;i++){
		for (int j=0;j<s;j++) scanf("%d", &a[i][j]);
	}

	dnc(a);

	for (int i=0;i<n;i++){
		for (int j=0;j<s;j++){
			printf("%d ", ans[i][j]);
		}	
		printf("\n");
	} 
}

Compilation message

balance.cpp: In function 'int main()':
balance.cpp:82:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   82 |  scanf("%d %d %d", &n, &s, &t);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
balance.cpp:88:30: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   88 |   for (int j=0;j<s;j++) scanf("%d", &a[i][j]);
      |                         ~~~~~^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2648 KB Correct
2 Correct 0 ms 2648 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2652 KB Correct
2 Correct 0 ms 2652 KB Correct
3 Correct 1 ms 2652 KB Correct
4 Correct 1 ms 2652 KB Correct
5 Correct 1 ms 2652 KB Correct
6 Correct 0 ms 2652 KB Correct
7 Correct 1 ms 2648 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 86 ms 32840 KB Correct
2 Correct 75 ms 32140 KB Correct
3 Correct 89 ms 29524 KB Correct
4 Correct 45 ms 31696 KB Correct
5 Correct 63 ms 32196 KB Correct
6 Correct 82 ms 33104 KB Correct
7 Correct 80 ms 33100 KB Correct
8 Correct 59 ms 33112 KB Correct
9 Correct 56 ms 33116 KB Correct
10 Correct 49 ms 33108 KB Correct
11 Correct 49 ms 33108 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 86 ms 32840 KB Correct
2 Correct 75 ms 32140 KB Correct
3 Correct 89 ms 29524 KB Correct
4 Correct 45 ms 31696 KB Correct
5 Correct 63 ms 32196 KB Correct
6 Correct 82 ms 33104 KB Correct
7 Correct 80 ms 33100 KB Correct
8 Correct 59 ms 33112 KB Correct
9 Correct 56 ms 33116 KB Correct
10 Correct 49 ms 33108 KB Correct
11 Correct 49 ms 33108 KB Correct
12 Correct 81 ms 32788 KB Correct
13 Correct 82 ms 32204 KB Correct
14 Correct 67 ms 29524 KB Correct
15 Correct 48 ms 31700 KB Correct
16 Correct 77 ms 32200 KB Correct
17 Correct 79 ms 33144 KB Correct
18 Correct 79 ms 33108 KB Correct
19 Correct 58 ms 33108 KB Correct
20 Correct 60 ms 33116 KB Correct
21 Correct 52 ms 33104 KB Correct
22 Correct 51 ms 33084 KB Correct
23 Correct 76 ms 33360 KB Correct
24 Correct 51 ms 31568 KB Correct
25 Correct 84 ms 32596 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2652 KB Correct
2 Correct 0 ms 2652 KB Correct
3 Correct 1 ms 2652 KB Correct
4 Correct 1 ms 2652 KB Correct
5 Correct 1 ms 2652 KB Correct
6 Correct 0 ms 2652 KB Correct
7 Correct 1 ms 2648 KB Correct
8 Correct 86 ms 32840 KB Correct
9 Correct 75 ms 32140 KB Correct
10 Correct 89 ms 29524 KB Correct
11 Correct 45 ms 31696 KB Correct
12 Correct 63 ms 32196 KB Correct
13 Correct 82 ms 33104 KB Correct
14 Correct 80 ms 33100 KB Correct
15 Correct 59 ms 33112 KB Correct
16 Correct 56 ms 33116 KB Correct
17 Correct 49 ms 33108 KB Correct
18 Correct 49 ms 33108 KB Correct
19 Correct 81 ms 32788 KB Correct
20 Correct 82 ms 32204 KB Correct
21 Correct 67 ms 29524 KB Correct
22 Correct 48 ms 31700 KB Correct
23 Correct 77 ms 32200 KB Correct
24 Correct 79 ms 33144 KB Correct
25 Correct 79 ms 33108 KB Correct
26 Correct 58 ms 33108 KB Correct
27 Correct 60 ms 33116 KB Correct
28 Correct 52 ms 33104 KB Correct
29 Correct 51 ms 33084 KB Correct
30 Correct 76 ms 33360 KB Correct
31 Correct 51 ms 31568 KB Correct
32 Correct 84 ms 32596 KB Correct
33 Correct 1 ms 2652 KB Correct
34 Correct 0 ms 2652 KB Correct
35 Correct 0 ms 2652 KB Correct
36 Correct 1 ms 2652 KB Correct
37 Correct 1 ms 2648 KB Correct
38 Correct 1 ms 2648 KB Correct
39 Correct 0 ms 2652 KB Correct
40 Correct 81 ms 32848 KB Correct
41 Correct 82 ms 32200 KB Correct
42 Correct 66 ms 29552 KB Correct
43 Correct 44 ms 31692 KB Correct
44 Correct 66 ms 32208 KB Correct
45 Correct 84 ms 33028 KB Correct
46 Correct 74 ms 33044 KB Correct
47 Correct 58 ms 33104 KB Correct
48 Correct 62 ms 33104 KB Correct
49 Correct 48 ms 33104 KB Correct
50 Correct 51 ms 33112 KB Correct
51 Correct 82 ms 33356 KB Correct
52 Correct 59 ms 31412 KB Correct
53 Correct 85 ms 32592 KB Correct
54 Correct 37 ms 18520 KB Correct
55 Correct 2 ms 2908 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2652 KB Correct
2 Correct 4 ms 3164 KB Correct
3 Correct 5 ms 3116 KB Correct
4 Correct 3 ms 3932 KB Correct
5 Correct 2 ms 4188 KB Correct
6 Correct 4 ms 4188 KB Correct
7 Correct 4 ms 3928 KB Correct
8 Correct 4 ms 3676 KB Correct
9 Correct 3 ms 3676 KB Correct
10 Correct 3 ms 3972 KB Correct
11 Correct 4 ms 3928 KB Correct
12 Correct 3 ms 4188 KB Correct
13 Correct 3 ms 4188 KB Correct
14 Correct 3 ms 4188 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2652 KB Correct
2 Correct 4 ms 3164 KB Correct
3 Correct 5 ms 3116 KB Correct
4 Correct 3 ms 3932 KB Correct
5 Correct 2 ms 4188 KB Correct
6 Correct 4 ms 4188 KB Correct
7 Correct 4 ms 3928 KB Correct
8 Correct 4 ms 3676 KB Correct
9 Correct 3 ms 3676 KB Correct
10 Correct 3 ms 3972 KB Correct
11 Correct 4 ms 3928 KB Correct
12 Correct 3 ms 4188 KB Correct
13 Correct 3 ms 4188 KB Correct
14 Correct 3 ms 4188 KB Correct
15 Correct 1 ms 2652 KB Correct
16 Correct 5 ms 3164 KB Correct
17 Correct 4 ms 2908 KB Correct
18 Correct 4 ms 3996 KB Correct
19 Correct 3 ms 4188 KB Correct
20 Correct 3 ms 4188 KB Correct
21 Correct 3 ms 3784 KB Correct
22 Correct 4 ms 3676 KB Correct
23 Correct 4 ms 3676 KB Correct
24 Correct 3 ms 3932 KB Correct
25 Correct 4 ms 3932 KB Correct
26 Correct 3 ms 4188 KB Correct
27 Correct 3 ms 4188 KB Correct
28 Correct 3 ms 4188 KB Correct
29 Correct 4 ms 3264 KB Correct
30 Correct 4 ms 3932 KB Correct
31 Correct 4 ms 3716 KB Correct
32 Correct 4 ms 3932 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2652 KB Correct
2 Correct 4 ms 3164 KB Correct
3 Correct 5 ms 3116 KB Correct
4 Correct 3 ms 3932 KB Correct
5 Correct 2 ms 4188 KB Correct
6 Correct 4 ms 4188 KB Correct
7 Correct 4 ms 3928 KB Correct
8 Correct 4 ms 3676 KB Correct
9 Correct 3 ms 3676 KB Correct
10 Correct 3 ms 3972 KB Correct
11 Correct 4 ms 3928 KB Correct
12 Correct 3 ms 4188 KB Correct
13 Correct 3 ms 4188 KB Correct
14 Correct 3 ms 4188 KB Correct
15 Correct 1 ms 2652 KB Correct
16 Correct 5 ms 3164 KB Correct
17 Correct 4 ms 2908 KB Correct
18 Correct 4 ms 3996 KB Correct
19 Correct 3 ms 4188 KB Correct
20 Correct 3 ms 4188 KB Correct
21 Correct 3 ms 3784 KB Correct
22 Correct 4 ms 3676 KB Correct
23 Correct 4 ms 3676 KB Correct
24 Correct 3 ms 3932 KB Correct
25 Correct 4 ms 3932 KB Correct
26 Correct 3 ms 4188 KB Correct
27 Correct 3 ms 4188 KB Correct
28 Correct 3 ms 4188 KB Correct
29 Correct 4 ms 3264 KB Correct
30 Correct 4 ms 3932 KB Correct
31 Correct 4 ms 3716 KB Correct
32 Correct 4 ms 3932 KB Correct
33 Correct 1 ms 2652 KB Correct
34 Correct 5 ms 3164 KB Correct
35 Correct 4 ms 3120 KB Correct
36 Correct 3 ms 3932 KB Correct
37 Correct 3 ms 4188 KB Correct
38 Correct 3 ms 4188 KB Correct
39 Correct 5 ms 3932 KB Correct
40 Correct 4 ms 3676 KB Correct
41 Correct 4 ms 3676 KB Correct
42 Correct 4 ms 3932 KB Correct
43 Correct 3 ms 3932 KB Correct
44 Correct 4 ms 4188 KB Correct
45 Correct 3 ms 4188 KB Correct
46 Correct 3 ms 4188 KB Correct
47 Correct 5 ms 3160 KB Correct
48 Correct 4 ms 3932 KB Correct
49 Correct 4 ms 3672 KB Correct
50 Correct 4 ms 3932 KB Correct
51 Correct 1 ms 2652 KB Correct
52 Correct 1 ms 2652 KB Correct
53 Correct 0 ms 2652 KB Correct
54 Correct 1 ms 2648 KB Correct
55 Correct 0 ms 2652 KB Correct
56 Correct 1 ms 2736 KB Correct
57 Correct 1 ms 2652 KB Correct
58 Correct 4 ms 3420 KB Correct
59 Correct 3 ms 3164 KB Correct
60 Correct 5 ms 3676 KB Correct
61 Correct 4 ms 3676 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 86 ms 32840 KB Correct
2 Correct 75 ms 32140 KB Correct
3 Correct 89 ms 29524 KB Correct
4 Correct 45 ms 31696 KB Correct
5 Correct 63 ms 32196 KB Correct
6 Correct 82 ms 33104 KB Correct
7 Correct 80 ms 33100 KB Correct
8 Correct 59 ms 33112 KB Correct
9 Correct 56 ms 33116 KB Correct
10 Correct 49 ms 33108 KB Correct
11 Correct 49 ms 33108 KB Correct
12 Correct 0 ms 2652 KB Correct
13 Correct 4 ms 3164 KB Correct
14 Correct 5 ms 3116 KB Correct
15 Correct 3 ms 3932 KB Correct
16 Correct 2 ms 4188 KB Correct
17 Correct 4 ms 4188 KB Correct
18 Correct 4 ms 3928 KB Correct
19 Correct 4 ms 3676 KB Correct
20 Correct 3 ms 3676 KB Correct
21 Correct 3 ms 3972 KB Correct
22 Correct 4 ms 3928 KB Correct
23 Correct 3 ms 4188 KB Correct
24 Correct 3 ms 4188 KB Correct
25 Correct 3 ms 4188 KB Correct
26 Correct 77 ms 32596 KB Correct
27 Correct 77 ms 31972 KB Correct
28 Correct 76 ms 29524 KB Correct
29 Correct 47 ms 31956 KB Correct
30 Correct 61 ms 32196 KB Correct
31 Correct 91 ms 32968 KB Correct
32 Correct 75 ms 33104 KB Correct
33 Correct 57 ms 33104 KB Correct
34 Correct 58 ms 33104 KB Correct
35 Correct 51 ms 33104 KB Correct
36 Correct 51 ms 33104 KB Correct
37 Correct 0 ms 2648 KB Correct
38 Correct 4 ms 3160 KB Correct
39 Correct 4 ms 3072 KB Correct
40 Correct 4 ms 3932 KB Correct
41 Correct 3 ms 4116 KB Correct
42 Correct 3 ms 4188 KB Correct
43 Correct 4 ms 3932 KB Correct
44 Correct 7 ms 3676 KB Correct
45 Correct 4 ms 3672 KB Correct
46 Correct 4 ms 3932 KB Correct
47 Correct 3 ms 3932 KB Correct
48 Correct 3 ms 4332 KB Correct
49 Correct 3 ms 4188 KB Correct
50 Correct 3 ms 4188 KB Correct
51 Correct 316 ms 48236 KB Correct
52 Correct 249 ms 21076 KB Correct
53 Correct 48 ms 6100 KB Correct
54 Correct 77 ms 13636 KB Correct
55 Correct 191 ms 19024 KB Correct
56 Correct 282 ms 46312 KB Correct
57 Correct 281 ms 48600 KB Correct
58 Correct 210 ms 19796 KB Correct
59 Correct 175 ms 16852 KB Correct
60 Correct 229 ms 43444 KB Correct
61 Correct 262 ms 48068 KB Correct
62 Correct 143 ms 51280 KB Correct
63 Correct 141 ms 51280 KB Correct
64 Correct 157 ms 51284 KB Correct
65 Correct 128 ms 51284 KB Correct
66 Correct 150 ms 51280 KB Correct
67 Correct 129 ms 51280 KB Correct
68 Correct 150 ms 51280 KB Correct
69 Correct 134 ms 51208 KB Correct
70 Correct 148 ms 48352 KB Correct
71 Correct 158 ms 48348 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 86 ms 32840 KB Correct
2 Correct 75 ms 32140 KB Correct
3 Correct 89 ms 29524 KB Correct
4 Correct 45 ms 31696 KB Correct
5 Correct 63 ms 32196 KB Correct
6 Correct 82 ms 33104 KB Correct
7 Correct 80 ms 33100 KB Correct
8 Correct 59 ms 33112 KB Correct
9 Correct 56 ms 33116 KB Correct
10 Correct 49 ms 33108 KB Correct
11 Correct 49 ms 33108 KB Correct
12 Correct 81 ms 32788 KB Correct
13 Correct 82 ms 32204 KB Correct
14 Correct 67 ms 29524 KB Correct
15 Correct 48 ms 31700 KB Correct
16 Correct 77 ms 32200 KB Correct
17 Correct 79 ms 33144 KB Correct
18 Correct 79 ms 33108 KB Correct
19 Correct 58 ms 33108 KB Correct
20 Correct 60 ms 33116 KB Correct
21 Correct 52 ms 33104 KB Correct
22 Correct 51 ms 33084 KB Correct
23 Correct 76 ms 33360 KB Correct
24 Correct 51 ms 31568 KB Correct
25 Correct 84 ms 32596 KB Correct
26 Correct 0 ms 2652 KB Correct
27 Correct 4 ms 3164 KB Correct
28 Correct 5 ms 3116 KB Correct
29 Correct 3 ms 3932 KB Correct
30 Correct 2 ms 4188 KB Correct
31 Correct 4 ms 4188 KB Correct
32 Correct 4 ms 3928 KB Correct
33 Correct 4 ms 3676 KB Correct
34 Correct 3 ms 3676 KB Correct
35 Correct 3 ms 3972 KB Correct
36 Correct 4 ms 3928 KB Correct
37 Correct 3 ms 4188 KB Correct
38 Correct 3 ms 4188 KB Correct
39 Correct 3 ms 4188 KB Correct
40 Correct 1 ms 2652 KB Correct
41 Correct 5 ms 3164 KB Correct
42 Correct 4 ms 2908 KB Correct
43 Correct 4 ms 3996 KB Correct
44 Correct 3 ms 4188 KB Correct
45 Correct 3 ms 4188 KB Correct
46 Correct 3 ms 3784 KB Correct
47 Correct 4 ms 3676 KB Correct
48 Correct 4 ms 3676 KB Correct
49 Correct 3 ms 3932 KB Correct
50 Correct 4 ms 3932 KB Correct
51 Correct 3 ms 4188 KB Correct
52 Correct 3 ms 4188 KB Correct
53 Correct 3 ms 4188 KB Correct
54 Correct 4 ms 3264 KB Correct
55 Correct 4 ms 3932 KB Correct
56 Correct 4 ms 3716 KB Correct
57 Correct 4 ms 3932 KB Correct
58 Correct 77 ms 32596 KB Correct
59 Correct 77 ms 31972 KB Correct
60 Correct 76 ms 29524 KB Correct
61 Correct 47 ms 31956 KB Correct
62 Correct 61 ms 32196 KB Correct
63 Correct 91 ms 32968 KB Correct
64 Correct 75 ms 33104 KB Correct
65 Correct 57 ms 33104 KB Correct
66 Correct 58 ms 33104 KB Correct
67 Correct 51 ms 33104 KB Correct
68 Correct 51 ms 33104 KB Correct
69 Correct 0 ms 2648 KB Correct
70 Correct 4 ms 3160 KB Correct
71 Correct 4 ms 3072 KB Correct
72 Correct 4 ms 3932 KB Correct
73 Correct 3 ms 4116 KB Correct
74 Correct 3 ms 4188 KB Correct
75 Correct 4 ms 3932 KB Correct
76 Correct 7 ms 3676 KB Correct
77 Correct 4 ms 3672 KB Correct
78 Correct 4 ms 3932 KB Correct
79 Correct 3 ms 3932 KB Correct
80 Correct 3 ms 4332 KB Correct
81 Correct 3 ms 4188 KB Correct
82 Correct 3 ms 4188 KB Correct
83 Correct 316 ms 48236 KB Correct
84 Correct 249 ms 21076 KB Correct
85 Correct 48 ms 6100 KB Correct
86 Correct 77 ms 13636 KB Correct
87 Correct 191 ms 19024 KB Correct
88 Correct 282 ms 46312 KB Correct
89 Correct 281 ms 48600 KB Correct
90 Correct 210 ms 19796 KB Correct
91 Correct 175 ms 16852 KB Correct
92 Correct 229 ms 43444 KB Correct
93 Correct 262 ms 48068 KB Correct
94 Correct 143 ms 51280 KB Correct
95 Correct 141 ms 51280 KB Correct
96 Correct 157 ms 51284 KB Correct
97 Correct 128 ms 51284 KB Correct
98 Correct 150 ms 51280 KB Correct
99 Correct 129 ms 51280 KB Correct
100 Correct 150 ms 51280 KB Correct
101 Correct 134 ms 51208 KB Correct
102 Correct 148 ms 48352 KB Correct
103 Correct 158 ms 48348 KB Correct
104 Correct 81 ms 32848 KB Correct
105 Correct 67 ms 32204 KB Correct
106 Correct 67 ms 29520 KB Correct
107 Correct 49 ms 31576 KB Correct
108 Correct 68 ms 32196 KB Correct
109 Correct 78 ms 33040 KB Correct
110 Correct 97 ms 33048 KB Correct
111 Correct 68 ms 33104 KB Correct
112 Correct 60 ms 32964 KB Correct
113 Correct 50 ms 33116 KB Correct
114 Correct 50 ms 33108 KB Correct
115 Correct 1 ms 2904 KB Correct
116 Correct 5 ms 3160 KB Correct
117 Correct 4 ms 2904 KB Correct
118 Correct 4 ms 3976 KB Correct
119 Correct 2 ms 4188 KB Correct
120 Correct 3 ms 4188 KB Correct
121 Correct 5 ms 3932 KB Correct
122 Correct 4 ms 3676 KB Correct
123 Correct 4 ms 3676 KB Correct
124 Correct 4 ms 3976 KB Correct
125 Correct 3 ms 3932 KB Correct
126 Correct 3 ms 4188 KB Correct
127 Correct 3 ms 4188 KB Correct
128 Correct 4 ms 4188 KB Correct
129 Correct 280 ms 48216 KB Correct
130 Correct 219 ms 21072 KB Correct
131 Correct 44 ms 5984 KB Correct
132 Correct 74 ms 13604 KB Correct
133 Correct 184 ms 19028 KB Correct
134 Correct 236 ms 46172 KB Correct
135 Correct 278 ms 48572 KB Correct
136 Correct 208 ms 19796 KB Correct
137 Correct 171 ms 16936 KB Correct
138 Correct 207 ms 43568 KB Correct
139 Correct 271 ms 48000 KB Correct
140 Correct 140 ms 51180 KB Correct
141 Correct 150 ms 51240 KB Correct
142 Correct 140 ms 51280 KB Correct
143 Correct 151 ms 51300 KB Correct
144 Correct 145 ms 51288 KB Correct
145 Correct 141 ms 51284 KB Correct
146 Correct 145 ms 51224 KB Correct
147 Correct 131 ms 51280 KB Correct
148 Correct 161 ms 48388 KB Correct
149 Correct 155 ms 48348 KB Correct
150 Correct 89 ms 33544 KB Correct
151 Correct 55 ms 31572 KB Correct
152 Correct 71 ms 32592 KB Correct
153 Correct 4 ms 3160 KB Correct
154 Correct 4 ms 4040 KB Correct
155 Correct 4 ms 3676 KB Correct
156 Correct 4 ms 3932 KB Correct
157 Correct 287 ms 50016 KB Correct
158 Correct 214 ms 22096 KB Correct
159 Correct 38 ms 8784 KB Correct
160 Correct 281 ms 49880 KB Correct
161 Correct 309 ms 49624 KB Correct
162 Correct 227 ms 21588 KB Correct
163 Correct 250 ms 50784 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2648 KB Correct
2 Correct 0 ms 2648 KB Correct
3 Correct 0 ms 2652 KB Correct
4 Correct 0 ms 2652 KB Correct
5 Correct 1 ms 2652 KB Correct
6 Correct 1 ms 2652 KB Correct
7 Correct 1 ms 2652 KB Correct
8 Correct 0 ms 2652 KB Correct
9 Correct 1 ms 2648 KB Correct
10 Correct 86 ms 32840 KB Correct
11 Correct 75 ms 32140 KB Correct
12 Correct 89 ms 29524 KB Correct
13 Correct 45 ms 31696 KB Correct
14 Correct 63 ms 32196 KB Correct
15 Correct 82 ms 33104 KB Correct
16 Correct 80 ms 33100 KB Correct
17 Correct 59 ms 33112 KB Correct
18 Correct 56 ms 33116 KB Correct
19 Correct 49 ms 33108 KB Correct
20 Correct 49 ms 33108 KB Correct
21 Correct 81 ms 32788 KB Correct
22 Correct 82 ms 32204 KB Correct
23 Correct 67 ms 29524 KB Correct
24 Correct 48 ms 31700 KB Correct
25 Correct 77 ms 32200 KB Correct
26 Correct 79 ms 33144 KB Correct
27 Correct 79 ms 33108 KB Correct
28 Correct 58 ms 33108 KB Correct
29 Correct 60 ms 33116 KB Correct
30 Correct 52 ms 33104 KB Correct
31 Correct 51 ms 33084 KB Correct
32 Correct 76 ms 33360 KB Correct
33 Correct 51 ms 31568 KB Correct
34 Correct 84 ms 32596 KB Correct
35 Correct 1 ms 2652 KB Correct
36 Correct 0 ms 2652 KB Correct
37 Correct 0 ms 2652 KB Correct
38 Correct 1 ms 2652 KB Correct
39 Correct 1 ms 2648 KB Correct
40 Correct 1 ms 2648 KB Correct
41 Correct 0 ms 2652 KB Correct
42 Correct 81 ms 32848 KB Correct
43 Correct 82 ms 32200 KB Correct
44 Correct 66 ms 29552 KB Correct
45 Correct 44 ms 31692 KB Correct
46 Correct 66 ms 32208 KB Correct
47 Correct 84 ms 33028 KB Correct
48 Correct 74 ms 33044 KB Correct
49 Correct 58 ms 33104 KB Correct
50 Correct 62 ms 33104 KB Correct
51 Correct 48 ms 33104 KB Correct
52 Correct 51 ms 33112 KB Correct
53 Correct 82 ms 33356 KB Correct
54 Correct 59 ms 31412 KB Correct
55 Correct 85 ms 32592 KB Correct
56 Correct 37 ms 18520 KB Correct
57 Correct 2 ms 2908 KB Correct
58 Correct 0 ms 2652 KB Correct
59 Correct 4 ms 3164 KB Correct
60 Correct 5 ms 3116 KB Correct
61 Correct 3 ms 3932 KB Correct
62 Correct 2 ms 4188 KB Correct
63 Correct 4 ms 4188 KB Correct
64 Correct 4 ms 3928 KB Correct
65 Correct 4 ms 3676 KB Correct
66 Correct 3 ms 3676 KB Correct
67 Correct 3 ms 3972 KB Correct
68 Correct 4 ms 3928 KB Correct
69 Correct 3 ms 4188 KB Correct
70 Correct 3 ms 4188 KB Correct
71 Correct 3 ms 4188 KB Correct
72 Correct 1 ms 2652 KB Correct
73 Correct 5 ms 3164 KB Correct
74 Correct 4 ms 2908 KB Correct
75 Correct 4 ms 3996 KB Correct
76 Correct 3 ms 4188 KB Correct
77 Correct 3 ms 4188 KB Correct
78 Correct 3 ms 3784 KB Correct
79 Correct 4 ms 3676 KB Correct
80 Correct 4 ms 3676 KB Correct
81 Correct 3 ms 3932 KB Correct
82 Correct 4 ms 3932 KB Correct
83 Correct 3 ms 4188 KB Correct
84 Correct 3 ms 4188 KB Correct
85 Correct 3 ms 4188 KB Correct
86 Correct 4 ms 3264 KB Correct
87 Correct 4 ms 3932 KB Correct
88 Correct 4 ms 3716 KB Correct
89 Correct 4 ms 3932 KB Correct
90 Correct 1 ms 2652 KB Correct
91 Correct 5 ms 3164 KB Correct
92 Correct 4 ms 3120 KB Correct
93 Correct 3 ms 3932 KB Correct
94 Correct 3 ms 4188 KB Correct
95 Correct 3 ms 4188 KB Correct
96 Correct 5 ms 3932 KB Correct
97 Correct 4 ms 3676 KB Correct
98 Correct 4 ms 3676 KB Correct
99 Correct 4 ms 3932 KB Correct
100 Correct 3 ms 3932 KB Correct
101 Correct 4 ms 4188 KB Correct
102 Correct 3 ms 4188 KB Correct
103 Correct 3 ms 4188 KB Correct
104 Correct 5 ms 3160 KB Correct
105 Correct 4 ms 3932 KB Correct
106 Correct 4 ms 3672 KB Correct
107 Correct 4 ms 3932 KB Correct
108 Correct 1 ms 2652 KB Correct
109 Correct 1 ms 2652 KB Correct
110 Correct 0 ms 2652 KB Correct
111 Correct 1 ms 2648 KB Correct
112 Correct 0 ms 2652 KB Correct
113 Correct 1 ms 2736 KB Correct
114 Correct 1 ms 2652 KB Correct
115 Correct 4 ms 3420 KB Correct
116 Correct 3 ms 3164 KB Correct
117 Correct 5 ms 3676 KB Correct
118 Correct 4 ms 3676 KB Correct
119 Correct 77 ms 32596 KB Correct
120 Correct 77 ms 31972 KB Correct
121 Correct 76 ms 29524 KB Correct
122 Correct 47 ms 31956 KB Correct
123 Correct 61 ms 32196 KB Correct
124 Correct 91 ms 32968 KB Correct
125 Correct 75 ms 33104 KB Correct
126 Correct 57 ms 33104 KB Correct
127 Correct 58 ms 33104 KB Correct
128 Correct 51 ms 33104 KB Correct
129 Correct 51 ms 33104 KB Correct
130 Correct 0 ms 2648 KB Correct
131 Correct 4 ms 3160 KB Correct
132 Correct 4 ms 3072 KB Correct
133 Correct 4 ms 3932 KB Correct
134 Correct 3 ms 4116 KB Correct
135 Correct 3 ms 4188 KB Correct
136 Correct 4 ms 3932 KB Correct
137 Correct 7 ms 3676 KB Correct
138 Correct 4 ms 3672 KB Correct
139 Correct 4 ms 3932 KB Correct
140 Correct 3 ms 3932 KB Correct
141 Correct 3 ms 4332 KB Correct
142 Correct 3 ms 4188 KB Correct
143 Correct 3 ms 4188 KB Correct
144 Correct 316 ms 48236 KB Correct
145 Correct 249 ms 21076 KB Correct
146 Correct 48 ms 6100 KB Correct
147 Correct 77 ms 13636 KB Correct
148 Correct 191 ms 19024 KB Correct
149 Correct 282 ms 46312 KB Correct
150 Correct 281 ms 48600 KB Correct
151 Correct 210 ms 19796 KB Correct
152 Correct 175 ms 16852 KB Correct
153 Correct 229 ms 43444 KB Correct
154 Correct 262 ms 48068 KB Correct
155 Correct 143 ms 51280 KB Correct
156 Correct 141 ms 51280 KB Correct
157 Correct 157 ms 51284 KB Correct
158 Correct 128 ms 51284 KB Correct
159 Correct 150 ms 51280 KB Correct
160 Correct 129 ms 51280 KB Correct
161 Correct 150 ms 51280 KB Correct
162 Correct 134 ms 51208 KB Correct
163 Correct 148 ms 48352 KB Correct
164 Correct 158 ms 48348 KB Correct
165 Correct 81 ms 32848 KB Correct
166 Correct 67 ms 32204 KB Correct
167 Correct 67 ms 29520 KB Correct
168 Correct 49 ms 31576 KB Correct
169 Correct 68 ms 32196 KB Correct
170 Correct 78 ms 33040 KB Correct
171 Correct 97 ms 33048 KB Correct
172 Correct 68 ms 33104 KB Correct
173 Correct 60 ms 32964 KB Correct
174 Correct 50 ms 33116 KB Correct
175 Correct 50 ms 33108 KB Correct
176 Correct 1 ms 2904 KB Correct
177 Correct 5 ms 3160 KB Correct
178 Correct 4 ms 2904 KB Correct
179 Correct 4 ms 3976 KB Correct
180 Correct 2 ms 4188 KB Correct
181 Correct 3 ms 4188 KB Correct
182 Correct 5 ms 3932 KB Correct
183 Correct 4 ms 3676 KB Correct
184 Correct 4 ms 3676 KB Correct
185 Correct 4 ms 3976 KB Correct
186 Correct 3 ms 3932 KB Correct
187 Correct 3 ms 4188 KB Correct
188 Correct 3 ms 4188 KB Correct
189 Correct 4 ms 4188 KB Correct
190 Correct 280 ms 48216 KB Correct
191 Correct 219 ms 21072 KB Correct
192 Correct 44 ms 5984 KB Correct
193 Correct 74 ms 13604 KB Correct
194 Correct 184 ms 19028 KB Correct
195 Correct 236 ms 46172 KB Correct
196 Correct 278 ms 48572 KB Correct
197 Correct 208 ms 19796 KB Correct
198 Correct 171 ms 16936 KB Correct
199 Correct 207 ms 43568 KB Correct
200 Correct 271 ms 48000 KB Correct
201 Correct 140 ms 51180 KB Correct
202 Correct 150 ms 51240 KB Correct
203 Correct 140 ms 51280 KB Correct
204 Correct 151 ms 51300 KB Correct
205 Correct 145 ms 51288 KB Correct
206 Correct 141 ms 51284 KB Correct
207 Correct 145 ms 51224 KB Correct
208 Correct 131 ms 51280 KB Correct
209 Correct 161 ms 48388 KB Correct
210 Correct 155 ms 48348 KB Correct
211 Correct 89 ms 33544 KB Correct
212 Correct 55 ms 31572 KB Correct
213 Correct 71 ms 32592 KB Correct
214 Correct 4 ms 3160 KB Correct
215 Correct 4 ms 4040 KB Correct
216 Correct 4 ms 3676 KB Correct
217 Correct 4 ms 3932 KB Correct
218 Correct 287 ms 50016 KB Correct
219 Correct 214 ms 22096 KB Correct
220 Correct 38 ms 8784 KB Correct
221 Correct 281 ms 49880 KB Correct
222 Correct 309 ms 49624 KB Correct
223 Correct 227 ms 21588 KB Correct
224 Correct 250 ms 50784 KB Correct
225 Correct 75 ms 32840 KB Correct
226 Correct 74 ms 32200 KB Correct
227 Correct 62 ms 29520 KB Correct
228 Correct 46 ms 31636 KB Correct
229 Correct 66 ms 32200 KB Correct
230 Correct 89 ms 33092 KB Correct
231 Correct 74 ms 33104 KB Correct
232 Correct 58 ms 33108 KB Correct
233 Correct 58 ms 33104 KB Correct
234 Correct 49 ms 33116 KB Correct
235 Correct 48 ms 32960 KB Correct
236 Correct 1 ms 2652 KB Correct
237 Correct 4 ms 3164 KB Correct
238 Correct 4 ms 3084 KB Correct
239 Correct 3 ms 3932 KB Correct
240 Correct 3 ms 4440 KB Correct
241 Correct 3 ms 4184 KB Correct
242 Correct 3 ms 3932 KB Correct
243 Correct 3 ms 3676 KB Correct
244 Correct 3 ms 3588 KB Correct
245 Correct 3 ms 3932 KB Correct
246 Correct 4 ms 3928 KB Correct
247 Correct 4 ms 4188 KB Correct
248 Correct 3 ms 4188 KB Correct
249 Correct 3 ms 4188 KB Correct
250 Correct 323 ms 48364 KB Correct
251 Correct 209 ms 21072 KB Correct
252 Correct 44 ms 5964 KB Correct
253 Correct 81 ms 13596 KB Correct
254 Correct 180 ms 19024 KB Correct
255 Correct 288 ms 46164 KB Correct
256 Correct 294 ms 48576 KB Correct
257 Correct 242 ms 19876 KB Correct
258 Correct 173 ms 16720 KB Correct
259 Correct 222 ms 43624 KB Correct
260 Correct 269 ms 48160 KB Correct
261 Correct 145 ms 51316 KB Correct
262 Correct 155 ms 51216 KB Correct
263 Correct 157 ms 51188 KB Correct
264 Correct 140 ms 51220 KB Correct
265 Correct 178 ms 51232 KB Correct
266 Correct 165 ms 51248 KB Correct
267 Correct 158 ms 51188 KB Correct
268 Correct 149 ms 51312 KB Correct
269 Correct 162 ms 48492 KB Correct
270 Correct 166 ms 48556 KB Correct
271 Correct 85 ms 33364 KB Correct
272 Correct 57 ms 31540 KB Correct
273 Correct 77 ms 32592 KB Correct
274 Correct 4 ms 3164 KB Correct
275 Correct 4 ms 4028 KB Correct
276 Correct 4 ms 3676 KB Correct
277 Correct 4 ms 3932 KB Correct
278 Correct 308 ms 49644 KB Correct
279 Correct 210 ms 22128 KB Correct
280 Correct 35 ms 8536 KB Correct
281 Correct 288 ms 49884 KB Correct
282 Correct 281 ms 49768 KB Correct
283 Correct 221 ms 21584 KB Correct
284 Correct 273 ms 50908 KB Correct
285 Correct 1 ms 2648 KB Correct
286 Correct 1 ms 2652 KB Correct
287 Correct 1 ms 2652 KB Correct
288 Correct 0 ms 2652 KB Correct
289 Correct 1 ms 2652 KB Correct
290 Correct 0 ms 2652 KB Correct
291 Correct 0 ms 2652 KB Correct
292 Correct 39 ms 18544 KB Correct
293 Correct 1 ms 2904 KB Correct
294 Correct 6 ms 3436 KB Correct
295 Correct 6 ms 3164 KB Correct
296 Correct 5 ms 3672 KB Correct
297 Correct 5 ms 3676 KB Correct
298 Correct 353 ms 49992 KB Correct
299 Correct 255 ms 22520 KB Correct
300 Correct 231 ms 20308 KB Correct
301 Correct 212 ms 20820 KB Correct
302 Correct 209 ms 20052 KB Correct
303 Correct 292 ms 49880 KB Correct
304 Correct 262 ms 51800 KB Correct
305 Correct 275 ms 51416 KB Correct
306 Correct 236 ms 41152 KB Correct
307 Correct 277 ms 48732 KB Correct