Submission #1084016

#TimeUsernameProblemLanguageResultExecution timeMemory
1084016gamegameIsland Hopping (JOI24_island)C++17
100 / 100
8 ms436 KiB
#include "island.h" #include<bits/stdc++.h> using namespace std; int n; int ord[305]; int rnk[305]; int par[305]; void solve(int N, int L){ n=N; ord[1]=rnk[1]=1; for(int i=2; i<=n ;i++){ ord[i]=query(1,i-1); rnk[ord[i]]=i; } for(int i=1; i<=n ;i++) par[i]=0; for(int i=2; i<=n ;i++){ int x=ord[i]; if(!par[x]){//leaf for(int j=1;;j++){ int y=query(x,j); if(rnk[y]<rnk[x]){ par[x]=y; break; } else par[y]=x; } } } for(int i=2; i<=n ;i++) answer(par[i],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...