제출 #1299257

#제출 시각아이디문제언어결과실행 시간메모리
1299257lizi14Obstacles for a Llama (IOI25_obstacles)C++20
0 / 100
48 ms6160 KiB
#include "obstacles.h" #include <bits/stdc++.h> using namespace std; const int N=2e5+5; vector<int>k; vector<int>h; long long n,bati; void initialize(vector<int> T, vector<int> H) { n=H.size(); int j=0; bati=T.size(); 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++; } for(int i=0; i<H.size(); i++){ if(T[n-1]<=H[i]){ h.push_back(i); //x[i]=-1; } } return; } bool can_reach(int L, int R, int S, int D) { //L--,R--,S--,D--; if(S>D)swap(S,D); if(bati==1){ auto it=lower_bound(k.begin(),k.end(),S); if(it!=k.end() && *it<D){ return 0; } //if(lower_bound(k.begin(),k.end(),S)<D)return 0; else return true; } else{ auto it=lower_bound(h.begin(),h.end(),S); if(it!=h.end() && *it<D){ return 0; } //if(lower_bound(k.begin(),k.end(),S)<D)return 0; else return true; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...