# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
216937 | 2020-03-28T13:26:48 Z | rajarshi_basu | Computer Network (BOI14_network) | C++14 | 144 ms | 5116 KB |
#include <iostream> #include <iomanip> #include <stdio.h> #include <string> #include <vector> #include <cmath> #include "network.h" #define FOR(i,n) for(int i=0;i<n;i++) #define FORE(i,a,b) for(int i=a;i<=b;i++) #define ll long long int #define ld long double #define vi vector<int> #define pb push_back #define ff first #define ss second #define ii pair<int,int> #define iii pair<int,ii> #define vv vector using namespace std; const int MAXN = 1001; vector<int> dists[MAXN]; void findRoute(int n,int a,int b){ int dist = ping(a,b); FORE(i,1,n){ if(i == a or i == b)continue; dists[ping(i,b)].pb(i); } vi inters; int currNode = a; for(int d = dist-1;d>=0;d--){ for(auto e: dists[d]){ int v = ping(currNode,e); if(v == 0){ currNode = e; inters.pb(e); break; } } } inters.pb(b); for(auto e : inters){ travelTo(e); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 138 ms | 4344 KB | Output is correct |
2 | Correct | 129 ms | 4900 KB | Output is correct |
3 | Correct | 120 ms | 4904 KB | Output is correct |
4 | Correct | 122 ms | 4960 KB | Output is correct |
5 | Correct | 117 ms | 4984 KB | Output is correct |
6 | Correct | 120 ms | 4960 KB | Output is correct |
7 | Correct | 5 ms | 384 KB | Output is correct |
8 | Correct | 5 ms | 384 KB | Output is correct |
9 | Correct | 5 ms | 384 KB | Output is correct |
10 | Correct | 5 ms | 512 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 121 ms | 4344 KB | Output is correct |
2 | Correct | 33 ms | 2944 KB | Output is correct |
3 | Correct | 135 ms | 4984 KB | Output is correct |
4 | Correct | 105 ms | 4984 KB | Output is correct |
5 | Correct | 141 ms | 4960 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 121 ms | 4232 KB | Output is correct |
2 | Correct | 33 ms | 2936 KB | Output is correct |
3 | Correct | 144 ms | 4888 KB | Output is correct |
4 | Correct | 109 ms | 4984 KB | Output is correct |
5 | Correct | 140 ms | 4960 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 119 ms | 4344 KB | Output is correct |
2 | Correct | 32 ms | 2936 KB | Output is correct |
3 | Correct | 129 ms | 5116 KB | Output is correct |
4 | Correct | 107 ms | 4984 KB | Output is correct |
5 | Correct | 143 ms | 4900 KB | Output is correct |