#include<stdio.h>
#include<algorithm>
using namespace std;
int main(){
long long int n,a[100000],v=0;
scanf("%lld",&n);
int i,j,k;
for(i=0;i<n;i++) scanf("%lld",&a[i]);
sort(a,a+n);
for(i=0;i<n-2;i++){
for(j=i+1;j<n-1;j++){
if(i==j)continue;
for(k=j+1;k<n;k++){
if(a[i]!=a[j] && a[j]!=a[k] && a[i]!=a[k]){
v+=a[i]*a[j]*a[k];
}
}
}
}
printf("%lld",v%1000000007);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1588 KB |
Output is correct |
2 |
Correct |
0 ms |
1592 KB |
Output is correct |
3 |
Correct |
0 ms |
1592 KB |
Output is correct |
4 |
Correct |
0 ms |
1592 KB |
Output is correct |
5 |
Correct |
0 ms |
1596 KB |
Output is correct |
6 |
Correct |
0 ms |
1592 KB |
Output is correct |
7 |
Correct |
0 ms |
1588 KB |
Output is correct |
8 |
Correct |
0 ms |
1596 KB |
Output is correct |
9 |
Correct |
0 ms |
1592 KB |
Output is correct |
10 |
Correct |
0 ms |
1588 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
1596 KB |
Output is correct |
2 |
Correct |
0 ms |
1592 KB |
Output is correct |
3 |
Correct |
0 ms |
1592 KB |
Output is correct |
4 |
Correct |
0 ms |
1588 KB |
Output is correct |
5 |
Correct |
0 ms |
1588 KB |
Output is correct |
6 |
Correct |
0 ms |
1588 KB |
Output is correct |
7 |
Correct |
0 ms |
1592 KB |
Output is correct |
8 |
Correct |
0 ms |
1592 KB |
Output is correct |
9 |
Correct |
0 ms |
1592 KB |
Output is correct |
10 |
Correct |
0 ms |
1592 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
33 ms |
1588 KB |
Output is correct |
2 |
Correct |
12 ms |
1592 KB |
Output is correct |
3 |
Correct |
163 ms |
1588 KB |
Output is correct |
4 |
Correct |
109 ms |
1592 KB |
Output is correct |
5 |
Correct |
167 ms |
1588 KB |
Output is correct |
6 |
Correct |
106 ms |
1588 KB |
Output is correct |
7 |
Correct |
118 ms |
1588 KB |
Output is correct |
8 |
Correct |
0 ms |
1588 KB |
Output is correct |
9 |
Correct |
0 ms |
1592 KB |
Output is correct |
10 |
Correct |
157 ms |
1592 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
32 ms |
1592 KB |
Output is correct |
2 |
Correct |
8 ms |
1588 KB |
Output is correct |
3 |
Correct |
1 ms |
1588 KB |
Output is correct |
4 |
Correct |
21 ms |
1592 KB |
Output is correct |
5 |
Correct |
240 ms |
1592 KB |
Output is correct |
6 |
Correct |
68 ms |
1592 KB |
Output is correct |
7 |
Correct |
43 ms |
1592 KB |
Output is correct |
8 |
Correct |
4 ms |
1588 KB |
Output is correct |
9 |
Correct |
3 ms |
1592 KB |
Output is correct |
10 |
Correct |
2 ms |
1588 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 |
- |