Submission #1059701

#TimeUsernameProblemLanguageResultExecution timeMemory
1059701mychecksedadLongest Trip (IOI23_longesttrip)C++17
5 / 100
8 ms344 KiB
#include "longesttrip.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define all(x) x.begin(),x.end() #define ll long long #define ff first #define ss second #define vi vector<int> const int N = 200005; std::vector<int> longest_trip(int n, int D) { if(D == 3){ vector<int> v; for(int i = 0; i < n; ++i) v.pb(i); return v; } if(D == 2){ deque<int> v; v.pb(0); for(int i = 1; i < n; ++i){ bool x = are_connected(vi{v[0]}, vi{i}); if(x){ v.push_front(i); }else v.pb(i); } vector<int> res(all(v)); return res; } return {}; }
#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...