| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1369207 | leolin0214 | Radio Towers (IOI22_towers) | C++20 | 142 ms | 1560 KiB |
#include "towers.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#define ff first
#define ss second
#define pii pair<int, int>
using namespace std;
vector<int> p;
void init(int N, std::vector<int> H) {
int n = N;
H.insert(H.begin(), n);
H.push_back(n);
p.resize(n+1);
for (int i=1; i<=n; i++) {
if (H[i] < min(H[i+1], H[i-1])) {
p[i]++;
}
}
partial_sum(p.begin(), p.end(), p.begin());
}
int max_towers(int L, int R, int D) {
L++, R++;
return p[R] - p[L-1];
}
| # | 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... | ||||
