#include <bits/stdc++.h>
using namespace std;
int best_path(int n, int k, int h[][2], int l[]){
int le=0,ri=0,m=1e9,d=0;
while(ri<n){
if(d<k){
d+=l[ri];
ri++;
}
if(d==k){
m=min(m,ri-le);
}
if(d>=k){
d-=l[le];
le++;
}
}
if(m==1e9) return -1;
return m;
}
/*
int main(){
int n,k;
cin>>n>>k;
}
*/
# | 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... |