/in/foo.cc:4:1: error: 'INF' does not name a type
INF=0x7fffffff;
^~~
/in/foo.cc:5:1: error: 'MOD' does not name a type
MOD=10000;
^~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:19:50: error: 'MOD' was not declared in this scope
if(f[i]==f[j]+1)p[i]=(p[i]+p[j])%MOD;
^~~
/in/foo.cc:18:15: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
if(a[j]>a[i])
^
/in/foo.cc:23:54: error: 'MOD' was not declared in this scope
for(int i=1;i<=n;i++)if(f[i]==ans)tot=(tot+p[i])%MOD;
^~~