| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 60655 | theknife2001 | Race (IOI11_race) | C++17 | 8 ms | 5228 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "race.h"
#include <bits/stdc++.h>
using namespace std;
const int N=2e5+55;
vector < pair < int , int > > vec[N];
int b;
void df(int u , int p , int cnt , int c , int k)
{
if(cnt==k)
{
b=min(b,c);
return ;
}
if(cnt>k)
return ;
int v,x;
for(auto a:vec[u])
{
v=a.first;
x=a.second;
if(v==p)
continue ;
df(v,u,cnt+x,c+1,k);
}
}
int best_path(int n, int K, int H[][2], int L[])
{
for(int i=0;i<n-1;i++)
{
vec[H[i][0]].push_back({H[i][1],L[i]});
vec[H[i][1]].push_back({H[i][0],L[i]});
}
b=1e9+55;
for(int i=0;i<n;i++)
{
df(i,-1,0,0,K);
}
return b;
}
| # | 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... | ||||
