#include <bits/stdc++.h>
#define suiii ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define co cout<<
//#pragma GCC optimize("O3,Ofast,unroll-loops")
//#pragma GCC target("avx2,sse3,sse4,avx")
using namespace std;
//stuff
ll n,m;
vector<ll>v[3005];
bitset<3005>curr,mat[3005],vis;
ll cnt=0;
void rec(ll x){
if(x==n/3){
for(int i=0;i<3005;i++){
if(curr[i]==1) co i<<' ';
}
exit(0);
}
ll num=rand()%n+1;
while(vis[num]||(curr&mat[num])!=curr) num=rand()%n+1;
vis[num]=1;
curr[num]=1;
rec(x+1);
curr[num]=0;
vis[num]=0;
}
void solve(){
cin>>n>>m;
for(int i=0;i<m;i++){
ll a,b;
cin>>a>>b;
mat[a][b]=1;
mat[b][a]=1;
}
while(1) rec(0);
co vis[5000];
}
int main()
{
suiii
int t=1;
// cin>>t;
while(t--){
solve();
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3058 ms |
348 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3052 ms |
604 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
1368 KB |
Output is correct |
2 |
Correct |
32 ms |
3932 KB |
Output is correct |
3 |
Correct |
33 ms |
3880 KB |
Output is correct |
4 |
Execution timed out |
3054 ms |
3676 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
1672 KB |
Output is correct |
2 |
Correct |
82 ms |
8016 KB |
Output is correct |
3 |
Correct |
85 ms |
8400 KB |
Output is correct |
4 |
Correct |
87 ms |
8532 KB |
Output is correct |
5 |
Correct |
82 ms |
8468 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
23 ms |
2900 KB |
Output is correct |
2 |
Execution timed out |
3019 ms |
12036 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
75 ms |
7332 KB |
Output is correct |
2 |
Correct |
147 ms |
14044 KB |
Output is correct |
3 |
Execution timed out |
3069 ms |
14536 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
133 ms |
12240 KB |
Output is correct |
2 |
Execution timed out |
3089 ms |
19536 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
191 ms |
15820 KB |
Output is correct |
2 |
Correct |
258 ms |
23428 KB |
Output is correct |
3 |
Correct |
253 ms |
23180 KB |
Output is correct |
4 |
Execution timed out |
3084 ms |
23176 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
236 ms |
18768 KB |
Output is correct |
2 |
Execution timed out |
3059 ms |
27476 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
284 ms |
19068 KB |
Output is correct |
2 |
Execution timed out |
3075 ms |
31572 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
288 ms |
15696 KB |
Output is correct |
2 |
Execution timed out |
3015 ms |
20300 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |