#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*2/3) break;
}
}
cout << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Output is correct |
2 |
Correct |
1 ms |
512 KB |
Output is correct |
3 |
Correct |
1 ms |
548 KB |
Output is correct |
4 |
Correct |
1 ms |
640 KB |
Output is correct |
5 |
Correct |
1 ms |
640 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
896 KB |
Output is correct |
2 |
Incorrect |
16 ms |
1792 KB |
Wypisano za du¿o osób |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
1536 KB |
Output is correct |
2 |
Incorrect |
62 ms |
3320 KB |
Wypisano za du¿o osób |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
20 ms |
2048 KB |
Output is correct |
2 |
Incorrect |
168 ms |
4736 KB |
Wypisano za du¿o osób |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
3072 KB |
Output is correct |
2 |
Incorrect |
269 ms |
5632 KB |
Wypisano za du¿o osób |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
152 ms |
4736 KB |
Output is correct |
2 |
Incorrect |
335 ms |
6144 KB |
Wypisano za du¿o osób |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
294 ms |
6264 KB |
Output is correct |
2 |
Incorrect |
485 ms |
7040 KB |
Wypisano za du¿o osób |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
451 ms |
7140 KB |
Output is correct |
2 |
Incorrect |
606 ms |
7708 KB |
Wypisano za du¿o osób |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
542 ms |
7728 KB |
Output is correct |
2 |
Incorrect |
739 ms |
8312 KB |
Wypisano za du¿o osób |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
652 ms |
8448 KB |
Output is correct |
2 |
Incorrect |
879 ms |
8952 KB |
Wypisano za du¿o osób |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
831 ms |
9200 KB |
Output is correct |
2 |
Incorrect |
917 ms |
9208 KB |
Wypisano za du¿o osób |
3 |
Halted |
0 ms |
0 KB |
- |