friend.cpp: In function 'int ans(int)':
friend.cpp:7:9: error: 'dp' was not declared in this scope
if(!dp[state])
^~
friend.cpp:7:9: note: suggested alternative: 'p'
if(!dp[state])
^~
p
friend.cpp:10:19: error: 'n' was not declared in this scope
for(int i=0;i<n;i++)
^
friend.cpp:13:19: error: 'n' was not declared in this scope
for(int i=0;i<n;i++)
^
friend.cpp:24:5: error: 'dp' was not declared in this scope
dp[state]=ret;
^~
friend.cpp:24:5: note: suggested alternative: 'p'
dp[state]=ret;
^~
p
friend.cpp: In function 'int findSample(int, int*, int*, int*)':
friend.cpp:47:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^