# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
866502 | vjudge1 | Radio Towers (IOI22_towers) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "towers.h"
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 3;
int p = 0;
int a[MAXN];
void init(int N, vector<int> H) {
int mx = 0;
for (int i = 0; i < N; i++){
if (H[i] > mx) mx = H[i], p = i;
a[i] = H[i];
}
return;
}
int max_towers(int L, int R, int D) {
if (p != 0 && p != N-1 && a[p-1] <= a[p]-D && a[p+1] <= a[p]-D){
return 2;
}
return 1;
}