# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
626298 | sword060 | Radio Towers (IOI22_towers) | C++17 | 4086 ms | 1444 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 <bits/stdc++.h>
#include "towers.h"
using namespace std;
int a[100005];
void init(int N,vector<int> H){
for(int i=0;i<H.size();i++)a[i]=H[i];
}
int max_towers(int L, int R, int D){
int ret=1;
for(int i=L+1;i<R;i++){
int c1=0,c2=0;
for(int j=i-1;j>=L;j--){
if(abs(a[i]-a[j])>D)break;
c1++;
}
for(int j=i+1;j<=R;j++){
if(abs(a[i]-a[j])>D)break;
c2++;
}
ret=max(ret,c1+c2);
}
return ret;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |