답안 #696115

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
696115 2023-02-05T14:11:01 Z penguin133 Team Contest (JOI22_team) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

#define int long long
#define pi pair<int, int>
#define pii pair<int, pi>
#define fi first
#define se second
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

int n, A[150005], B[150005], C[150005];
vector <pii> lmao;
void solve(){
	cin >> n;
	for(int i=1;i<=n;i++)cin >> A[i] >> B[i] >> C[i], lmao.push_back({A[i], {B[i], C[i]}});
	sort(lmao.begin(), lmao.end());
	int ans = -1;
	for(int i=1;i<=n;i++)A[i] = lmao[i-1].fi, B[i] = lmao[i-1].se.fi, C[i] = lmao[i-1].se.se,;// cout << A[i] << ' ' <<B[i] << ' ' << C[i] << '\n';
	for(int i=1;i<=n;i++){
		
		for(int j=i+1;j<=n;j++){
			for(int k=j+1;k<=n;k++){
				if(A[k] <= A[i] || A[k] <= A[j])continue;
				bool f = 1, f2 = 1;
				//cout << i << ' ' << j << ' ' << k << '\n';
				if(B[j] <= B[i] || B[j] <= B[k] || C[i] <= C[k] || C[i] <= C[j])f = 0;
				if(B[i] <= B[j] || B[i] <= B[k] || C[j] <= C[k] || C[j] <= C[i])f2 = 0;
				if(f)ans = max(ans, A[k] + B[j] + C[i]);
				if(f2)ans = max(ans, A[k] + B[i] + C[j]);
			}
		}
	}
	cout << ans;
}

main(){
	ios::sync_with_stdio(0);cin.tie(0);
	int tc = 1;
	//cin >> tc;
	for(int tc1=1;tc1<=tc;tc1++){
		// cout << "Case #" << tc1 << ": ";
		solve();
	}
}

Compilation message

team.cpp: In function 'void solve()':
team.cpp:21:91: error: expected primary-expression before ';' token
   21 |  for(int i=1;i<=n;i++)A[i] = lmao[i-1].fi, B[i] = lmao[i-1].se.fi, C[i] = lmao[i-1].se.se,;// cout << A[i] << ' ' <<B[i] << ' ' << C[i] << '\n';
      |                                                                                           ^
team.cpp: At global scope:
team.cpp:39:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   39 | main(){
      | ^~~~