답안 #9610

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
9610 2014-09-28T07:37:06 Z pichulia Uniting (kriii2_U) C++
0 / 4
0 ms 2648 KB
#include<stdio.h>
#define M 1000000007LL
int n;
long long int a[100009];
long long int f[100009];
long long int s,t,u;
int main()
{
	scanf("%d",&n);
	int i,j, k;
	f[0] = 1;
	for(i=0;i<n;i++)
	{
		scanf("%lld",&a[i]);
		s = (s+a[i])%M;
		t = (t+a[i]*a[i])%M;
		f[i+1] = (f[i] * (i+1))%M;
	}
	u = (s*s-t)%M;
	u = (u * (M/2+1))%M;
	printf("%lld\n%lld\n",u,f[n]);
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 0 ms 2648 KB Output is partially correct
2 Partially correct 0 ms 2648 KB Output is partially correct
3 Partially correct 0 ms 2648 KB Output is partially correct
4 Partially correct 0 ms 2648 KB Output is partially correct
5 Incorrect 0 ms 2648 KB Output isn't correct
6 Halted 0 ms 0 KB -