towers.cpp: In function 'void init(int, std::vector<int>)':
towers.cpp:9:16: error: 'n' was not declared in this scope
9 | for(int i=1;i<n-1;i++){
| ^
towers.cpp:10:8: error: 'k' was not declared in this scope
10 | if(h[k]>h[k-1] && h[i]>h[i+1]) mx=i;
| ^
towers.cpp: In function 'int max_towers(int, int, int)':
towers.cpp:15:5: error: 'l' was not declared in this scope
15 | if(l>=mx || r<=mx) return 1;
| ^
towers.cpp:15:14: error: 'r' was not declared in this scope
15 | if(l>=mx || r<=mx) return 1;
| ^
towers.cpp:17:16: error: 'k' was not declared in this scope
17 | if(h[l]+D<=h[k] && h[r]+D<=h[k]) return 2;
| ^
towers.cpp:20:1: warning: control reaches end of non-void function [-Wreturn-type]
20 | }
| ^