結果
| 問題 |
No.1792 科学の甲子園
|
| コンテスト | |
| ユーザー |
Nachia
|
| 提出日時 | 2021-12-21 00:04:35 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 979 bytes |
| コンパイル時間 | 1,890 ms |
| コンパイル使用メモリ | 102,224 KB |
| 最終ジャッジ日時 | 2025-01-27 04:15:59 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 WA * 11 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
#define rep(i,n) for(int i=0; i<(n); i++)
int N;
i64 A[10000][6];
int maxi[64] = {};
int main() {
cin >> N;
rep(i,N) rep(j,6) cin >> A[i][j];
rep(b,64){
i64 maxscore = 0;
rep(i,N){
i64 score = 1;
rep(t,6) if((b >> t) & 1) score *= A[i][t];
if(score > maxscore){ maxi[b] = i; maxscore = score; }
}
}
i64 ans = 0;
rep(i,64) rep(j,i) rep(k,j) rep(l,k){
i64 maxA[6] = {};
rep(t,6) maxA[t] = max({ A[i][t], A[j][t], A[k][t], A[l][t] });
i64 tmp = 1;
rep(t,6) tmp *= maxA[t];
ans = max(ans, tmp);
}
cout << ans << endl;
return 0;
}
struct ios_do_not_sync{
ios_do_not_sync(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
}
} ios_do_not_sync_instance;
Nachia