| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1339288 | khanhphucscratch | 장애물 (IOI25_obstacles) | C++20 | 53 ms | 5896 KiB |
#include "obstacles.h"
#include<bits/stdc++.h>
using namespace std;
vector<int> t, h;
void initialize(vector<int> T, vector<int> H) {
t = T; h = H;
}
bool can_reach(int L, int R, int S, int D) {
//Subtask 3+4
if(S > D) swap(S, D);
int l1 = S, r1 = S, l2 = D, r2 = D;
int minh1 = h[S], minh2 = h[D];
for(int i = 0; i < t.size(); i++){
if(t[i] <= minh1 || t[i] <= minh2) return 0;
while(l1 >= 1 && h[l1] < t[i]) minh1 = min(minh1, h[l1--]);
while(r1 < h.size() && h[r1] < t[i]) minh1 = min(minh1, h[r1++]);
while(l2 >= 1 && h[l2] < t[i]) minh2 = min(minh2, h[l2--]);
while(r2 < h.size() && h[r2] < t[i]) minh2 = min(minh2, h[r2++]);
if(r1 >= l2) return 1;
}
return 0;
}
| # | 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... | ||||
