Submission #866502

#TimeUsernameProblemLanguageResultExecution timeMemory
866502vjudge1Radio Towers (IOI22_towers)C++17
Compilation error
0 ms0 KiB
#include "towers.h" #include<bits/stdc++.h> using namespace std; const int MAXN = 1e5 + 3; int p = 0; int a[MAXN]; void init(int N, vector<int> H) { int mx = 0; for (int i = 0; i < N; i++){ if (H[i] > mx) mx = H[i], p = i; a[i] = H[i]; } return; } int max_towers(int L, int R, int D) { if (p != 0 && p != N-1 && a[p-1] <= a[p]-D && a[p+1] <= a[p]-D){ return 2; } return 1; }

Compilation message (stderr)

towers.cpp: In function 'int max_towers(int, int, int)':
towers.cpp:17:21: error: 'N' was not declared in this scope
   17 |  if (p != 0 && p != N-1 && a[p-1] <= a[p]-D && a[p+1] <= a[p]-D){
      |                     ^