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 <cassert>
#include <cstdio>
#include <bits/stdc++.h>
using namespace std;
vector<int> h;
void init(int N, vector<int> H){
h = H;
}
int max_towers(int L, int R, int D){
int score = 0;
for(int i = L; i <= R; i ++){
int H = h[i];
int s = 0;
bool good = false;
for(int j = L; j <= R; j ++){
if(!good && h[j] + D <= H){
s ++;
good = true;
}
else if(good && h[j] >= H){
good = false;
}
}
score = max(score, s);
}
return max(1, score);
}
# | 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... |