# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1234554 | Ghulam_Junaid | Radio Towers (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]);
}