Main.cc: In function ‘int main()’:
Main.cc:11:14: error: ‘p’ was not declared in this scope
if(x-d>=1&&p[x-d]!=0&&p[x-d]<=m){
^
Main.cc:15:14: error: ‘p’ was not declared in this scope
if(x+d<=n&&p[x+d]!=0&&p[x+d]<=m){
^