# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
616718 | John3_141592 | Stations (IOI20_stations) | C++14 | 1 ms | 464 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 "stations.h"
#include <bits/stdc++.h>
using namespace std;
vector <int> grafo[1003];
int arr[1003];
bool vis[1003];
void dfs(int node,int c,int C){
vis[node]=true;
if(c) arr[node]=C;
for(auto i:grafo[node]) if(!vis[i]) dfs(node,c^1,C+1);
if(!c) arr[node]=C;
}
std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) {
for(int i=0;i<n;i++) grafo[i].clear();
for(int i=0;i<n-1;i++) grafo[u[i]].push_back(v[i]),grafo[v[i]].push_back(u[i]);
fill(arr,arr+n+1,0);
fill(vis,vis+n+1,false);
}
int find_next_station(int s, int t, std::vector<int> c) {
if(s<c[0]) for(auto i:c) if(i>t) return i;
reverse(c.begin(),c.end());
for(auto i:c) if(i<t) return i;
}
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... |