# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
43689 | evpipis | Race (IOI11_race) | C++11 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> ii;
const int len = 2e5+5, inf = 1e9;
vector<ii> adj[len];
map<ll, int> *cnt, *help;
int ans = inf, sz[len], dep[len], p[len], n, k, isbig[len];
ll shift[len];
void fix(int u, int d){
sz[u] = 1;
dep[u] = d;
for (auto v: adj[u])
if (v.fi != p[u]){
p[v.fi] = u;
fix(v.fi, d+1);
sz[u] += sz[v.fi];
}
}
void add(int u, int x, int cur, ll dis){
if (x == 0 && (*help).count(k-dis-shift[cur]))
ans = min(ans, dep[u]+(*help)[k-dis-shift[cur]]-2*dep[cur]);