Submission #3603

#TimeUsernameProblemLanguageResultExecution timeMemory
3603qja0950Inherited disease (kriii1_I)C++98
1 / 1
0 ms1088 KiB
#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 timeMemoryGrader output
Fetching results...