| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1348587 | bananacookie | 컴퓨터 네트워크 (BOI14_network) | C++17 | 36 ms | 4372 KiB |
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
const int NN=1005;
vector<int> dist[NN];
#include "network.h"
void findRoute (int N, int a, int b)
{
int maxa_i=0;
int dist_ans=ping(a,b);
bool hasbetween=false;
for(int i=1;i<=N;i++){
if(i!=a && i!=b){
int a_i=ping(a,i),i_b=ping(i,b);
maxa_i=max(maxa_i,a_i);
if(a_i+i_b+1==dist_ans){ //on shortest path
dist[a_i].push_back(i);
hasbetween=true;
}
}
}
int cur=-1;
if(hasbetween){
travelTo(dist[0][0]);
cur=dist[0][0];
}
else{
travelTo(b); return;
}
for(int i=1;i<=maxa_i;i++){
for(int v:dist[i]){
if(ping(cur,v)==0){
travelTo(v);
cur=v;
}
}
}
travelTo(b);
}
컴파일 시 표준 에러 (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... | ||||
