Submission #110612

#TimeUsernameProblemLanguageResultExecution timeMemory
110612someone_aaCalvinball championship (CEOI15_teams)C++17
10 / 100
89 ms66560 KiB
#include <bits/stdc++.h> #define ll long long #define pb push_back #define mp make_pair using namespace std; const int maxn = 11000; const ll mod = 1000007; ll dp[maxn][maxn]; ll a[maxn], n; int main() { cin>>n; for(int i=1;i<=n;i++) { cin>>a[i]; } dp[1][1] = 1LL; for(int i=2;i<=n;i++) { for(int j=1;j<=n;j++) { dp[i][j] = dp[i-1][j-1] + 1LL * j * dp[i-1][j]; dp[i][j] %= mod; } } ll sum = 0LL; for(int i=1;i<=n;i++) { sum += dp[n][i]; sum %= mod; } cout<<sum<<"\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...