# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
432869 | 2021-06-18T14:24:38 Z | lior5654 | Stations (IOI20_stations) | C++17 | 1 ms | 456 KB |
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pl; typedef vector<ll> vl; typedef vector<vl> vvl; typedef vector<pl> vpl; typedef vector<vpl> vvpl; typedef pair<int, int> pi; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pi> vpi; typedef vector<vpi> vvpi; #define rep(i, n) for(int i = 0; i < n; ++i) #define all(c) (c.begin()), (c.end()) #define pb push_back #define eb emplace_back #define fi first #define se second #include "stations.h" const int maxn = 1e3 + 5; vi g[maxn]; std::vector<int> label(int n, int k, std::vector<int> u, std::vector<int> v) { vi res(n); rep(i, n-1) { g[u[i]].pb(v[i]); g[v[i]].pb(u[i]); } int fir = -1; for(int i = 0; i < n; ++i) { if(g[i].size() == 1) { fir = i; break; } } assert(fir != 0); int pre = -1; int cur = fir; rep(i, n) { res[cur] = i; for(auto e : g[cur]) { if(e!=pre) { pre = cur; cur = e; break; } } } rep(i, n) { g[i].clear(); } } int find_next_station(int s, int t, std::vector<int> c) { if(s < t && s < c[0] || s > t && s > c[0]) { return c[0]; } else { return c[1]; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 428 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 440 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 440 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 444 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 456 KB | Execution killed with signal 6 |
2 | Halted | 0 ms | 0 KB | - |