# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
206682 | PeppaPig | 컴퓨터 네트워크 (BOI14_network) | C++14 | 147 ms | 4704 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "network.h"
#include <bits/stdc++.h>
#define pii pair<int, int>
#define x first
#define y second
using namespace std;
const int N = 1e3+5;
map<pii, int> mp;
int get_dist(int a, int b) {
if(a == b) return 0;
else if(mp.count(pii(a, b))) return mp[pii(a, b)];
else return mp[pii(a, b)] = mp[pii(b, a)] = ping(a, b) + 1;
}
int len;
vector<int> dist[N];
void findRoute (int n, int a, int b) {
for(int i = 1; i <= n; i++) if(i != a) {
int now = get_dist(a, i);
dist[now].emplace_back(i);
if(i == b) len = now;
}
vector<int> ans = { b };
for(int i = len-1; i; i--) for(int x : dist[i])
if(get_dist(ans.back(), x) == 1) {
ans.emplace_back(x);
break;
}
reverse(ans.begin(), ans.end());
for(int x : ans) travelTo(x);
}
컴파일 시 표준 에러 (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... |