Submission #1000774

#TimeUsernameProblemLanguageResultExecution timeMemory
1000774ALTAKEXERace (IOI11_race)C++17
0 / 100
0 ms2392 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; int N, K; int H[2000][2]; int L[2000]; bool vis[2000]={0}; vector<pair<int,int>>v[2000]; ll mi=INT_MAX; void dfs(int q, int dis, int hi){ int m=v[q].size(); if(dis==K){ if(hi<mi)mi=hi; } for(int i=0; i<m; i++){ int k=v[q][i].first; ll cost=v[q][i].second; if(!vis[k]){ vis[k]=1; dfs(k,dis+cost,hi+1); } } } int best_path(int N, int K, int H[2000][2], int L[2000]){ for(int i=0; i<=N-1; i++){ for(int i=0; i<N; i++){ vis[i]=0; } vis[i]=1; dfs(i,0,0); //ehleh oroi distance highway } if(mi==INT_MAX)return -1; else return mi; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...