# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
752462 | 2023-06-03T03:52:49 Z | salmon | Computer Network (BOI14_network) | C++14 | 94 ms | 4192 KB |
#include "network.h" #include <bits/stdc++.h> using namespace std; void findRoute (int N, int a, int b){ int dist[N + 5]; vector<pair<int,int>> v; for(int i = 1; i <= N; i++){ if(i != a && i != b){ dist[i] = ping(i,b) + 1; v.push_back(make_pair(dist[i],i)); } else{ dist[i] = 10000; } } int d = N; sort(v.begin(),v.end(),greater<pair<int,int>>()); for(int i = 0; i < N - 2; i++){ if(v[i].first == d){ continue; } if(ping(v[i].second,a) + 1== 1){ a = v[i].second; d--; travelTo(a); } } travelTo(b); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 72 ms | 4132 KB | Output is correct |
2 | Incorrect | 77 ms | 4128 KB | Travelling to nonadjacent computer |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 78 ms | 4192 KB | Travelling to nonadjacent computer |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 94 ms | 4172 KB | Travelling to nonadjacent computer |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 77 ms | 4160 KB | Travelling to nonadjacent computer |
2 | Halted | 0 ms | 0 KB | - |