답안 #2165

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
2165 2013-07-20T06:16:18 Z jwvg0425 지우개 (GA4_eraser) C++
46 / 100
1000 ms 2840 KB
#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<vector>
using namespace std;

#define MOD 1000000007
int n,r[100005];
long long int a[100005];
long long int v,s[100005];

int main()
{
	int i,j,k;
	scanf("%d",&n);
	for(i=0;i<n;i++)scanf("%lld",&a[i]);
	sort(&a[0],&a[n]);
	s[0]=a[0];
	for(i=1;i<n;i++)s[i]=s[i-1]+a[i];
	for(i=0;i<n;i++)
	{
		for(j=i+1;;j++)
		{
			if(a[j]!=a[i])
			{
				r[i]=j;
				break;
			}
		}
	}
	for(i=0;i<n;i++)
	{
		for(j=r[i];j<n-1;j++)
		{
			k=r[j];
			if(k<n)
			{
				v=(v+(s[n-1]-s[k-1])*(long long int)a[i]*(long long int)a[j])%MOD;
			}
		}
	}
	printf("%lld",v);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2840 KB Output is correct
2 Correct 0 ms 2840 KB Output is correct
3 Correct 0 ms 2840 KB Output is correct
4 Correct 0 ms 2840 KB Output is correct
5 Correct 0 ms 2840 KB Output is correct
6 Correct 0 ms 2840 KB Output is correct
7 Correct 0 ms 2840 KB Output is correct
8 Correct 0 ms 2840 KB Output is correct
9 Correct 0 ms 2840 KB Output is correct
10 Correct 0 ms 2840 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2840 KB Output is correct
2 Correct 0 ms 2840 KB Output is correct
3 Correct 0 ms 2840 KB Output is correct
4 Correct 0 ms 2840 KB Output is correct
5 Correct 0 ms 2840 KB Output is correct
6 Correct 0 ms 2840 KB Output is correct
7 Correct 0 ms 2840 KB Output is correct
8 Correct 0 ms 2840 KB Output is correct
9 Correct 0 ms 2840 KB Output is correct
10 Correct 0 ms 2840 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2840 KB Output is correct
2 Correct 0 ms 2840 KB Output is correct
3 Correct 1 ms 2840 KB Output is correct
4 Correct 0 ms 2840 KB Output is correct
5 Correct 1 ms 2840 KB Output is correct
6 Correct 1 ms 2840 KB Output is correct
7 Correct 0 ms 2840 KB Output is correct
8 Correct 0 ms 2840 KB Output is correct
9 Correct 0 ms 2840 KB Output is correct
10 Correct 1 ms 2840 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 2840 KB Output is correct
2 Correct 0 ms 2840 KB Output is correct
3 Correct 0 ms 2840 KB Output is correct
4 Correct 0 ms 2840 KB Output is correct
5 Correct 1 ms 2840 KB Output is correct
6 Correct 0 ms 2840 KB Output is correct
7 Correct 0 ms 2840 KB Output is correct
8 Correct 0 ms 2840 KB Output is correct
9 Correct 0 ms 2840 KB Output is correct
10 Correct 0 ms 2840 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1000 ms 0 KB Program timed out
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1000 ms 0 KB Program timed out
2 Halted 0 ms 0 KB -