| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 229657 | DavidDamian | Race (IOI11_race) | C++11 | 56 ms | 12664 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "race.h"
#include<bits/stdc++.h>
using namespace std;
///Subtask 2
///N Searches
typedef long long ll;
struct edge
{
int to;
ll w;
};
vector<edge> adjList[200005];
int k;
int minimum=INT_MAX;
void dfs_sub2(int u,int p,int depth,int path)
{
if(path==k) minimum=min(minimum,depth);
for(edge e: adjList[u]){
int v=e.to;
ll w=e.w;
if(p==v) continue;
dfs_sub2(v,u,depth+1,path+w);
}
}
int best_path(int n, int K, int H[][2], int L[])
{
k=K;
for(int i=0;i<n-1;i++){
int a=H[i][0];
int b=H[i][1];
ll w=L[i];
adjList[a].push_back({b,w});
adjList[b].push_back({a,w});
}
if(n<=1000){
for(int u=0;u<n;u++){
dfs_sub2(u,-1,0,0);
}
return (minimum!=INT_MAX)? minimum : -1;
}
}
컴파일 시 표준 에러 (stderr) 메시지
| # | 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... | ||||
