#pragma GCC optimize("O3")
#include "race.h"
#include <bits/stdc++.h>
using namespace std;
const int sz = 1e5+5;
int best_path(int n, int k, int h[][2], int l[]){
int s = 0;
int mn = INT_MAX;
int le = 0;
for(int i = 0; i < n-1; i++){
s+=l[i];
while(s>k){
s-=l[le++];
}if(s == k){
mn = min(mn, i-le+1);
}
}return (mn == INT_MAX ? -1 : mn);
}
# | 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... |