Submission #15321

#TimeUsernameProblemLanguageResultExecution timeMemory
15321tonyjjw접미사 배열의 개수 (kriii3_W)C++98
10 / 46
14 ms9052 KiB
#include<stdio.h> int n,m; long long int dp[1010][1010]; int mod=1000000007; int main(){ int i,j; scanf("%d%d",&n,&m); for(i=1;i<=m;i++){ dp[1][i]=1; } for(j=2;j<=n;j++){ for(i=1;i<=m;i++){ dp[j][i]=dp[j-1][i]*i+dp[j-1][i-1]*(j-i); dp[j][i]%=mod; } } printf("%lld",dp[n][m]); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...