#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 |
Execution timed out |
1070 ms |
2097152 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1053 ms |
2097152 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1047 ms |
2097152 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1045 ms |
2097152 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1016 ms |
2097152 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |