# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
625468 | model_code | 송신탑 (IOI22_towers) | C++17 | 4074 ms | 1516 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// time_limit/solution-quadratic.cpp
#include "towers.h"
#include <bits/stdc++.h>
using namespace std;
int N;
vector<int> H;
vector<bool> used;
void init(int _N, std::vector<int> _H) {
N = _N;
H = _H;
used.resize(N);
}
int max_towers(int L, int R, int D) {
vector<int> towers(R - L + 1);
iota(towers.begin(), towers.end(), L);
sort(towers.begin(), towers.end(), [&] (int i, int j) {
return H[i] < H[j];
});
fill(used.begin() + L, used.begin() + R + 1, false);
for (int i : towers) {
bool can_use = true;
for (int dir : {-1, 1}) {
for (int j = i + dir; L <= j && j <= R && can_use; j += dir) {
if (H[i] <= H[j] - D) {
break;
}
# | 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... |