| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1369208 | leolin0214 | 송신탑 (IOI22_towers) | C++20 | 186 ms | 1948 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;
vector<int> h;
void init(int N, std::vector<int> H) {
int n = N;
H.insert(H.begin(), n);
H.push_back(n);
h = H;
p.resize(n+1);
for (int i=2; i<=n-1; 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) {
if (L == R) return 1;
L++, R++;
int ans = p[R-1] - p[L];
if (h[L] < h[L+1]) ans++;
if (h[R] < h[R-1]) ans++;
return ans;
}
| # | 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... | ||||
