Submission #1035141

#TimeUsernameProblemLanguageResultExecution timeMemory
1035141NeroZeinRadio Towers (IOI22_towers)C++17
0 / 100
511 ms1600 KiB
#include "towers.h" #include <bits/stdc++.h> using namespace std; const int LOG = 18; int n; int k; vector<int> h; vector<int> pref; void init(int N_, vector<int> H_) { n = N_, h = H_; for (int i = 1; i < n; ++i) { if (h[i] > h[i - 1] && h[i] > h[i + 1]) { k = i; break; } } } int max_towers(int l, int r, int d) { if (l >= k || r <= k) { return 1; } return max(h[l], h[r]) + 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...