Submission #5729

#TimeUsernameProblemLanguageResultExecution timeMemory
5729baneling100Inherited disease (kriii1_I)C++98
1 / 1
0 ms1088 KiB
#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=1, node=1, num=0; for(i=1 ; i<=D ; i++) { now=(now-1)*i+d[i]; now%=1000000007; printf("%lld\n",(num+now)%1000000007); node*=i; node%=1000000007; num+=node; num%=1000000007; } } int main(void) { input(); process(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...