#include <iostream>
#include <algorithm>
using namespace std;
int pre(const int a, const int b){return a > b;}
int main()
{
int num, i, j, k;
long sum = 0;
cin >> num;
int *p = new int[num];
for(i = 0; i < num; i++)
cin >> p[i];
sort(p, p+num, pre);
for(i = 0; i < num-2; i++)
{
for(j = i+1; j < num-1; j++)
{
if(p[i] > p[j])
{
for(k = j+1; k < num; k++)
{
if(p[j] > p[k])
{
sum += p[i] * p[j] * p[k];
if(sum > 1000000007)
sum %= 1000000007;
}
}
}
}
}
cout << sum;
return 0;
Compilation message
sequence.cpp: In function 'int main()':
sequence.cpp:37: error: expected `}' at end of input