| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1348488 | bananacookie | Computer Network (BOI14_network) | C++20 | 38 ms | 4484 KiB |
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
#include "network.h"
const int NN=1000+2;
vector<int> adj[NN];
int past[NN],dist[NN];
void bfs(int s){
queue<int> q;
dist[s]=0; past[s]=-1; q.push(s);
while(!q.empty())
{
int u=q.front(); q.pop();
for(int v:adj[u]){
if(dist[v]==-1){
dist[v]=dist[u]+1;
past[v]=u;
q.push(v);
}
}
}
}
void findRoute (int N, int a, int b)
{
for(int i=1;i<=N-1;i++){
for(int j=i+1;j<=N;j++){
if(!ping(i,j)){
adj[i].push_back(j);
adj[j].push_back(i);
}
}
}
for(int i=1;i<=N;i++) dist[i]=-1;
bfs(a);
vector<int> path;
int cur=b;
while(cur!=a){
path.push_back(cur);
cur=past[cur];
}
reverse(path.begin(),path.end());
for(int x:path){
travelTo(x);
}
//for(int i=1;i<=2;i++) travelTo(i);
}
컴파일 시 표준 에러 (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... | ||||
