Submission #814539

#TimeUsernameProblemLanguageResultExecution timeMemory
814539LIFThousands Islands (IOI22_islands)C++17
10 / 100
27 ms6956 KiB
#include "islands.h" #include<bits/stdc++.h> #include <variant> #include <vector> int ind[300005]; int ph[1005][1005]; using namespace std; std::variant<bool, std::vector<int>> find_journey( int N, int M, std::vector<int> U, std::vector<int> V) { if(N == 2) { vector <int> a,b; for(int i=0;i<M;i++) { if(U[i] == 0)a.push_back(i); else b.push_back(i); } if(a.size() >= 2 && b.size() >= 1) { vector<int> ans; ans.push_back(a[0]); ans.push_back(b[0]); ans.push_back(a[1]); ans.push_back(a[0]); ans.push_back(b[0]); ans.push_back(a[1]); return ans; } else return false; } else { for(int i=0;i<M;i++)ph[U[i]][V[i]] = i; vector<int> ans; ans.push_back(ph[0][1]); ans.push_back(ph[1][0]); ans.push_back(ph[0][2]); ans.push_back(ph[2][0]); ans.push_back(ph[1][0]); ans.push_back(ph[0][1]); ans.push_back(ph[2][0]); ans.push_back(ph[0][2]); return ans; } /* if (N == 4) { return std::vector<int>({0, 1, 2, 4, 0, 3, 2, 1, 4, 3}); } return false;*/ return true; }
#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...