Submission #9293

#TimeUsernameProblemLanguageResultExecution timeMemory
9293cki86201Uniting (kriii2_U)C++98
4 / 4
12 ms1088 KiB
#include<stdio.h> #define ll long long const int MOD = 1e9 + 7; int main() { int n; ll a = 0, b = 1, c = 1; scanf("%d%lld",&n,&b);--n; while(n--){ int x; scanf("%d",&x); a += b*x; b += x; c *= (n+2); c %= MOD; c *= (n+1); c %= MOD; } printf("%lld\n%lld",a,c); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...