Submission #979251

#TimeUsernameProblemLanguageResultExecution timeMemory
979251Rafi22Island Hopping (JOI24_island)C++17
100 / 100
7 ms972 KiB
#include "island.h" #include <bits/stdc++.h> using namespace std; void solve(int N, int L){ int n=N; vector<vector<int>>is(n+1,vector<int>(n+1,0)); for(int i=1;i<=n;i++) { vector<int>V; for(int j=1;j<n;j++) { int k=query(i,j); if(k>i) break; bool ok=1; for(auto x:V) if(is[x][k]) ok=0; if(!ok) break; answer(i,k); V.push_back(k); is[i][k]=1; is[k][i]=1; } } }
#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...