Submission #8393

# Submission time Handle Problem Language Result Execution time Memory
8393 2014-09-13T16:34:17 Z ainta Uniting (kriii2_U) C++
0 / 4
0 ms 1088 KB
#include<stdio.h>
int n, S, a, R, i;
long long R2 = 1, Mod = 1000000007;
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("%d\n%lld\n", R, R2);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1088 KB Output is correct
2 Correct 0 ms 1088 KB Output is correct
3 Correct 0 ms 1088 KB Output is correct
4 Correct 0 ms 1088 KB Output is correct
5 Correct 0 ms 1088 KB Output is correct
6 Incorrect 0 ms 1088 KB Output isn't correct
7 Halted 0 ms 0 KB -