Submission #1035137

#TimeUsernameProblemLanguageResultExecution timeMemory
1035137NeroZeinRadio Towers (IOI22_towers)C++17
14 / 100
625 ms1932 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_; pref.resize(n - 1); for (int i = 1; i < n - 1; ++i) { pref[i] = (h[i - 1] < h[i]) && (h[i] > h[i + 1]); } for (int i = 1; i < n - 1; ++i) { pref[i] += pref[i - 1]; } } int max_towers(int l, int r, int d) { assert(d == 1); if (l == r) { return 1; } int ans = pref[r - 1] - pref[l] + 1; return ans; }
#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...