Submission #878785

#TimeUsernameProblemLanguageResultExecution timeMemory
878785thinknoexitLongest Trip (IOI23_longesttrip)C++17
0 / 100
1 ms596 KiB
#include <bits/stdc++.h> #include "longesttrip.h" using namespace std; using ll = long long; int n, d; vector<int> longest_trip(int N, int D) { n = N; d = D; vector<int> g1, g2; g1.push_back(0); for (int i = 1;i < n;i++) { if (are_connected({ 0 }, { i })) g1.push_back(i); else g2.push_back(i); } if (!are_connected(g1, g2)) { if (g1.size() > g2.size()) return g1; return g2; } return g2; }
#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...