Submission #757613

#TimeUsernameProblemLanguageResultExecution timeMemory
757613boris_mihovThousands Islands (IOI22_islands)C++17
5 / 100
33 ms4432 KiB
#include "islands.h" #include <algorithm> #include <iostream> #include <numeric> #include <cassert> #include <variant> #include <vector> typedef long long llong; const int MAXN = 100000 + 10; const int INF = 1e9; int n, m; std::variant <bool, std::vector<int>> find_journey(int N, int M, std::vector <int> U, std::vector <int> V) { n = N; m = M; for (int i = 0 ; i < m ; ++i) { U[i]++; V[i]++; } if (n == 2) { int cntOne = 0; int cntTwo = 0; std::vector <int> one; std::vector <int> two; for (int i = 0 ; i < m ; ++i) { if (U[i] == 1) { cntOne++; one.push_back(i); } else { cntTwo++; two.push_back(i); } } if (cntOne >= 2 && cntTwo >= 1) { return std::vector <int> ({one[0], two[0], one[1], one[0], two[0], one[1]}); } return false; } 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...