Submission #628142

#TimeUsernameProblemLanguageResultExecution timeMemory
628142TurkhuuThousands Islands (IOI22_islands)C++17
5 / 100
31 ms3120 KiB
#include "islands.h" #include <bits/stdc++.h> using namespace std; variant<bool, vector<int>> find_journey(int N, int M, vector<int> U, vector<int> V) { if (N == 2) { return false; } vector<int> A(N), B(N); for (int i = 0; i < M; i++) { if ((U[i] + 1) % N == V[i]) { A[U[i]] = i; } if ((V[i] + 1) % N == U[i]) { B[U[i]] = i; } } vector<int> ans; for (int i = 0; i < N; i++) { ans.push_back(A[i]); } for (int i = N - 1; i >= 0; i--) { ans.push_back(B[(i + 1) % N]); } for (int i = N - 1; i >= 0; i--) { ans.push_back(A[i]); } for (int i = 0; i < N; i++) { ans.push_back(B[(i + 1) % N]); } return ans; }
#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...