# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
586023 | wdjpng | Stations (IOI20_stations) | C++17 | 925 ms | 636 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 "stations.h"
using namespace std;
#define rep(i,n) for(int i = 0; i<n;i++)
int c;
vector<vector<int>>E;
vector<int>pre;
void dfs(int v, int p)
{
pre[v]=c++;
for(int w : E[v]) if(w!=p) dfs(w,v);
}
vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
E.assign(n, vector<int>());
pre.resize(n);
c=0;
rep(i,n-1) {E[u[i]].push_back(v[i]); E[v[i]].push_back(u[i]);}
dfs(0,-1);
return pre;
}
int find_next_station(int s, int t, std::vector<int> c) {
sort(c.begin(),c.end());
rep(i,c.size()-1) if(c[i+1]>t) return c[i];
return c[c.size()-1];
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |