Submission #1070307

#TimeUsernameProblemLanguageResultExecution timeMemory
1070307PlurmLongest Trip (IOI23_longesttrip)C++17
15 / 100
7 ms440 KiB
#include "longesttrip.h" #include <bits/stdc++.h> using namespace std; vector<int> longest_trip(int N, int D) { deque<int> trip; int iso = 2; if(are_connected({0}, {1})){ trip.push_back(0); trip.push_back(1); }else{ trip.push_back(0); trip.push_back(2); iso = 1; } for(int i = 3; i < N; i++){ if(are_connected({trip.back()}, {i})) trip.push_back(i); else trip.push_front(i); } if(are_connected({trip.back()}, {iso})) trip.push_back(iso); else trip.push_front(iso); return vector<int>(trip.begin(), trip.end()); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...