Language: C

N,M,dp[5001],x,i,j,a;
main(){scanf("%d%d",&N,&M);dp[0]=1;for(;i<N-1;i++){x=min(i+1,N-i);for(j=x;j<=N;j++)dp[j]=(dp[j]+dp[j-x])%M;}for(i=0;i<=N;i++)a=(a+(N-i)*(long long)dp[i])%M;printf("%d\n",a);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | N,M,dp[5001],x,i,j,a;
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'M' [-Wimplicit-int]
    1 | N,M,dp[5001],x,i,j,a;
      |   ^
main.c:1:5: error: type defaults to 'int' in declaration of 'dp' [-Wimplicit-int]
    1 | N,M,dp[5001],x,i,j,a;
      |     ^~
main.c:1:14: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int]
    1 | N,M,dp[5001],x,i,j,a;
      |              ^
main.c:1:16: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
    1 | N,M,dp[5001],x,i,j,a;
      |                ^
main.c:1:18: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int]
    1 | N,M,dp[5001],x,i,j,a;
      |                  ^
main.c:1:20: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
    1 | N,M,dp[5001],x,i,j,a;
      |                    ^
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){scanf("%d%d",&N,&M);dp[0]=1;for(;i<N-1;i++){x=min(i+1,N-i);for(j=x;j<=N;j++)dp[j]=(dp[j]+dp[j-x])%M;}for(i=0;i<=N;i++)a=(a+(N-i)*(long long)dp[i])%M;printf("%d\n",a);}
      | ^~~~
main.c: In function 'main':
main.c:2:8: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    2 | main(){scanf("%d%d",&N,&M);dp[0]=1;for(;i<N-1;i++){x=min(i+1,N-i);for(j=x;j<=N;j++)dp[j]=(dp[j]+dp[j-x])%M;}for(i=0;i<=N;i++)a=(a+(N-i)*(long long)dp[i])%M;printf("%d\n",a);}
      |        ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | N,M,dp[5001],x,i,j,a;
main.c:2:8: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    2 | main(){scanf("%d%d",&N,&M);dp[0]=1;for(;i<N-1;i++){x=min(i+1,N-i);for(j=x;j<=N;j++)dp[j]=(dp[j]+dp[j-x])%M;}for(i=0;i<=N;i++)a=(a+(N-i)*(long long)dp[i])%M;printf("%d\n",a);}
      |        ^~~~~
main.c:2:8: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:2:54: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
    2 | main(){scanf("%d%d",&N,&M);dp[0]=1;for(;i<N-1;i++){x=min(i+1,N-i);for(j=x;j<=N;j++)dp[j]=(dp[j]+dp[j-x])%M;}for(i=0;i<=N;i++)a=(a+(N-i)*(long long)dp[i])%M;printf("%d\n",a);}
      |                                                      ^~~
      |                                                      main
main.c:2:157: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    2 | main(){scanf("%d%d",&N,&M);dp[0]=1;for(;i<N-1;i++){x=min(i+1,N-i);for(j=x;j<=N;j++)dp[j]=(dp[j]+dp[j-x])%M;}for(i=0;i<=N;i++)a=(a+(N-i)*(long long)dp[i])%M;printf("%d\n",a);}
      |                                                                                                                                                             ^~~~~~
main.c:2:157: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:2:157: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:2:157: note: include '<stdio.h>' or provide a declaration of 'printf'