# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1269327 | sula2 | Obstacles for a Llama (IOI25_obstacles) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
vector<int> T,H;
int n,m;
bool valid(int i, int j) {
return 0 <= min(i, j) && i < n && j < m && T[i] > H[j] && comp[i][j] == 0;
}
set<int> blocked;
void initialize(vector<int> _T, vector<int> _H) {
n = _T.size();
m = _H.size();
T = _T, H = _H;
for (int j = 0; j < n; j++) {
if (T[n-1] <= H[j]) {
blocked.insert(j);
}
}
}
bool can_reach(int l, int r, int s, int t) {
auto it = blocked.lower_bound(s);
return it == blocked.end() || *it > t;
}