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"
#define inf 1<<22
int best_path(int N, int K, int H[][2], int L[])
{
int opt= -1;
for(int i=0; i<N; i++) {
int sum = 0;
for(int j=i+1; j<N; j++) {
sum+= L[j-1];
if(sum==K) {
if( (j-i)<opt or opt==-1 ) opt = j-i;
}
if(sum>K) break;
}
}
return opt;
}
# | 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... |