# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
173250 | Akashi | Asceticism (JOI18_asceticism) | C++14 | 84 ms | 56564 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>
using namespace std;
const int MOD = 1e9 + 7;
int n, k;
int d[3005][3005];
int main()
{
scanf("%d%d", &n, &k);
d[1][1] = 1;
for(int i = 2; i <= n ; ++i)
for(int j = 1; j <= i ; ++j)
d[i][j] = (1LL * d[i - 1][j] * j + 1LL * d[i - 1][j - 1] * (i - j + 1)) % MOD;
printf("%d", d[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... |