# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3585 | 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>
long long ds,de,dn,p;
int 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]);
p=(de+((p-ds)*i)%1000000007+num[i])%1000000007;
dn=(dn*i)%1000000007;
ds=(de+1)%1000000007;
de=(ds+dn-1)%1000000007;
printf("%lld\n",p);
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |