Submission #1081996

#TimeUsernameProblemLanguageResultExecution timeMemory
1081996LaMatematica14Longest Trip (IOI23_longesttrip)C++17
5 / 100
7 ms344 KiB
#include <bits/stdc++.h> using namespace std; bool are_connected(vector<int> A, vector<int> B); vector<int> longest_trip(int N, int D){ vector<int> perc = {0}; for (int i = 1; i < N-1; i++) { vector<int> ca = {i}, cb = {perc.back()}; if (are_connected(ca, cb)) perc.push_back(i); else { perc.push_back(i+1); perc.push_back(i); } } vector<int> a = {N-1}, b = {perc.back()}; if (are_connected(a, b)) perc.push_back(N-1); else { perc.insert(perc.begin(), N-1); } return perc; }
#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...