Submission #60881

#TimeUsernameProblemLanguageResultExecution timeMemory
60881XmtosXAsceticism (JOI18_asceticism)C++17
49 / 100
221 ms93652 KiB
#include <bits/stdc++.h> using namespace std; const int N=3003,mod=1e9+7; int n,k; long long dp[N][N]; int main() { for (int i=1;i<N;i++) dp[i][1]=1; for (int j=2;j<N;j++) { for (int i=j;i<N;i++) { dp[i][j]=(dp[i-1][j-1]*(i-j+1))%mod; dp[i][j]+= j*dp[i-1][j]; dp[i][j]%=mod; } } cin >>n>>k; cout <<dp[n][k]; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...