# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1064720 | 2024-08-18T17:08:54 Z | Osplei | Stations (IOI20_stations) | C++17 | 1111 ms | 2097152 KB |
#include "stations.h" #include <bits/stdc++.h> using namespace std; #define pb push_back vector <int> bfs (int k, int nodo, vector <int> grafo[1005]){ vector <int> aux(k); bool visto[1005] = {false}; queue <int> q; int pos = 0; q.push(nodo); while (!q.empty()){ int act = q.front(); q.pop(); if (visto[act] == true) continue; visto[act] = true; for (auto i : grafo[act]) q.push(i); aux[act] = pos; pos++; } return aux; } vector <int> label(int n, int k, vector <int> u, vector <int> v) { vector <int> grafo[1005]; map <int, int> entra; for (int i = 0; i < u.size(); i++) { int a = u[i], b = v[i]; if (b < a) swap(a, b); entra[b]++; grafo[a].pb(b); grafo[b].pb(a); } for (auto i : entra) { vector <int> labels = bfs(k, i.first, grafo); return labels; } } int find_next_station(int s, int t, vector <int> c) { if (t > s) return max(c[0], c[1]); else return min(c[0], c[1]); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Invalid length of array as the response of 'label'. scenario=0, n=10, len=1000 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Invalid length of array as the response of 'label'. scenario=0, n=996, len=1000 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 4184 KB | Invalid length of array as the response of 'label'. scenario=0, n=2, len=1000000 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1111 ms | 2097152 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 990 ms | 2097152 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |