prog.cpp: In function 'int main()':
prog.cpp:6:21: error: 'P' was not declared in this scope
for(int i = 0; i < P; i++){
^
prog.cpp:10:4: error: 'dp' was not declared in this scope
dp[i][j]=MAX;
^
prog.cpp:10:13: error: 'MAX' was not declared in this scope
dp[i][j]=MAX;
^
prog.cpp:11:18: error: expected ';' before 'q'
for(int q = 0 q<Q; q++){
^
prog.cpp:11:20: error: 'Q' was not declared in this scope
for(int q = 0 q<Q; q++){
^
prog.cpp:12:8: error: 'prisoner' was not declared in this scope
if(prisoner[q]>=i && prisoner[q]<=j)//if prisoner lies in range
^