# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
979245 | 2024-05-10T12:10:35 Z | Rafi22 | Island Hopping (JOI24_island) | C++17 | 0 ms | 0 KB |
#include <bits/stdc++.h> //#include "island.h" #define int long long #define ll long long #define ld long double #define endl '\n' #define st first #define nd second #define pb push_back #define sz(x) (int)(x).size() #define all(x) (x).begin(), (x).end() using namespace std; //int inf=1000000007; ll inf=1000000000000000007; ll mod=924844033; ll mod1=998244353; const int S=307; bool is[S][S]; void solve(int N,int L) { int n=N; 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); is[i][k]=1; is[k][i]=1; } } }