Submission #1075208

#TimeUsernameProblemLanguageResultExecution timeMemory
1075208dozerIsland Hopping (JOI24_island)C++17
100 / 100
6 ms684 KiB
#include "island.h" #include <bits/stdc++.h> using namespace std; #define sp " " #define fastio() cin.tie(0), ios_base::sync_with_stdio(0) #define pb push_back #define pii pair<int, int> #define st first #define nd second #define LL node * 2 #define RR node * 2 + 1 const int modulo = 1e9 + 7; void solve(int N, int L) { vector<int> v, pos(N + 5, 0), done(N + 5, 0); for (int i = 1; i <= N -1; i++){ int tmp = query(1, i); v.pb(tmp); pos[tmp] = i - 1; } for (auto i : v){ if (done[i]) continue; int to = query(i, 1); int curr = 1; while(pos[to] > pos[i]){ answer(to, i); done[to] = 1; curr++; to = query(i, curr); } answer(to, 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...