Submission #979954

#TimeUsernameProblemLanguageResultExecution timeMemory
979954vjudge1Longest Trip (IOI23_longesttrip)C++17
Compilation error
0 ms0 KiB
#include "longesttrip.h" #include <bits/stdc++.h> using namespace std; vector<int> longest_trip(int N, int D){ vector<int> r(N); int j=0; r[0]=0; for(int i=1;i<N;i++){ int e1[1]={r[j]},e2[1]={i}; if(are_connected(e1,e2))j++,r[j]=i; else if(i==N-1){ for(int k=N-1;0<k;k--)r[k]=r[k-1]; r[0]=i; } else j++,r[j]=i+1,j++,r[j]=i,i++; } return r; }

Compilation message (stderr)

longesttrip.cpp: In function 'std::vector<int> longest_trip(int, int)':
longesttrip.cpp:11:20: error: could not convert '(int*)(& e1)' from 'int*' to 'std::vector<int>'
   11 |   if(are_connected(e1,e2))j++,r[j]=i;
      |                    ^~
      |                    |
      |                    int*