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;
int N, k;
vector<int> H;
void init(int n, vector<int> h) {
N = n;
H = h;
for(int i = 0; i < n-1; i++) {
if(h[i+1] < h[i]) {
k = i;
break;
}
}
}
int max_towers(int l, int r, int d) {
if(l < k && r > k && H[l] <= H[k]-d && H[r] <= H[k]-d)
return 2;
return 1;
}
# | 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... |