제출 #878785

#제출 시각아이디문제언어결과실행 시간메모리
878785thinknoexit가장 긴 여행 (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...