Submission #2156

# Submission time Handle Problem Language Result Execution time Memory
2156 2013-07-20T06:02:57 Z jwvg0425 지우개 (GA4_eraser) C++
0 / 100
10 ms 2448 KB
#include<stdio.h>
#include<stdlib.h>

#define MOD 1000000007
int n;
long long int a[100000];
long long int v,s[100000];
int compare(const void* a,const void* b)
{
	return *((int*)a)>*((int*)b)?1:0;
}

int main()
{
	int i,j,k;
	scanf("%d",&n);
	for(i=0;i<n;i++)scanf("%lld",&a[i]);
	qsort(a,n,sizeof(long long int),compare);
	s[0]=a[0];
	for(i=1;i<n;i++)s[i]=s[i-1]+a[i];
	for(i=0;i<n-2;i++)
	{
		for(j=i+1;j<n-1;j++)
		{
			for(k=j+1;k<n;k++)
			{
				v+=a[i]*a[j]*a[k];
			}
		}
	}
	printf("%lld",v);
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 2448 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 2448 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 2448 KB close (syscall #3) was called by the program (disallowed syscall)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 2448 KB close (syscall #3) was called by the program (disallowed syscall)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 7 ms 2448 KB close (syscall #3) was called by the program (disallowed syscall)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 10 ms 2448 KB close (syscall #3) was called by the program (disallowed syscall)
2 Halted 0 ms 0 KB -