| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 673527 | Essa2006 | Stations (IOI20_stations) | C++14 | 893 ms | 684 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>
using namespace std;
#define ll long long
#define endl '\n'
#define FF first
#define SS second
#define all(a) a.begin(), a.end()
#define mod (ll)(1000000007)
vector<int>Vis, labels;
vector<vector<int>>A;
vector<array<int, 2>>dp;
// time, max_time
int time_=0;
void dfs(int ind){
Vis[ind]=1, labels[ind]=time_++;
for(int i=0;i<A[ind].size();i++)
if(!Vis[A[ind][i]])
dfs(A[ind][i]);
}
vector<int> label(int n, int k, vector<int> u, vector<int> v) {
dp.clear(), Vis.clear(), A.clear(), labels.clear();
dp.resize(n), Vis.resize(n), A.resize(n), labels.resize(n);
for(int i=0;i<n;i++)
A[u[i]].push_back(v[i]), A[v[i]].push_back(u[i]);
dfs(0);
return labels;
}
int find_next_station(int s, int t, vector<int> c) {
for(int i=c.size()-1;i>=0;i--){
if(t>c[i])
return c[i];
}
return c[0];
}
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... | ||||
