# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
979250 | 2024-05-10T12:14:42 Z | Rafi22 | Island Hopping (JOI24_island) | C++17 | 0 ms | 0 KB |
#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.pb(k); is[i][k]=1; is[k][i]=1; } } }