#include "longesttrip.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> longest_trip(int N, int D){
vector<int> out;
for(int i=0; i<N; i++)
out.push_back(0);
if(D==3){
for(int i=0; i<N; i++)
out[i]=i+1;
return out;
}
if(D==2){
int pnt=1;
out[0]=1;
while(pnt<N){
vector<int> a;
a.push_back(pnt);
vector<int> b;
b.push_back(pnt+1);
bool connect = are_connected(a,b);
if(connect){
out[pnt]=pnt+1;
pnt++;
}
else{
out[pnt]=pnt+2;
out[pnt+1]=pnt+1;
pnt++; pnt++;
}
}
return out;
}
if(D==1){
return out;
}
return out;
}
# |
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 |
invalid array |
2 |
Halted |
0 ms |
0 KB |
- |
# |
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 |
- |