#include <bits/stdc++.h>
using namespace std;
#define pb push_back
bool adj[3000][3000];
bool dead[3000];
int main() {
cin.tie(0)->sync_with_stdio(0);
int n, m; cin >> n >> m;
for (int i = 0; i < m; i++) {
int a, b; cin >> a >> b; --a; --b;
adj[a][b] = 1; adj[b][a] = 1;
}
for (int i = 0; i < n; i++) {
for (int j = i+1; j < n; j++) {
if (!dead[i] && !dead[j] && !adj[i][j]) {
dead[i] = dead[j] = 1;
}
}
}
int ct = 0;
for (int i = 0; i < n; i++) {
if (!dead[i]) {
cout << i+1 << " ";
ct++;
if (ct == n/3) break;
}
}
cout << endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
1 ms |
512 KB |
Output is correct |
3 |
Correct |
1 ms |
640 KB |
Output is correct |
4 |
Correct |
1 ms |
640 KB |
Output is correct |
5 |
Correct |
1 ms |
640 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
896 KB |
Output is correct |
2 |
Correct |
16 ms |
1792 KB |
Output is correct |
3 |
Correct |
16 ms |
1792 KB |
Output is correct |
4 |
Correct |
16 ms |
1792 KB |
Output is correct |
5 |
Correct |
16 ms |
1792 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
1536 KB |
Output is correct |
2 |
Correct |
65 ms |
3328 KB |
Output is correct |
3 |
Correct |
65 ms |
3200 KB |
Output is correct |
4 |
Correct |
62 ms |
3320 KB |
Output is correct |
5 |
Correct |
62 ms |
3200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
21 ms |
2048 KB |
Output is correct |
2 |
Correct |
161 ms |
4856 KB |
Output is correct |
3 |
Correct |
164 ms |
4856 KB |
Output is correct |
4 |
Correct |
160 ms |
4736 KB |
Output is correct |
5 |
Correct |
163 ms |
4860 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
49 ms |
3072 KB |
Output is correct |
2 |
Correct |
271 ms |
5752 KB |
Output is correct |
3 |
Correct |
255 ms |
5632 KB |
Output is correct |
4 |
Correct |
252 ms |
5632 KB |
Output is correct |
5 |
Correct |
272 ms |
5752 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
150 ms |
4856 KB |
Output is correct |
2 |
Correct |
329 ms |
6144 KB |
Output is correct |
3 |
Correct |
334 ms |
6144 KB |
Output is correct |
4 |
Correct |
336 ms |
6144 KB |
Output is correct |
5 |
Correct |
382 ms |
6144 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
342 ms |
6272 KB |
Output is correct |
2 |
Correct |
526 ms |
7132 KB |
Output is correct |
3 |
Correct |
473 ms |
7124 KB |
Output is correct |
4 |
Correct |
541 ms |
7144 KB |
Output is correct |
5 |
Correct |
572 ms |
7136 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
435 ms |
7144 KB |
Output is correct |
2 |
Correct |
596 ms |
7704 KB |
Output is correct |
3 |
Correct |
604 ms |
7680 KB |
Output is correct |
4 |
Correct |
613 ms |
7800 KB |
Output is correct |
5 |
Correct |
615 ms |
7800 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
538 ms |
7800 KB |
Output is correct |
2 |
Correct |
739 ms |
8308 KB |
Output is correct |
3 |
Correct |
761 ms |
8312 KB |
Output is correct |
4 |
Correct |
736 ms |
8440 KB |
Output is correct |
5 |
Correct |
760 ms |
8440 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
641 ms |
8324 KB |
Output is correct |
2 |
Correct |
876 ms |
8832 KB |
Output is correct |
3 |
Correct |
883 ms |
8880 KB |
Output is correct |
4 |
Correct |
904 ms |
8952 KB |
Output is correct |
5 |
Correct |
867 ms |
8952 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
829 ms |
9208 KB |
Output is correct |
2 |
Correct |
942 ms |
9188 KB |
Output is correct |
3 |
Correct |
930 ms |
9208 KB |
Output is correct |
4 |
Correct |
959 ms |
9192 KB |
Output is correct |
5 |
Correct |
933 ms |
9196 KB |
Output is correct |