# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
985344 | Maaxle | Stations (IOI20_stations) | C++17 | 538 ms | 864 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>
#define range(it, a, b) for (ll it = a; it < b; it++)
#define all(x) begin(x), end(x)
#define ll long long
#define ull unsigned long long
#define INF64 ((ll) 1 << 62)
#define INF32 (1 << 30)
#define mset multiset
#define uset unordered_set
#define umap unordered_map
#define pqueue priority_queue
#define ptr(A) shared_ptr<A>
using namespace std;
vector<int> label(int n, int k, vector<int> u, vector<int> v) {
vector<vector<int>> adj (n);
range(i, 0, n-1) {
adj[u[i]].push_back(v[i]);
adj[v[i]].push_back(u[i]);
}
int l;
range(i, 0, n) {
if (adj[i].size() == 1) {
l = i;
break;
}
}
vector<int> ans (n);
int prev = l;
range(i, 0, n) {
ans[l] = i;
for (int& k : adj[l]) {
if (k != prev) {
l = k;
prev = l;
break;
}
}
}
return ans;
}
int find_next_station(int s, int t, vector<int> c) {
if (t > s)
return s+1;
return s-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... |