# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
4183 | 2013-09-03T10:14:25 Z | Hidden | Inherited disease (kriii1_I) | C++ | 0 ms | 1088 KB |
#include <stdio.h> int main() { int c, p[100], tmp=1; long long num=0; scanf("%d", &c); for(int i=0;i<c;i++) { scanf("%d", &p[i]); } for(int i=0;i<c;i++) { if(i>0) { num=num+p[i]+((i+1)*(p[i-1]-1))+(tmp-p[i-1]); p[i]+=(p[i-1]-1)*(i+1); tmp*=(i+1); } else num=num+p[i]; printf("%lld\n", num%1000000007); } }
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 1088 KB | Output is correct |
2 | Incorrect | 0 ms | 1088 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |