제출 #824231

#제출 시각아이디문제언어결과실행 시간메모리
824231LiudasRadio Towers (IOI22_towers)C++17
0 / 100
4037 ms1456 KiB
#include "towers.h"

#include <cassert>
#include <cstdio>

#include <bits/stdc++.h>
using namespace std;
vector<int> h;
void init(int N, vector<int> H){
    h = H;
}
int max_towers(int L, int R, int D){
    int score = 0;
    for(int i = L; i <= R; i ++){
        int H = h[i];
        int s = 0;
        bool good = false;
        for(int j = L; j <= R; j ++){
            if(!good && h[j] + D <= H){
                s ++;
                good = true;
            }
            else if(good && h[j] >= H){
                good = false;
            }
        }
        score = max(score, s);
    }
    return max(1, score);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...