Submission #823737

#TimeUsernameProblemLanguageResultExecution timeMemory
823737boyliguanhanRadio Towers (IOI22_towers)C++17
14 / 100
765 ms1488 KiB
#include "towers.h" #include <bits/stdc++.h> using namespace std; int n, pre[200100], cnt[200100]; void init(int N, vector<int> H) { for(int i = 1; i < N-1; i++) pre[i]=pre[i-1]+(H[i]>max(H[i-1],H[i+1])); pre[n-1] = pre[n-2]; } int max_towers(int L, int R, int D) { if(R-L<2) return 1; return pre[R-1]-pre[L]+1; }
#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...