Submission #171894

#TimeUsernameProblemLanguageResultExecution timeMemory
171894arnold518Asceticism (JOI18_asceticism)C++14
49 / 100
128 ms94712 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 3000; const ll MOD = 1e9+7; int N, K; ll dp[MAXN+10][MAXN+10]; int main() { int i, j; scanf("%d%d", &N, &K); dp[1][1]=1; for(i=2; i<=N; i++) for(j=1; j<=i; j++) dp[i][j]=(j*dp[i-1][j]+(i-j+1)*dp[i-1][j-1])%MOD; printf("%lld", dp[N][K]); }

Compilation message (stderr)

asceticism.cpp: In function 'int main()':
asceticism.cpp:18:10: 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...