#include <bits/stdc++.h>
#include <fstream>
#define endl '\n'
#define mod 998244353
#define INF 1000000000
#define INF2 2000000000000000000
//#define ll long long
///#define cin fin
///#define cout fout
using namespace std;
double const EPS = 1e-14;
///ofstream fout("herding.out");
///ifstream fin("herding.in");
int main()
{
ios_base::sync_with_stdio(0);cout.tie(0);cin.tie(0);
int n, m; cin >> n >> m;
bool ok[n+1][n+1] = {};
bool check[n+1] = {};
for(int i = 0; i < m; i++) {
int a, b; cin >> a >> b;
ok[a][b] = 1; ok[b][a] = 1;
}
int sum = 0;
for(int i = 1; i <= n; i++) {
if(check[i] == 1) continue;
for(int j = 1; j <= n; j++) {
if(i == j) continue;
if(check[j] == 1) continue;
if(ok[i][j] == 0) {
check[i] = 1;
check[j] = 1;
sum++;
break;
}
}
if(sum == n/3) break;
} int cnt = 0;
for(int i = 1; i <= n; i++) {
if(check[i] == 0) {
cout << i << ' ';
cnt++;
}
if(cnt == n/3) break;
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 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 |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
10 ms |
1316 KB |
Output is correct |
3 |
Correct |
10 ms |
1372 KB |
Output is correct |
4 |
Correct |
10 ms |
1368 KB |
Output is correct |
5 |
Correct |
10 ms |
1372 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
7 ms |
600 KB |
Output is correct |
2 |
Correct |
38 ms |
4180 KB |
Output is correct |
3 |
Correct |
38 ms |
4176 KB |
Output is correct |
4 |
Correct |
37 ms |
4176 KB |
Output is correct |
5 |
Correct |
42 ms |
4180 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
600 KB |
Output is correct |
2 |
Correct |
97 ms |
10056 KB |
Output is correct |
3 |
Correct |
89 ms |
9556 KB |
Output is correct |
4 |
Correct |
91 ms |
9668 KB |
Output is correct |
5 |
Correct |
96 ms |
9928 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
26 ms |
1116 KB |
Output is correct |
2 |
Correct |
132 ms |
14476 KB |
Output is correct |
3 |
Correct |
136 ms |
14236 KB |
Output is correct |
4 |
Correct |
134 ms |
14160 KB |
Output is correct |
5 |
Correct |
139 ms |
14608 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
81 ms |
2652 KB |
Output is correct |
2 |
Correct |
169 ms |
17784 KB |
Output is correct |
3 |
Correct |
170 ms |
17648 KB |
Output is correct |
4 |
Correct |
165 ms |
18052 KB |
Output is correct |
5 |
Correct |
173 ms |
17744 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
167 ms |
4344 KB |
Output is correct |
2 |
Correct |
237 ms |
23924 KB |
Output is correct |
3 |
Correct |
219 ms |
23380 KB |
Output is correct |
4 |
Correct |
248 ms |
23928 KB |
Output is correct |
5 |
Correct |
237 ms |
23536 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
197 ms |
5600 KB |
Output is correct |
2 |
Correct |
285 ms |
28292 KB |
Output is correct |
3 |
Correct |
298 ms |
27940 KB |
Output is correct |
4 |
Correct |
284 ms |
27948 KB |
Output is correct |
5 |
Correct |
268 ms |
28084 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
234 ms |
6492 KB |
Output is correct |
2 |
Correct |
339 ms |
33208 KB |
Output is correct |
3 |
Correct |
362 ms |
32652 KB |
Output is correct |
4 |
Correct |
358 ms |
32812 KB |
Output is correct |
5 |
Correct |
329 ms |
32820 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
300 ms |
7572 KB |
Output is correct |
2 |
Correct |
416 ms |
38480 KB |
Output is correct |
3 |
Correct |
399 ms |
37840 KB |
Output is correct |
4 |
Correct |
398 ms |
38256 KB |
Output is correct |
5 |
Correct |
450 ms |
38088 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
434 ms |
9240 KB |
Output is correct |
2 |
Correct |
404 ms |
41116 KB |
Output is correct |
3 |
Correct |
490 ms |
40588 KB |
Output is correct |
4 |
Correct |
425 ms |
40728 KB |
Output is correct |
5 |
Correct |
455 ms |
41032 KB |
Output is correct |