Submission #5728

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