Submission #132825

#TimeUsernameProblemLanguageResultExecution timeMemory
132825dualityAsceticism (JOI18_asceticism)C++11
49 / 100
69 ms24824 KiB
#include <bits/stdc++.h> using namespace std; #define mp make_pair #define pb push_back typedef long long int LLI; typedef pair<int,int> pii; typedef vector<int> vi; typedef vector<pii> vpii; #define MOD 1000000007 LLI dp[3001][3001]; int main() { int N,K; cin >> N >> K; K--; int i,j; dp[1][0] = 1; for (i = 2; i <= N; i++) { dp[i][0] = 1; for (j = 1; j <= K; j++) dp[i][j] = (dp[i-1][j-1]*(i-j)+dp[i-1][j]*(j+1)) % MOD; } cout << dp[N][K] << endl; 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...