# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
979243 | Rafi22 | Island Hopping (JOI24_island) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 N=307;
bool is[N][N];
void solve(int n,int l)
{
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;
}
}
}