# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
163293 | 2019-11-12T13:08:56 Z | dantoh000 | Calvinball championship (CEOI15_teams) | C++14 | 204 ms | 836 KB |
#include <bits/stdc++.h> using namespace std; const int mod = 1000007; int main(){ int n; scanf("%d",&n); int a[n]; int k[n]; for (int i = 0; i < n; i++) { scanf("%d",&a[i]); if (i) k[i] = max(k[i-1],a[i]); else k[i] = a[i]; } int ct[2][n+1]; int ans = a[n-1]; for (int i = 1; i <= n; i++){ ct[0][i] = i; } for (int j = 1; j < n; j++){ ct[j%2][1] = ct[1-j%2][1]; printf("adding %d %d\n",a[n-j-1]-1,ct[1-j%2][k[n-j-1]]); ans += (a[n-j-1]-1)*ct[1-j%2][k[n-j-1]]; ans %= mod; for (int i = 2; i < n; i++){ ct[j%2][i] = ct[1-j%2][i]+ct[1-j%2][i-1]; ct[j%2][i] %= mod; } } printf("%d",ans); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Output isn't correct |
2 | 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 | 256 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 192 ms | 836 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 52 ms | 504 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 204 ms | 664 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |