Submission #1082238

#TimeUsernameProblemLanguageResultExecution timeMemory
1082238jer033Radio Towers (IOI22_towers)C++17
0 / 100
483 ms1880 KiB
#include "towers.h" #include <vector> #include <bits/stdc++.h> using namespace std; const int INF = 2'000'000'000; vector<int> H; int N; vector<int> comm; void init(int n, std::vector<int> h) { H = h; N = n; comm = vector<int> (N-1, 0); for (int i=1; i<(N-1); i++) { comm[i] = comm[i-1]; if ((H[i]>H[i-1]) and (H[i]>H[i+1])) comm[i]++; } } int max_towers(int L, int R, int D) { if ((R-L)<=1) return 1; return 1+comm[R-1]-comm[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...