# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
559443 | 2022-05-09T20:30:16 Z | Sam_a17 | Computer Network (BOI14_network) | C++14 | 88 ms | 7916 KB |
#include <bits/stdc++.h> #include "network.h" using namespace std; const int M = 1e3 + 10; vector<int> adj[M]; void findRoute (int N, int a, int b) { /* int dist = ping(a, b); for (int i = 1; i <= dist; ++i) travelTo(i); */ int maxi = ping(a, b); for(int i = 1; i <= N; i++) { if(i == a || i == b) { continue; } int dist = (i, b); if(dist < maxi) { adj[dist].push_back(i); } } int curr = a; for(int i = maxi - 1; i >= 0; i--) { for(auto j: adj[i]) { if(!ping(curr, j)) { travelTo(j); curr = j; break; } } } travelTo(b); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 86 ms | 7916 KB | Travelling to nonadjacent computer |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 82 ms | 6644 KB | Travelling to nonadjacent computer |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 84 ms | 6680 KB | Travelling to nonadjacent computer |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 88 ms | 6604 KB | Travelling to nonadjacent computer |
2 | Halted | 0 ms | 0 KB | - |