Submission #551943

#TimeUsernameProblemLanguageResultExecution timeMemory
551943QwertyPiTeam Contest (JOI22_team)C++14
8 / 100
2085 ms4280 KiB
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define int long long
using namespace std;

const int N = 1.5e5 + 5;
int n, L;

struct tp{
	int a, b, c;
	bool operator< (const tp& o) const{
		return a < o.a || a == o.a && b < o.b || a == o.a && b == o.b && c < o.c;
	}
};

tp A[N];
int mx[3][N];
vector<tp> teams;

int ans = -1;

void check(int i, int j, int k){
	if(A[i].a > A[j].a && A[i].a > A[k].a && A[j].b > A[i].b && A[j].b > A[k].b && A[k].c > A[i].c && A[k].c > A[j].c)
		ans = max(ans, A[i].a + A[j].b + A[k].c);
}

int32_t main(){
	ios_base::sync_with_stdio(false);
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		int a, b, c;
		cin >> a >> b >> c;
		A[i] = {a, b, c}; 
	}
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			for(int k = 0; k < n; k++){
				check(i, j, k);
			}
		}
	}
	cout << ans << endl;
}

Compilation message (stderr)

team.cpp: In member function 'bool tp::operator<(const tp&) const':
team.cpp:15:30: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   15 |   return a < o.a || a == o.a && b < o.b || a == o.a && b == o.b && c < o.c;
      |                     ~~~~~~~~~^~~~~~~~~~
team.cpp:15:65: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   15 |   return a < o.a || a == o.a && b < o.b || a == o.a && b == o.b && c < o.c;
      |                                            ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...