Submission #3103

#TimeUsernameProblemLanguageResultExecution timeMemory
3103aintaInherited disease (kriii1_I)C++98
0 / 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); F*=i; S+=F; F%=Mod; S%=Mod; } }
#Verdict Execution timeMemoryGrader output
Fetching results...