Submission #747686

# Submission time Handle Problem Language Result Execution time Memory
747686 2023-05-24T13:21:29 Z Trisanu_Das Calvinball championship (CEOI15_teams) C++17
0 / 100
350 ms 392 KB
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007 

int main() {
    int n, mx = 0; cin >> n;
    int dp[n], a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) {
        for (int j = n; j >= 2; j--) dp[j] = (1ll * dp[j] * j % MOD + dp[j - 1]) % MOD;
        dp[mx] = (dp[mx] + a[i] - 1) % MOD, mx = max(mx, a[i]);
    }
    int ans = 0;
    for (int i = 1; i <= n; i++) ans = (ans + dp[i]) % MOD;
    cout << ans + 1 << '\n';
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 300 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 308 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 350 ms 392 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 91 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 344 ms 380 KB Output isn't correct
2 Halted 0 ms 0 KB -