Submission #49646

#TimeUsernameProblemLanguageResultExecution timeMemory
49646longcqtAsceticism (JOI18_asceticism)C++11
49 / 100
58 ms25364 KiB
#include <bits/stdc++.h> using namespace std; const int N = 3e3 + 1; typedef long long ll; int n, k; ll d[N][N], base = 1e9 + 7; int main() { cin >> n >> k; for (int i = 1; i <= n; ++i) d[i][0] = 1; for (int i = 1; i <= n; ++i) for (int j = 1; j < i; ++j) d[i][j] = ((i - j)*d[i - 1][j - 1] + (j + 1)*(d[i - 1][j])) % base; cout << d[n][k - 1]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...