# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
559444 | 2022-05-09T20:30:48 Z | Sam_a17 | Computer Network (BOI14_network) | C++14 | 95 ms | 7912 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 = ping(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 | Correct | 95 ms | 4172 KB | Output is correct |
2 | Correct | 89 ms | 7440 KB | Output is correct |
3 | Correct | 80 ms | 7004 KB | Output is correct |
4 | Correct | 80 ms | 7124 KB | Output is correct |
5 | Correct | 94 ms | 6672 KB | Output is correct |
6 | Correct | 93 ms | 6600 KB | Output is correct |
7 | Correct | 0 ms | 340 KB | Output is correct |
8 | Correct | 1 ms | 332 KB | Output is correct |
9 | Correct | 0 ms | 212 KB | Output is correct |
10 | Correct | 1 ms | 340 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 80 ms | 4172 KB | Output is correct |
2 | Correct | 21 ms | 2784 KB | Output is correct |
3 | Correct | 95 ms | 7784 KB | Output is correct |
4 | Correct | 87 ms | 6156 KB | Output is correct |
5 | Correct | 85 ms | 7888 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 86 ms | 4268 KB | Output is correct |
2 | Correct | 21 ms | 2776 KB | Output is correct |
3 | Correct | 87 ms | 7828 KB | Output is correct |
4 | Correct | 84 ms | 6196 KB | Output is correct |
5 | Correct | 86 ms | 7912 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 95 ms | 4212 KB | Output is correct |
2 | Correct | 30 ms | 2764 KB | Output is correct |
3 | Correct | 93 ms | 7760 KB | Output is correct |
4 | Correct | 79 ms | 6144 KB | Output is correct |
5 | Correct | 91 ms | 7864 KB | Output is correct |