# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
44365 | RayaBurong25_1 | Asceticism (JOI18_asceticism) | C++17 | 54 ms | 24984 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 <stdio.h>
#define MOD 1000000007LL
long long DP[3005][3005];
int main()
{
int N, K;
scanf("%d %d", &N, &K);
int i, j;
DP[1][0] = 1;
for (i = 1; i <= N; i++)
{
for (j = 0; j < i && j < K; j++)
{
// printf("%d %d = %lld\n", i, j, DP[i][j]);
DP[i + 1][j] = (DP[i + 1][j] + (j + 1)*DP[i][j])%MOD;
DP[i + 1][j + 1] = (DP[i + 1][j + 1] + (i - j)*DP[i][j])%MOD;
}
}
printf("%lld", DP[N][K - 1]);
}
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... |