# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
397582 | 2021-05-02T12:31:21 Z | lyc | Computer Network (BOI14_network) | C++14 | 109 ms | 7312 KB |
#include "network.h" #include <bits/stdc++.h> using namespace std; int _ping(int a, int b) { if (a == b) return -1; return ping(a,b); } void findRoute (int N, int a, int b) { int dist[N+1]; for (int i = 1; i <= N; ++i) { dist[i] = _ping(a,i); } vector<int> v = {b}; for (int i = 1; i <= N; ++i) { if (dist[i] == dist[b]-1) { v.push_back(i); break; } } for (int d = dist[b]-2; d >= 0; --d) { for (int i = 1; i <= N; ++i) if (dist[i] == d && _ping(v.back(),i) == 0) { v.push_back(i); break; } } for (int i = (int)v.size()-1; i >= 0; --i) { travelTo(v[i]); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 109 ms | 4308 KB | Output is correct |
2 | Incorrect | 106 ms | 7312 KB | Travelling to nonadjacent computer |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 100 ms | 4228 KB | Output is correct |
2 | Incorrect | 26 ms | 2764 KB | Travelling to nonadjacent computer |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 109 ms | 4124 KB | Output is correct |
2 | Incorrect | 27 ms | 2760 KB | Travelling to nonadjacent computer |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 99 ms | 4232 KB | Output is correct |
2 | Incorrect | 26 ms | 2708 KB | Travelling to nonadjacent computer |
3 | Halted | 0 ms | 0 KB | - |