#include "bits/stdc++.h"
using namespace std;
using ll = long long;
bool v[3006][3006],r[3006];
int main(){
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
ll n,m;
cin>>n>>m;
for(int i=0;i<m;i++){
ll x,y;
cin>>x>>y;
v[x-1][y-1]=1;
}
for(int i=0;i<n;i++){
if(r[i])continue;
for(int j=i+1;j<n;j++){
if(r[j])continue;
if(!v[i][j]){
r[i]=1;r[j]=1;
break;
}
}
}
ll x=n/3;
for(int i=0;i<n;i++){
if(x==0)break;
if(!r[i]){
x--;
cout<<i+1<<" ";
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
2652 KB |
Output is correct |
4 |
Correct |
1 ms |
2652 KB |
Output is correct |
5 |
Correct |
1 ms |
2652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
2652 KB |
Output is correct |
2 |
Correct |
8 ms |
2692 KB |
Output is correct |
3 |
Correct |
10 ms |
2652 KB |
Output is correct |
4 |
Correct |
8 ms |
2652 KB |
Output is correct |
5 |
Correct |
8 ms |
2652 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
2652 KB |
Output is correct |
2 |
Correct |
33 ms |
4748 KB |
Output is correct |
3 |
Correct |
31 ms |
4696 KB |
Output is correct |
4 |
Correct |
30 ms |
4708 KB |
Output is correct |
5 |
Correct |
31 ms |
4696 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
15 ms |
2652 KB |
Output is correct |
2 |
Correct |
74 ms |
6748 KB |
Output is correct |
3 |
Correct |
72 ms |
6744 KB |
Output is correct |
4 |
Correct |
74 ms |
6744 KB |
Output is correct |
5 |
Correct |
73 ms |
6772 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
40 ms |
4700 KB |
Output is correct |
2 |
Correct |
109 ms |
6780 KB |
Output is correct |
3 |
Correct |
111 ms |
6748 KB |
Output is correct |
4 |
Correct |
108 ms |
6748 KB |
Output is correct |
5 |
Correct |
150 ms |
6776 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
67 ms |
6748 KB |
Output is correct |
2 |
Correct |
133 ms |
6780 KB |
Output is correct |
3 |
Correct |
146 ms |
6744 KB |
Output is correct |
4 |
Correct |
132 ms |
6744 KB |
Output is correct |
5 |
Correct |
127 ms |
6776 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
121 ms |
6744 KB |
Output is correct |
2 |
Correct |
179 ms |
8836 KB |
Output is correct |
3 |
Correct |
173 ms |
8796 KB |
Output is correct |
4 |
Correct |
170 ms |
8796 KB |
Output is correct |
5 |
Correct |
169 ms |
8796 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
151 ms |
9044 KB |
Output is correct |
2 |
Correct |
190 ms |
8792 KB |
Output is correct |
3 |
Correct |
181 ms |
8796 KB |
Output is correct |
4 |
Correct |
199 ms |
8792 KB |
Output is correct |
5 |
Correct |
202 ms |
8796 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
185 ms |
8796 KB |
Output is correct |
2 |
Correct |
235 ms |
8792 KB |
Output is correct |
3 |
Correct |
240 ms |
8796 KB |
Output is correct |
4 |
Correct |
223 ms |
8796 KB |
Output is correct |
5 |
Correct |
241 ms |
8796 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
217 ms |
8796 KB |
Output is correct |
2 |
Correct |
280 ms |
8960 KB |
Output is correct |
3 |
Correct |
258 ms |
8952 KB |
Output is correct |
4 |
Correct |
272 ms |
8792 KB |
Output is correct |
5 |
Correct |
277 ms |
9048 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
271 ms |
9428 KB |
Output is correct |
2 |
Correct |
296 ms |
9248 KB |
Output is correct |
3 |
Correct |
308 ms |
9268 KB |
Output is correct |
4 |
Correct |
309 ms |
9264 KB |
Output is correct |
5 |
Correct |
284 ms |
9048 KB |
Output is correct |