Submission #1113511

#TimeUsernameProblemLanguageResultExecution timeMemory
1113511imarnIsland Hopping (JOI24_island)C++17
65 / 100
20 ms604 KiB
#include<bits/stdc++.h> #define ll long long #define pii pair<int,int> #define pll pair<ll,ll> #define plx pair<ll,int> #define f first #define s second #define pb push_back #define all(x) x.begin(),x.end() #define szz(r) (ll)r.size() #define vi vector<int> #define vvi vector<vi> #define pp pair<ll,int> #define ub(x,i) upper_bound(all(x),i)-x.begin() using namespace std; #include "island.h" void solve(int N, int L) {int n=N; vector<int>vec; for(int i=1;i<=n-1;i++)vec.pb(query(1,i)); int pr[N+1]={0};pr[1]=1; for(int i=2;i<=n;i++){ int u=vec[i-2]; for(int j=1;j<=n-1;j++){ int v=query(u,j); if(!pr[v])continue; else {pr[u]=v;break;} } } for(int i=2;i<=n;i++)answer(pr[i],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...