| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1369271 | leolin0214 | Radio Towers (IOI22_towers) | C++20 | 139 ms | 1816 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;
int n = 0;
int k = 0;
vector<int> h;
void init(int N, std::vector<int> H) {
h = H;
n = N;
h.push_back(-1);
for (int i=0; i<n; i++) {
if (h[i] > h[i+1]) {
k = i;
break;
}
}
}
int max_towers(int L, int R, int D) {
return (L < k && k < R && max(h[R], h[L]) <= n-1-D) ? 2 : 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... | ||||
