| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1348634 | bananacookie | 컴퓨터 네트워크 (BOI14_network) | C++17 | 38 ms | 4408 KiB |
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#include "network.h" //**********
const int NN=1005;
vector<int> dist[NN];
void findRoute (int N, int a, int b)
{
for(int i=0;i<NN;i++) dist[i].clear();
int dist_b=-1;
for(int i=1;i<=N;i++){
if(i==a) continue;
int cur_dist=ping(a,i);
dist[cur_dist].push_back(i);
if(i==b) dist_b=cur_dist;
}
vector<int> path; path.push_back(b);
int cur_v=b;
for(int i=dist_b-1;i>=0;i--){ //i=subset of previous node
for(int u:dist[i]){
if(ping(u,cur_v)==0){
path.push_back(u);
cur_v=u;
break;
}
}
}
reverse(path.begin(),path.end());
for(int x:path) travelTo(x);
}
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... | ||||
