| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1366753 | mannshah1211 | Radio Towers (IOI22_towers) | C++20 | 4074 ms | 1976 KiB |
#include "towers.h"
#include <bits/stdc++.h>
#include <vector>
using namespace std;
vector<int> hh;
void init(int n, vector<int> h) {
hh = h;
}
int max_towers(int l, int r, int d) {
vector<int> x;
x.push_back(0);
for (int i = l; i <= r; i++) {
x.push_back(hh[i]);
}
int n = x.size();
vector<int> dp(n + 1);
for (int i = 1; i <= n; i++) {
dp[i] = 1;
int mx = 0;
for (int j = i - 1; j >= 1; j--) {
mx = max(mx, x[j]);
if (mx >= max(x[i], x[j]) + d) {
dp[i] = max(dp[i], dp[j] + 1);
}
}
}
return *max_element(dp.begin(), dp.end());
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
