# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
943489 | SoSmolSten | 경주 (Race) (IOI11_race) | C++17 | 261 ms | 36944 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |