# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
943489 | SoSmolSten | 경주 (Race) (IOI11_race) | C++17 | 261 ms | 36944 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "race.h"
#define pp pair<int, int>
#define F first
#define S second
using namespace std;
const int SZ = 2e5 + 10, M = 1e6 + 10, INF = 1e9;
vector<pp> graph[SZ];
int mn[M], ti[M], c[SZ], n, k, ans = INF, cnt = 0;
bool del[SZ];
void dfs(int u, int p){
c[u] = 1;
for(auto &[v, w] : graph[u]){
if(v == p || del[v]) continue;
dfs(v, u);
c[u] += c[v];
}
}
void upd(int u, int p, int w, int d){
if(w > k) return;
if(ti[w] != cnt) mn[w] = d;
else mn[w] = min(mn[w], d);
ti[w] = cnt;
for(auto &[v, l] : graph[u]){
if(v == p || del[v]) continue;
upd(v, u, w + l, d + 1);
}
# | 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... |