| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1367775 | DangerNoodle7591 | Stations (IOI20_stations) | C++20 | 287 ms | 452 KiB |
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define N 1010
vector<int> label(int n, int k, vector<int> u, vector<int> v) {
vector<int> ans;
for(int i=0;i<n;i++){
ans.pb(i);
}
return ans;
}
vector<int> adj[N];
int dfs(int x,int once,int hed,int bas){
if(x==hed)return 1;
int mx=0;
for(auto u:adj[x]){
if(u==once)continue;
mx=max(mx,dfs(u,x,hed,bas));
if(x==bas&&mx)return u;
}
return mx;
}
int find_next_station(int s, int t, vector<int> c) {
if(adj[0].size()==0){
for(int i=0;i<1005;i++){
adj[(int)(i/2)].pb(i+1);
adj[i+1].pb((int)(i/2));
}
}
return dfs(s,-1,t,s);
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
