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;
using ll = long long;
using vll = vector <ll>;
using vi = vector <int>;
ll n, k;
vll ve;
void init (int n, vi ve) {
::n = n;
k = 0;
::ve = vll(ve.begin(), ve.end());
while (ve[k] < ve[k+1]) k++;
}
int max_towers (int ql, int qr, int d) {
if (k <= ql || qr <= k) return 1;
if (ve[ql] <= ve[k]-d && ve[qr] <= ve[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... |