# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
803075 | HaroldVemeno | Stations (IOI20_stations) | C++17 | 3063 ms | 2097152 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>
#ifdef GUDEB
#define D(x) cerr << #x << ": " << (x) << '\n';
#define ifdeb if(true)
#else
#define D(x) ;
#define ifdeb if(false)
#endif
#define all(x) begin(x), end(x)
using namespace std;
using ull = unsigned long long;
using ll = long long;
// #define int ll;
vector<int> al[1000];
vector<int> labels;
int lt = 0;
void dfs(int v, int p) {
for(auto a : al[v]) {
if(a == p) continue;
dfs(a, v);
}
labels[v] = lt++;
}
vector<int> label(int n, int k, vector<int> u, vector<int> v) {
for (int i = 0; i < u.size(); i++) {
al[u[i]].push_back(v[i]);
al[v[i]].push_back(u[i]);
}
labels.resize(n);
dfs(0, 0);
return labels;
}
int find_next_station(int s, int t, vector<int> c) {
int mx = c[0];
int lub = 10000;
for(int a : c) {
if(a >= t) lub = min(lub, a);
mx = max(mx, a);
}
if(lub == 10000) return mx;
return lub;
}
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... |