Submission #3585

#TimeUsernameProblemLanguageResultExecution timeMemory
3585The_KMJ_GodInherited disease (kriii1_I)C++98
0 / 1
0 ms1088 KiB
#include<stdio.h> long long ds,de,dn,p; int num[110],D; int main() { int i,j; ds=de=p=0; dn=1; scanf("%d",&D); for(i=1;i<=D;i++) { scanf("%d",&num[i]); p=(de+((p-ds)*i)%1000000007+num[i])%1000000007; dn=(dn*i)%1000000007; ds=(de+1)%1000000007; de=(ds+dn-1)%1000000007; printf("%lld\n",p); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...