# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
5728 | baneling100 | 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 D, d[101];
void input(void)
{
long long i;
scanf("%lld",&D);
for(i=1 ; i<=D ; i++)
scanf("%lld",&d[i]);
}
void process(void)
{
long long i, now=0, node=1, num1=0, num2=0;
for(i=1 ; i<=D ; i++)
{
now=num2+(now-num1)*i+d[i];
now%=1000000007;
printf("%lld\n",now);
node*=i;
node%=1000000007;
num1=num2+1;
num1%=1000000007;
num2+=node;
num2%=1000000007;
}
}
int main(void)
{
input();
process();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |