Submission #62343

#TimeUsernameProblemLanguageResultExecution timeMemory
62343gusfringAsceticism (JOI18_asceticism)C++14
49 / 100
197 ms93628 KiB
#include <bits/stdc++.h> using namespace std; const int N=3003,mod=1e9+7; int n,k; long long dp[N][N]; int main(){ for (int i=1;i<N;i++) dp[i][1]=1; for (int j=2;j<N;j++){ for (int i=j;i<N;i++){ dp[i][j]=(dp[i-1][j-1]*(i-j+1))%mod; dp[i][j]+= j*dp[i-1][j]; dp[i][j]%=mod; } } scanf("%d %d", &n, &k); cout <<dp[n][k]; return 0; }

Compilation message (stderr)

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