# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
517085 | 2022-01-22T13:43:12 Z | Ai7081 | Stations (IOI20_stations) | C++17 | 4 ms | 492 KB |
#include <bits/stdc++.h> using namespace std; const int N = 1005; int cnt, cnt2; vector<int> ret; vector<vector<int>> adj; void dfs(int v, int p) { ret[v] = 1000*cnt2 + cnt; //cout << v << ' ' << ret[v] << endl; cnt2++; for (auto to : adj[v]) { if (to != p) { dfs(to, v); } } return; } vector<int> label(int n, int k, vector<int> u, vector<int> v) { adj.assign(n, vector<int>()); for (int i=0; i<(int)u.size(); i++) { adj[u[i]].push_back(v[i]); adj[v[i]].push_back(u[i]); } for (int i=0; i<n; i++) { if (adj[i].size() > 2) { ret.assign(n, 0); ret[i] = 0; cnt = 1; for (auto x : adj[i]) { cnt2 = 0; dfs(x, i); cnt++; } return ret; } } } int find_next_station(int s, int t, vector<int> c) { if (!s) return t % 1000; if (s%1000 != t%1000) return s - 1000; if (t > s) return s + 1000; return s - 1000; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 416 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 492 KB | Invalid labels (values out of range). scenario=0, k=1000, vertex=2, label=1001 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 420 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 280 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 416 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |