# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
94533 | tincamatei | Asceticism (JOI18_asceticism) | C++14 | 670 ms | 71068 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
const int MAX_N = 3000;
const int MOD = 1000000007;
int dp[1+MAX_N][1+MAX_N];
int main() {
int n, k;
scanf("%d%d", &n, &k);
dp[0][0] = 1;
for(int i = 1; i <= n; ++i)
for(int j = 1; j <= n; ++j) {
dp[i][j] = ((long long)dp[i - 1][j] * j + (long long)dp[i - 1][j - 1] * (i - j + 1)) % MOD;
}
printf("%d", dp[n][k]);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |