# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
635783 | 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>vec)
{
int n=N;
int i;
for(i=1;i<=n;i++)
{
h[i]=vec[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;
}
}