Submission #1035140

#TimeUsernameProblemLanguageResultExecution timeMemory
1035140NeroZeinRadio Towers (IOI22_towers)C++17
Compilation error
0 ms0 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(a[l], a[r]) + d <= a[k]; }

Compilation message (stderr)

towers.cpp: In function 'int max_towers(int, int, int)':
towers.cpp:26:14: error: 'a' was not declared in this scope
   26 |   return max(a[l], a[r]) + d <= a[k];
      |              ^