# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3104 | ainta | 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 Mod=1000000007,n,k,i,a,S=1,F=1;
int main()
{
scanf("%lld",&n);
for(i=1;i<=n;i++){
scanf("%lld",&k);
k--;
a=a*i+k;
a%=Mod;
printf("%lld\n",(a+S)%Mod);
F*=i;
S+=F;
F%=Mod;
S%=Mod;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |