# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3516 | shinhj88 | Inherited disease (kriii1_I) | C++98 | 0 ms | 1088 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
#define P 1000000007
int main(){
long long d, i, di, a=1, b, t, t1=0, t2=1;
scanf("%lld", &d);
for(i=1;i<=d;++i){
scanf("%lld", &di);
b=((a-1)*i+di)%P;
printf("%d\n", (b+t1)%P);
t1=(t1+t2)%P;
t2=(t2*(i+1))%P;
a=b;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |