Submission #18558

#TimeUsernameProblemLanguageResultExecution timeMemory
18558eaststarUniting (kriii2_U)C++14
1 / 4
10 ms1084 KiB
#include <stdio.h> #define M 1000000007 int main(){ int i,n,k; long long ans=0,cnt=1,s=0; scanf("%d",&n); for(i=1;i<=n;++i){ scanf("%d",&k); ans+=s*k; s+=k; cnt=cnt*i%M; } printf("%lld\n%lld",ans,cnt); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...