Submission #1079872

#TimeUsernameProblemLanguageResultExecution timeMemory
1079872Zero_OPIsland Hopping (JOI24_island)C++17
100 / 100
7 ms596 KiB
#include<bits/stdc++.h> #include <algorithm> #include <cstdio> #include <cstdlib> #include <random> #include <utility> #include <vector> #include "island.h" using namespace std; void solve(int N, int L) { vector<bool> vis(N + 1); vector<int> order(N + 1); for(int i = 1; i < N; ++i){ order[i] = query(1, i); } vis[1] = true; for(int _i = 1; _i < N; ++_i){ int i = order[_i]; if(vis[i]) continue; int x = i, depth = 1; vis[i] = true; while(true){ x = query(i, depth); if(vis[x]) break; vis[x] = true; answer(x, i); ++depth; } answer(x, 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...