# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
635784 | activedeltorre | 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 <iostream>
#include <vector>
using namespace std;
int n,cent;
int h[200005];
init(int N_, vector<int>H_)
{
int n=N_;
int i;
for(i=1;i<=n;i++)
{
H_[i]=h[i-1];
if(h[i]==n)
{
cent=i;
}
}
}
max_towers(int L,int R,int D)
{
if(L<=cent && R>=cent && max(h[L],h[R])+D<=n)
{
return 2;
}
else
{
return 1;
}
}