# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
752439 | 2023-06-03T03:22:11 Z | jamielim | Computer Network (BOI14_network) | C++14 | 85 ms | 4280 KB |
#include "network.h" #include <bits/stdc++.h> using namespace std; #define fi first #define se second #define mp make_pair #define pb emplace_back typedef long long ll; typedef pair<int,int> ii; const int INF=1012345678; int dista[1005]; set<int> found; void findRoute (int N, int a, int b){ int d=ping(a,b)+1; found.insert(0); found.insert(d); memset(dista,-1,sizeof(dista)); dista[0]=a; dista[d]=b; for(int i=1;i<=N;i++){ if(i==a||i==b)continue; int x=ping(i,a)+1; if(dista[x]!=-1)continue; auto it=found.upper_bound(x); int y=ping(i,dista[*it])+1; if(x+y==(*it)){ dista[x]=i; found.insert(x); } } for(int i=1;i<=d;i++)travelTo(dista[i]); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 76 ms | 4280 KB | Output is correct |
2 | Incorrect | 79 ms | 4212 KB | ping called with invalid arguments |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 73 ms | 4192 KB | Travelling to nonadjacent computer |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 77 ms | 4236 KB | Travelling to nonadjacent computer |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 85 ms | 4160 KB | Travelling to nonadjacent computer |
2 | Halted | 0 ms | 0 KB | - |