Submission #632176

#TimeUsernameProblemLanguageResultExecution timeMemory
632176Minindu2006Thousands Islands (IOI22_islands)C++17
5 / 100
33 ms4960 KiB
#include "islands.h" #include<bits/stdc++.h> #include <variant> #include <vector> using namespace std; int n, m; vector<int> u, v; std::variant<bool, std::vector<int>> find_journey(int N, int M, std::vector<int> U, std::vector<int> V) { n = N, m = M; u = U, v = V; vector<int> ans; if(n <= 2) { if(m <= 2) return false; int z = 0; vector<int> cur(3); for(int i=0;i<m;i++) { if(u[i] == 0) { if(z < 2) cur[z] = i; z++; } else cur[2] = i; } if(z < 2 || z == m) return false; ans.resize(3); ans[0] = cur[0]; ans[1] = cur[2]; ans[2] = cur[1]; for(int i=0;i<3;i++) ans.push_back(ans[i]); return ans; } return false; }
#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...