Submission #8395

#TimeUsernameProblemLanguageResultExecution timeMemory
8395aintaUniting (kriii2_U)C++98
4 / 4
12 ms1088 KiB
#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 timeMemoryGrader output
Fetching results...