Submission #3104

#TimeUsernameProblemLanguageResultExecution timeMemory
3104aintaInherited disease (kriii1_I)C++98
1 / 1
0 ms1088 KiB
#include<stdio.h> long long Mod=1000000007,n,k,i,a,S=1,F=1; int main() { scanf("%lld",&n); for(i=1;i<=n;i++){ scanf("%lld",&k); k--; a=a*i+k; a%=Mod; printf("%lld\n",(a+S)%Mod); F*=i; S+=F; F%=Mod; S%=Mod; } }
#Verdict Execution timeMemoryGrader output
Fetching results...