Submission #987450

#TimeUsernameProblemLanguageResultExecution timeMemory
987450hugo_pmIsland Hopping (JOI24_island)C++17
100 / 100
9 ms1112 KiB
#include "island.h" #include <bits/stdc++.h> using namespace std; void solve(int N, int L) { vector<vector<int>> adj(N+1); for (int node = 1; node <= N; ++node) { vector<bool> bad(N+1, false); for (int k = 1; k <= N-1; ++k) { int voisin = query(node, k); if (node < voisin || bad[voisin]) break; adj[node].push_back(voisin); adj[voisin].push_back(node); answer(node, voisin); for (int voi2 : adj[voisin]) bad[voi2] = 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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...