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 "race.h"
int best_path(int N, int K, int H[][2], int L[])
{
int i,j,k;
int ans=N+1;
for(i=0;i<N-1;i++){
for(j=i+1;j<N;j++){
long long x=0;
for(k=i;k<j;k++){
x+=(long long)L[k];
}
if(x==K && ans>j-i)
ans=j-i;
}
}
if(ans==N+1)
ans=-1;
N=ans;
return N;
}
# | 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... |