# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
3603 | qja0950 | 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>
int d, x;
long long int last=1, fac=1, sum=1, ans;
int main() {
scanf("%d", &d);
int i;
scanf("%d", &x);
printf("%d", x);
for(i=2; i<=d; i++) {
scanf("%d", &x);
last=(last-1)*i+x; last%=1000000007;
ans=(sum+last)%1000000007;
printf(" %lld", ans);
fac*=i;fac%=1000000007;
sum+=fac;sum%=1000000007;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |