Submission #1234556

#TimeUsernameProblemLanguageResultExecution timeMemory
1234556Ghulam_JunaidRadio Towers (IOI22_towers)C++20
4 / 100
254 ms1564 KiB
#include <bits/stdc++.h>
#include "towers.h"
using namespace std;

int k;
vector<int> h;
void init(int n, vector<int> H) {
    h = H;
    k = 0;
    while (k + 1 < n and h[k] < h[k + 1])
        k++;
}

int max_towers(int L, int R, int D) {
    return 1 + (L < k and k < R and h[R] + D <= h[k] and h[L] + D <= h[k]);
}
#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...