watching.cpp: In function 'bool test(int)':
watching.cpp:18:2: error: 'memset' was not declared in this scope
memset(dp, -1, sizeof dp);
^~~~~~
watching.cpp:18:2: note: suggested alternative: 'test'
memset(dp, -1, sizeof dp);
^~~~~~
test
watching.cpp: In function 'int main()':
watching.cpp:33:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d%d", &N, &P, &Q);
~~~~~^~~~~~~~~~~~~~~~~~~~~~
watching.cpp:34:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(int i=0;i<N;++i) scanf("%d", a+i);
~~~~~^~~~~~~~~~~