제출 #1310233

#제출 시각아이디문제언어결과실행 시간메모리
1310233em4ma2가장 긴 여행 (IOI23_longesttrip)C++20
15 / 100
5 ms420 KiB
#include <bits/stdc++.h> #include "longesttrip.h" using namespace std; #define ll long long #define pb push_back vector<int> longest_trip(int n, int D) { vector<int>path; if (are_connected({0},{1})){ if (are_connected({1},{2})){ path.pb(0);path.pb(1);path.pb(2); }else{ path.pb(1);path.pb(0);path.pb(2); } }else{ path.pb(0);path.pb(2);path.pb(1); } for (int i=3;i<n;i++){ if (are_connected({path.back()},{i}))path.pb(i); else{ vector<int>ans; ans.pb(i); ans.insert(ans.end(),path.begin(),path.end()); path=ans; } } return path; } // signed main(){ // int n,d; // cin>>n>>d; // vector<int>ans=longest_trip(n,d); // for (auto x:ans){ // cout<<x<<" "; // }cout<<endl; // }
#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...