# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
16519 | hongjun7 | Uniting (kriii2_U) | C++98 | 11 ms | 1084 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |