Submission #94533

#TimeUsernameProblemLanguageResultExecution timeMemory
94533tincamateiAsceticism (JOI18_asceticism)C++14
49 / 100
670 ms71068 KiB
#include <bits/stdc++.h> const int MAX_N = 3000; const int MOD = 1000000007; int dp[1+MAX_N][1+MAX_N]; int main() { int n, k; scanf("%d%d", &n, &k); dp[0][0] = 1; for(int i = 1; i <= n; ++i) for(int j = 1; j <= n; ++j) { dp[i][j] = ((long long)dp[i - 1][j] * j + (long long)dp[i - 1][j - 1] * (i - j + 1)) % MOD; } printf("%d", dp[n][k]); return 0; }

Compilation message (stderr)

asceticism.cpp: In function 'int main()':
asceticism.cpp:9:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d", &n, &k);
   ~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...