Submission #1129767

#TimeUsernameProblemLanguageResultExecution timeMemory
1129767not_amirIsland Hopping (JOI24_island)C++20
100 / 100
4 ms416 KiB
#include "island.h" #include <bits/stdc++.h> using namespace std; void solve(int N, int L) { vector<int> order; for (int k = 1; k < N; k++) order.push_back(query(1, k)); vector p(N + 1, -1); p[1] = 1; for (int v : order) { for (int k = 1; p[v] == -1; k++) { int u = query(v, k); if (p[u] == -1) p[u] = v; else p[v] = u; } } for (int i = 2; i <= N; i++) answer(i, p[i]); }
#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...