# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
216937 | rajarshi_basu | Computer Network (BOI14_network) | C++14 | 144 ms | 5116 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |