# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
758587 | KN200711 | 경주 (Race) (IOI11_race) | C++14 | 433 ms | 111124 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "race.h"
# include <bits/stdc++.h>
# define ll long long
# define fi first
# define se second
using namespace std;
set< pair<ll, int> > nw[200001];
vector< pair<ll, int> > edge[200001];
int ans = 1e9 + 11;
int KK;
void dfs(int a, int pr, ll v, int c) {
nw[a].insert(make_pair(v, c));
for(int k=0;k<edge[a].size();k++) {
if(edge[a][k].fi == pr) continue;
dfs(edge[a][k].fi, a, v + edge[a][k].se, c+1);
if(nw[edge[a][k].fi].size() > nw[a].size()) swap(nw[a], nw[edge[a][k].fi]);
for(auto p : nw[edge[a][k].fi]) {
auto it = nw[a].lower_bound(make_pair(KK + 2ll * v - p.fi, 0));
if(it == nw[a].end()) continue;
if(it->fi == KK + 2ll * v - p.fi) ans = min(ans, it->se + p.se - 2 * c);
}
for(auto p : nw[edge[a][k].fi]) {
nw[a].insert(p);
}
}
}
int best_path(int N, int K, int H[][2], int L[]) {
컴파일 시 표준 에러 (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... |