Submission #1076091

#TimeUsernameProblemLanguageResultExecution timeMemory
1076091BoasThousands Islands (IOI22_islands)C++17
6.75 / 100
89 ms14052 KiB
#include "islands.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define loop(x, i) for (int i = 0; i < x; i++) #define ALL(x) begin(x), end(x) #define sz(x) (int)x.size() typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<int> vi; typedef vector<vi> vvi; variant<bool, vi> find_journey(int N, int M, vi U, vi V) { if (N == 2) { vi heen, terug; loop(M, i) { if (U[i] == 0) heen.pb(i); else terug.pb(i); } if (sz(heen) >= 2 && sz(terug) >= 1) { return vi{heen[0], terug[0], heen[1], heen[0], terug[0], heen[1]}; } return false; } else { map<ii, int> ix; loop(M, i) ix[{U[i], V[i]}] = i; vi a = {ix[{0, 1}], ix[{1, 2}], ix[{2, 0}]}; vi b = {ix[{0, 2}], ix[{2, 1}], ix[{1, 0}]}; vi res; for (int p : a) res.pb(p); for (int p : b) res.pb(p); for (int p : a) res.pb(p); for (int p : b) res.pb(p); return res; } }
#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...