Submission #1035144

#TimeUsernameProblemLanguageResultExecution timeMemory
1035144NeroZeinRadio Towers (IOI22_towers)C++17
4 / 100
604 ms1368 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] ? 2 : 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...