Submission #756847

#TimeUsernameProblemLanguageResultExecution timeMemory
756847Dan4LifeAsceticism (JOI18_asceticism)C++17
49 / 100
36 ms25044 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; const ll MOD = (ll)1e9+7; ll n,k,d[3010][3010]; int main(){ cin >> n >> k; d[1][1] = 1; for(int i = 2; i <= n; i++) for(int j = 1; j <= k; j++) d[i][j] = (d[i-1][j-1]*(i-j+1)+d[i-1][j]*j)%MOD; cout << d[n][k] << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...