This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
const int maxn = 10100;
const ll mod = 1000007;
ll dp[maxn][maxn];
ll n, arr[maxn];
int main() {
cin>>n;
for(int i=1;i<=n;i++) {
cin>>arr[i];
}
dp[1][1] = 1LL;
for(int i=2;i<=n;i++) {
for(int j=1;j<=n;j++) {
dp[i][j] = j * dp[i-1][j] + dp[i-1][j-1];
}
}
ll result = 0LL;
for(int i=1;i<=n;i++) {
result += dp[n][i];
}
cout<<result<<"\n";
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |