Submission #548353

#TimeUsernameProblemLanguageResultExecution timeMemory
548353krit3379Kangaroo (CEOI16_kangaroo)C++17
6 / 100
5 ms724 KiB
#include<bits/stdc++.h> using namespace std; #define N 45 int a[N][N][N],d[N][N][N],mod=1e9+7; int main(){ int n,s,e,i,j,k,l; scanf("%d %d %d",&n,&s,&e); if(n>40)return 0; a[2][1][2]=1; d[2][2][1]=1; for(i=3;i<=n;i++){ for(j=1;j<=i;j++){ for(k=1;k<=i;k++){ for(l=1;l<=i;l++){ if(l!=k){ if(l<j){ d[i][j][k]=(d[i][j][k]+a[i-1][l][k-(j<k)])%mod; } else if(l>j){ a[i][j][k]=(a[i][j][k]+d[i-1][l-1][k-(j<k)])%mod; } } } } } } printf("%d",a[n][s][e]+d[n][s][e]); return 0; }

Compilation message (stderr)

kangaroo.cpp: In function 'int main()':
kangaroo.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |     scanf("%d %d %d",&n,&s,&e);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...