Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <functional>

using namespace std; 

typedef unsigned long long ull;

bool tri(ull a, ull b, ull c, ull d, ull e, ull f){

	ull p[6]={a,b,c,d,e,f};

	if( (p[0]< (p[1]+p[2]))&& (p[3]< (p[4]+p[5])) ){return true};
	if( (p[0]< (p[1]+p[3]))&& (p[2]< (p[4]+p[5])) ){return true};
	if( (p[0]< (p[1]+p[4]))&& (p[2]< (p[3]+p[5])) ){return true};
	if( (p[0]< (p[1]+p[5]))&& (p[2]< (p[3]+p[4])) ){return true};
	if( (p[0]< (p[2]+p[3]))&& (p[1]< (p[4]+p[5])) ){return true};
	if( (p[0]< (p[2]+p[4]))&& (p[1]< (p[3]+p[5])) ){return true};
	if( (p[0]< (p[2]+p[5]))&& (p[1]< (p[3]+p[4])) ){return true};
	if( (p[0]< (p[3]+p[4]))&& (p[1]< (p[2]+p[5])) ){return true};
	if( (p[0]< (p[3]+p[5]))&& (p[1]< (p[2]+p[4])) ){return true};
	if( (p[0]< (p[4]+p[5]))&& (p[1]< (p[2]+p[3])) ){return true};
	
	return false;
}

int main()
{
	int N;

	cin >> N;
	ull* bar = new ull[N];

	bool count = false;
	ull ans=0;

	for(int i=0; i<N; i++){ cin >> bar[i];}

	sort(bar, bar+N, greater<ull>());

	for(int i=0; i<N-5; i++){
		for(int j=i+3; j<N-2; j++){
			if( tri(bar[i],bar[i+1],bar[i+2],bar[j],bar[j+1],bar[j+2]) ){
				cout << i << ":" << j-i << ":" << j <<endl;
				ans = ans + bar[i]+bar[i+1]+bar[i+2]+ bar[j]+bar[j+1]+bar[j+2];
				cout << ans << endl;
				delete[] bar;
				return 0;
			}
		}
	}

	delete[] bar;	
	cout << "0" << endl;

	return 0;
}

Compiler output:
a.cc: In function 'bool tri(ull, ull, ull, ull, ull, ull)':
a.cc:15:68: error: expected ';' before '}' token
   15 |         if( (p[0]< (p[1]+p[2]))&& (p[3]< (p[4]+p[5])) ){return true};
      |                                                                    ^
      |                                                                    ;
a.cc:16:68: error: expected ';' before '}' token
   16 |         if( (p[0]< (p[1]+p[3]))&& (p[2]< (p[4]+p[5])) ){return true};
      |                                                                    ^
      |                                                                    ;
a.cc:17:68: error: expected ';' before '}' token
   17 |         if( (p[0]< (p[1]+p[4]))&& (p[2]< (p[3]+p[5])) ){return true};
      |                                                                    ^
      |                                                                    ;
a.cc:18:68: error: expected ';' before '}' token
   18 |         if( (p[0]< (p[1]+p[5]))&& (p[2]< (p[3]+p[4])) ){return true};
      |                                                                    ^
      |                                                                    ;
a.cc:19:68: error: expected ';' before '}' token
   19 |         if( (p[0]< (p[2]+p[3]))&& (p[1]< (p[4]+p[5])) ){return true};
      |                                                                    ^
      |                                                                    ;
a.cc:20:68: error: expected ';' before '}' token
   20 |         if( (p[0]< (p[2]+p[4]))&& (p[1]< (p[3]+p[5])) ){return true};
      |                                                                    ^
      |                                                                    ;
a.cc:21:68: error: expected ';' before '}' token
   21 |         if( (p[0]< (p[2]+p[5]))&& (p[1]< (p[3]+p[4])) ){return true};
      |                                                                    ^
      |                                                                    ;
a.cc:22:68: error: expected ';' before '}' token
   22 |         if( (p[0]< (p[3]+p[4]))&& (p[1]< (p[2]+p[5])) ){return true};
      |                                                                    ^
      |                                                                    ;
a.cc:23:68: error: expected ';' before '}' token
   23 |         if( (p[0]< (p[3]+p[5]))&& (p[1]< (p[2]+p[4])) ){return true};
      |                                                                    ^
      |                                                                    ;
a.cc:24:68: error: expected ';' before '}' token
   24 |         if( (p[0]< (p[4]+p[5]))&& (p[1]< (p[2]+p[3])) ){return true};
      |                                                                    ^
      |                                                                    ;