# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
8395 | ainta | Uniting (kriii2_U) | C++98 | 12 ms | 1088 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.
#pragma warning(disable:4996)
#include<stdio.h>
int n, S, a, i;
long long R2 = 1, Mod = 1000000007, R;
int main()
{
scanf("%d", &n);
for (i = 1; i <= n; i++){
scanf("%d", &a);
R += S*a;
S += a;
R2 = R2 * i % Mod;
if (i != n)R2 = R2 * i % Mod;
}
printf("%lld\n%lld\n", R, R2);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |