| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 836574 | tengiz05 | Radio Towers (IOI22_towers) | C++17 | 729 ms | 2000 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 <bits/stdc++.h>
using namespace std;
vector<int> h;
int n;
vector<int> a;
void init(int N, vector<int> H) {
n = N;
h = H;
a.resize(n);
for (int i = 1; i < n - 1; i++) {
if ((h[i - 1] < h[i]) != (h[i] < h[i + 1])) {
a[i]++;
}
}
for (int i = 1; i < n; i++) {
a[i] += a[i - 1];
}
}
int max_towers(int l, int r, int D) {
if (l == r) {
return 1;
}
int sum = a[r - 1] - a[l];
// cout << sum << "\n";
if (h[l] > h[l + 1]) {
sum--;
}
return max(1, (sum + 3) / 2);
}
| # | 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... | ||||
