#include <iostream>
#include <vector>
using ll = long long;
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((b) < (a)) ? (b) : (a))
int const nmax = 3000;
int mat[1 + nmax][1 + nmax];
int sol[1 + nmax];
int main() {
int n, m;
std::cin >> n >> m;
for(int i = 1; i <= n; i++)
mat[i][i] = 1;
for(int i = 1; i <= m; i++) {
int x, y;
std::cin >> x >> y;
mat[x][y] = mat[y][x] = 1;
}
for(int i = 1; i <= n; i++)
sol[i] = 1;
for(int i = 1;i <= n; i++)
for(int j = 1;j <= n; j++)
if(mat[i][j] == 0 && sol[i] + sol[j] == 2)
sol[i] = sol[j] = 0;
int _count = 0;
for(int i = 1;i <= n; i++)
if(_count < n / 3 && sol[i] == 1) {
std::cout << i << " ";
_count++;
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
512 KB |
Output is correct |
2 |
Correct |
1 ms |
512 KB |
Output is correct |
3 |
Correct |
3 ms |
768 KB |
Output is correct |
4 |
Correct |
3 ms |
768 KB |
Output is correct |
5 |
Correct |
3 ms |
768 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
11 ms |
1408 KB |
Output is correct |
2 |
Correct |
88 ms |
4092 KB |
Output is correct |
3 |
Correct |
82 ms |
3960 KB |
Output is correct |
4 |
Correct |
86 ms |
3960 KB |
Output is correct |
5 |
Correct |
84 ms |
3960 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
46 ms |
2944 KB |
Output is correct |
2 |
Correct |
363 ms |
11288 KB |
Output is correct |
3 |
Correct |
371 ms |
11256 KB |
Output is correct |
4 |
Correct |
358 ms |
11256 KB |
Output is correct |
5 |
Correct |
358 ms |
11128 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
111 ms |
5112 KB |
Output is correct |
2 |
Correct |
875 ms |
22480 KB |
Output is correct |
3 |
Correct |
861 ms |
22484 KB |
Output is correct |
4 |
Correct |
876 ms |
22500 KB |
Output is correct |
5 |
Correct |
874 ms |
22648 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
256 ms |
9208 KB |
Output is correct |
2 |
Correct |
1301 ms |
31340 KB |
Output is correct |
3 |
Correct |
1275 ms |
31096 KB |
Output is correct |
4 |
Correct |
1272 ms |
30940 KB |
Output is correct |
5 |
Correct |
1287 ms |
31108 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
793 ms |
21856 KB |
Output is correct |
2 |
Correct |
1600 ms |
37652 KB |
Output is correct |
3 |
Correct |
1575 ms |
37184 KB |
Output is correct |
4 |
Correct |
1596 ms |
37496 KB |
Output is correct |
5 |
Correct |
1593 ms |
37368 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1428 ms |
36276 KB |
Output is correct |
2 |
Correct |
2139 ms |
45944 KB |
Output is correct |
3 |
Correct |
2114 ms |
45740 KB |
Output is correct |
4 |
Correct |
2127 ms |
45576 KB |
Output is correct |
5 |
Correct |
2146 ms |
45816 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1886 ms |
43764 KB |
Output is correct |
2 |
Correct |
2528 ms |
51768 KB |
Output is correct |
3 |
Correct |
2508 ms |
51192 KB |
Output is correct |
4 |
Correct |
2616 ms |
51336 KB |
Output is correct |
5 |
Correct |
2536 ms |
51576 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2261 ms |
49160 KB |
Output is correct |
2 |
Correct |
2982 ms |
58108 KB |
Output is correct |
3 |
Correct |
2946 ms |
57464 KB |
Output is correct |
4 |
Execution timed out |
3033 ms |
57556 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2621 ms |
54748 KB |
Output is correct |
2 |
Execution timed out |
3081 ms |
61688 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3077 ms |
62968 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |