# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1234554 | Ghulam_Junaid | 송신탑 (IOI22_towers) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
#include "towers.h"
using namespace std;
int k;
vector<int> a;
void init(int n, vector<int> h) {
a = h;
k = 0;
while (k + 1 < n and h[k] < h[k + 1])
k++;
}
int max_towers(int L, int R, int D) {
return 1 + (L < k and k < R and h[R] + D <= h[k] and h[L] + D <= h[k]);
}