Submission #16519

#TimeUsernameProblemLanguageResultExecution timeMemory
16519hongjun7Uniting (kriii2_U)C++98
4 / 4
11 ms1084 KiB
#include<stdio.h> int n, S, x; long long A, B; int main() { scanf("%d", &n); B = 1; for (int i = 1; i <= n; i++){ scanf("%d", &x); A += S*x; S += x; B = B * i % 1000000007; if (i < n) B = B * i % 1000000007; } printf("%lld\n%lld", A, B); }
#Verdict Execution timeMemoryGrader output
Fetching results...