# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
139444 | reda | Race (IOI11_race) | C++14 | 0 ms | 0 KiB |
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 <bits/stdc++.h>
using namespace std ;
int best_path(int N,int K,int H[][],int L [] )
{
int start = -1;
int endr = -1;
int mn = 1e9+7;
for(int i = 0; i < L.size(); i++) {
int currentSum = 0;
for(int j = i; j < L.size()&& (j-i+1) < mn; j++) {
currentSum += L[j];
if(currentSum == K) {
start = i;
endr = j;
mn = endr- start + 1;
break;
} }
}
return mn;
}