제출 #688239

#제출 시각아이디문제언어결과실행 시간메모리
688239dkblossomTeam Contest (JOI22_team)C++14
8 / 100
1291 ms468 KiB
#include<bits/stdc++.h>
using namespace std;

#pragma gcc optimize('ofast','unroll-loops')

#define endl '\n'
#define ff first
#define ss second
#define pb emplace_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define rep(a,b,c) for(int a=b;a<c;a++)

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;

const ll maxn = 1005;
const ll maxm = 200005;
const ll mod = 1000000007;

void solve(){
	int n;
	int a[maxn];
	int b[maxn];
	int c[maxn];
	int ans = -1;

	cin >> n;
	rep(i,0,n) cin >> a[i] >> b[i] >> c[i];

	rep(i,0,n) rep(j,i+1,n) rep(k,j+1,n){
		vector<pii> A, B, C;
		A.pb(a[i],i), A.pb(a[j],j), A.pb(a[k],k);
		B.pb(b[i],i), B.pb(b[j],j), B.pb(b[k],k);
		C.pb(c[i],i), C.pb(c[j],j), C.pb(c[k],k);
		sort(all(A)), sort(all(B)), sort(all(C));
		if(A[2].ff==A[1].ff || B[2].ff==B[1].ff || C[2].ff==C[1].ff || A[2].ss==B[2].ss || A[2].ss==C[2].ss || B[2].ss==C[2].ss) continue;
		ans = max(ans,A[2].ff+B[2].ff+C[2].ff);
	}

	cout << ans << endl;
}

int main(){
	//freopen("input.txt","r",stdin);
	//freopen("sol.txt","w",stdout);
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int t = 1;
	//cin >> t;
	while(t--) solve();
}

컴파일 시 표준 에러 (stderr) 메시지

team.cpp:4: warning: ignoring '#pragma gcc optimize' [-Wunknown-pragmas]
    4 | #pragma gcc optimize('ofast','unroll-loops')
      |
#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...