Submission #527124

#TimeUsernameProblemLanguageResultExecution timeMemory
527124joelauCalvinball championship (CEOI15_teams)C++14
10 / 100
1 ms428 KiB
#include <bits/stdc++.h> using namespace std; long long N, A[105], memo[105][105], p = 1000007; long long dp (long long n, long long m) { if (n == N) return 1; if (memo[n][m] != -1) return memo[n][m]; return memo[n][m] = (dp(n+1,m) * m + dp(n+1,m+1)) % p; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> N; for (long long i = 0; i < N; ++i) cin >> A[i]; memset(memo,-1,sizeof(memo)); cout << dp(0,0); 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...