#include "obstacles.h"
#include <bits/stdc++.h>
using namespace std;
const int N=2e5+5;
vector<int>k;
long long n;
void initialize(vector<int> T, vector<int> H) {
n=H.size();
int j=0;
for(int j=0; j<H.size(); j++){
if(T[0]<=H[j]){
//x[j]=-1;
k.push_back(j);
}
else{
//x[j]=1;
}
//cout<<x[j]<<" ";
//x[j]=a;
//j++;
}
return;
}
bool can_reach(int L, int R, int S, int D) {
//L--,R--,S--,D--;
if(S>D)swap(S,D);
auto it=lower_bound(k.begin(),k.end(),S);
if(*it<D){
return 0;
}
//if(lower_bound(k.begin(),k.end(),S)<D)return 0;
else return true;
}
| # | 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... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |