# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3713 | gs13068 | 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<cstdio>
int main()
{
long long now=0,bef=0,fact=1;
int i,n,a;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d",&a);
a--;
bef+=fact;
fact*=i;
fact%=1000000007;
now*=i;
now+=a;
now%=1000000007;
printf("%lld ",(bef+now)%1000000007);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |