제출 #548361

#제출 시각아이디문제언어결과실행 시간메모리
548361krit3379캥거루 (CEOI16_kangaroo)C++14
36 / 100
5 ms792 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++){ if(j==k)continue; 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])%mod); return 0; }

컴파일 시 표준 에러 (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...