# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
48230 | kawaiigrabrielneko | Asceticism (JOI18_asceticism) | C++14 | 105 ms | 93784 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 <cstdio>
#include <algorithm>
using namespace std;
long long dp[3009][3009];
int main(){
int N, K;
scanf("%d %d", &N, &K);
dp[1][1] = 1;
for (int n = 2; n <= N; n++){
for (int k = 1; k <= n; k++){
dp[n][k] = (k*dp[n-1][k]+ (n-k+1)*dp[n-1][k-1])%1000000007L;
}
}
printf("%d", dp[N][K]);
}
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... |