watching.cpp:5:8: error: 'MAXN' was not declared in this scope
int dp[MAXN][MAXN], a[MAXN],p,q,n;
^~~~
watching.cpp:5:8: note: suggested alternative: 'NAN'
int dp[MAXN][MAXN], a[MAXN],p,q,n;
^~~~
NAN
watching.cpp:5:14: error: 'MAXN' was not declared in this scope
int dp[MAXN][MAXN], a[MAXN],p,q,n;
^~~~
watching.cpp:5:14: note: suggested alternative: 'NAN'
int dp[MAXN][MAXN], a[MAXN],p,q,n;
^~~~
NAN
watching.cpp:5:23: error: 'MAXN' was not declared in this scope
int dp[MAXN][MAXN], a[MAXN],p,q,n;
^~~~
watching.cpp:5:23: note: suggested alternative: 'NAN'
int dp[MAXN][MAXN], a[MAXN],p,q,n;
^~~~
NAN
watching.cpp: In function 'int findlast(int, int)':
watching.cpp:7:28: error: 'a' was not declared in this scope
return max(lower_bound(a+1,a+1+n,cur-w+1)-a-1,0);
^
watching.cpp: In function 'bool check(int)':
watching.cpp:10:12: error: 'dp' was not declared in this scope
memset(dp,0x3f,sizeof dp); memset(dp[0],0,sizeof dp[0]);
^~
watching.cpp:10:12: note: suggested alternative: 'p'
memset(dp,0x3f,sizeof dp); memset(dp[0],0,sizeof dp[0]);
^~
p
watching.cpp:12:25: error: 'a' was not declared in this scope
int lp = findlast(a[i],w), lq = findlast(a[i],w<<1);
^
watching.cpp:14:27: error: 'lq' was not declared in this scope
dp[i][j] = dp[lq][j] + 1;
^~
watching.cpp:14:27: note: suggested alternative: 'lp'
dp[i][j] = dp[lq][j] + 1;
^~
lp
watching.cpp: In function 'int main()':
watching.cpp:24:47: error: 'a' was not declared in this scope
for (int i = 1; i <= n; i++) scanf ("%d",&a[i]);
^
watching.cpp:25:10: error: 'a' was not declared in this scope
sort(a+1,a+1+n);
^
watching.cpp:22:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf ("%d %d %d",&n,&p,&q);
~~~~~~^~~~~~~~~~~~~~~~~~~~~