# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1273771 | hgmhc | Computer Network (BOI14_network) | C++20 | 51 ms | 4420 KiB |
#include <bits/stdc++.h>
#include"network.h"
using namespace std; using ll = long long; using ii = pair<ll,ll>; using vi = vector<ll>;
#define rep(i,a,b) for (ll i = (a); i <= (b); ++i)
#define per(i,a,b) for (ll i = (b); i >= (a); --i)
#define all(x) (x).begin(), (x).end()
#define siz(x) ll((x).size())
#define Mup(x,y) (x = max(x,y))
#define mup(x,y) (x = min(x,y))
#define fi first
#define se second
#define pb push_back
#define dbg(...) fprintf(stderr,__VA_ARGS__)
const ll N = 1003;
vi L[N];
ll d;
stack<ll>t;
void findRoute(int n, int a, int b) {
rep(i,1,n)if(i!=a){
ll p=ping(a,i);
L[p].push_back(i);
if(i==b){
d=p,t.push(b);
}
}
per(i,0,d-1){
for(auto j:L[i]){
if(!ping(j,b)){
t.push(j),b=j;
break;
}
}
}
for(;siz(t);t.pop()){
travelTo(t.top());
}
}
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... |