# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
156347 | 2019-10-05T09:29:00 Z | Akashi | Calvinball championship (CEOI15_teams) | C++14 | 96 ms | 65540 KB |
///calculez partitii de n #include <bits/stdc++.h> using namespace std; const int MOD = 1e6 + 7; int n; int a[10005]; int d[10005][10005]; int main() { scanf("%d", &n); for(int i = 1; i <= n ; ++i) scanf("%d", &a[i]); int l = 0, cnt = 1; ///numarul de siruri care au lungimea i si incep cu caracterul j for(int i = 1; i <= n ; ++i) d[1][i] = 1; for(int i = 2; i <= n ; ++i) for(int j = 1; j <= n ; ++j) d[i][j] = (d[i - 1][j] * j + d[i - 1][j + 1]) % MOD; for(int i = 2; i <= n ; ++i){ for(int j = 1; j <= a[i] - 1 ; ++j){ cnt += d[n - i + 1][j]; if(cnt >= MOD) cnt -= MOD; } } printf("%d", cnt); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 0 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 252 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Incorrect | 2 ms | 376 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 760 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 760 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 3320 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 10 ms | 8312 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 96 ms | 65540 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 86 ms | 65540 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 93 ms | 65540 KB | Execution killed with signal 9 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |