This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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("%d",&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("%d",v);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |