# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
592334 | shrimb | 경주 (Race) (IOI11_race) | C++17 | 300 ms | 78456 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
#include "race.h"
using namespace std;
const int maxn = 200001;
vector<pair<int,int>> adj[maxn];
int k;
unordered_map<long long,int> *maps[maxn];
void Check (int cur, int x, int y, int& ret, int dep2, int dep) {
if (maps[cur] -> count(k + 2 * dep - x)) {
ret = min(ret, y + (*maps[cur])[k + 2 * dep - x] - 2 * dep2);
}
}
void Insert (int cur, int x, int y) {
if (maps[cur] -> count(x)) (*maps[cur])[x] = min((*maps[cur])[x], y);
else (*maps[cur])[x] = y;
}
int dfs (int cur, int par, int dep, int dep2) { // dep = sum of weights // dep2 = number of edges from root
if ((adj[cur].empty()) || (adj[cur].size() == 1 and cur != 0)) {
maps[cur] = new unordered_map<long long, int>();
maps[cur] -> insert({dep, dep2});
return INT_MAX;
}
# | 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... |