| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1342637 | weedywelon | 컴퓨터 네트워크 (BOI14_network) | C++20 | 50 ms | 4292 KiB |
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <limits.h>
#include <set>
#include <string>
#include <queue>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <deque>
#include <map>
#include <chrono>
#include <random>
#include <bitset>
#include <tuple>
#include "network.h"
#define SZ(x) int(x.size())
#define FR(i,a,b) for(int i=(a);i<(b);++i)
#define FOR(i,n) FR(i,0,n)
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define A first
#define B second
#define mp(a,b) make_pair(a,b)
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef unsigned __int128 U128;
typedef __int128 I128;
typedef std::pair<int,int> PII;
typedef std::pair<LL,LL> PLL;
using namespace std;
//n^2 get all edges
//run bfs
vector<int> adj[1003];
int par[1003];
void bfs(int a){
par[a]=0;
queue<int> q;
q.push(a);
while(!q.empty()){
int u=q.front();
q.pop();
for (int v:adj[u]){
if (par[v]==0){
par[v]=u;
q.push(v);
}
}
}
}
void findRoute (int N, int a, int b){
int n=N;
FR(i,1,n+1) FR(j,1,n+1) {
int t=ping(i,j);
if (t==0){
adj[i].push_back(j);
adj[j].push_back(i);
}
}
bfs(a);
vector<int> path;
int cur=b;
while (cur!=a){
path.push_back(cur);
cur=par[cur];
}
reverse(path.begin(),path.end());
for (int u:path) travelTo(u);
return;
}컴파일 시 표준 에러 (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... | ||||
