# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3604 | The_KMJ_God | 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 AAA 1000000007
long long ds,de,dn,p;
long long num[110],D;
int main()
{
int i,j;
ds=de=p=0;
dn=1;
scanf("%d",&D);
for(i=1;i<=D;i++)
{
scanf("%d",&num[i]);
if(p-ds<0)
p+=AAA;
p=(de+((p-ds)*i)%AAA+num[i])%AAA;
dn=(dn*i)%AAA;
ds=(de+1)%AAA;
de=(ds+dn-1)%AAA;
printf("%lld\n",p);
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |