#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;
return out;
}
if(D==2){
int pnt=1;
out[0]=0;
while(pnt<N){
vector<int> a;
a.push_back(pnt-1);
vector<int> b;
b.push_back(pnt);
bool connect = are_connected(a,b);
if(connect){
out[pnt]=pnt;
pnt++;
}
else{
out[pnt]=pnt+1;
out[pnt+1]=pnt;
pnt++; pnt++;
}
}
return out;
}
if(D==1){
return out;
}
return out;
}
/*int main() {
vector<int> a;
a=longest_trip(5, 3);
for(int i=0; i<5; i++)
cout<<a[i]<<" ";
}*/
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
600 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
344 KB |
Output is correct |
2 |
Correct |
5 ms |
344 KB |
Output is correct |
3 |
Correct |
6 ms |
344 KB |
Output is correct |
4 |
Correct |
5 ms |
344 KB |
Output is correct |
5 |
Correct |
5 ms |
344 KB |
Output is correct |
6 |
Incorrect |
0 ms |
344 KB |
Incorrect |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |