#include "longesttrip.h"
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
bool vis[500];
vector<int>v[500];
vector<int>ans;
void dfs(int a){
vis[a]=0;
ans.pb(a);
for(auto b:v[a]){
if(vis[b]==0){
dfs(b);
}
}
}
std::vector<int> longest_trip(int N, int D)
{
ans.clear();
for(int i=0;i<N;i++){
vis[i]=0;
v[i].clear();
}
for(int i=0;i<N;i++){
for(int j=i+1;j<N;j++){
if(are_connected({i},{j})){
v[i].pb(j);
v[j].pb(i);
}
}
}
//dfs(0);
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |