| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 784958 | thimote75 | Radio Towers (IOI22_towers) | C++17 | 4006 ms | 1360 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;
using idata = vector<int>;
idata heights;
int nbTowers;
void init(int N, idata H) {
nbTowers = N;
heights = H;
}
int max_towers(int L, int R, int D) {
idata dp(nbTowers, 0);
int curr = L; bool middle = false;
int count = 1;
for (int local = L + 1; local <= R; local ++) {
if (middle) {
if (heights[curr] >= heights[local] + D) {
curr = local;
middle = false;
count ++;
}
} else {
if (heights[local] >= heights[curr] + D) {
curr = local;
middle = true;
} else if (heights[local] < heights[curr]) curr = local;
}
}
return count;
}
| # | 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... | ||||
