Submission #1020808

#TimeUsernameProblemLanguageResultExecution timeMemory
1020808isaachewIsland Hopping (JOI24_island)C++17
57 / 100
6 ms600 KiB
#include "island.h" #include <bits/stdc++.h> void solve(int N, int L) { std::vector<int> ccs(N,-1); for(int i=1;i<N;i++){ ccs[i]=i; for(int j=0;j<N;j++){ int qu=query(i+1,j+1); if(ccs[qu-1]==i||qu-1>i)break; answer(i+1,qu); int oldcc=ccs[qu-1]; for(int k=0;k<N;k++){ if(ccs[k]==oldcc)ccs[k]=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...