結果
| 問題 | No.1816 MUL-DIV Game |
| コンテスト | |
| ユーザー |
nyuminyusupe
|
| 提出日時 | 2024-10-11 21:32:17 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 33 ms / 2,000 ms |
| + 527µs | |
| コード長 | 576 bytes |
| 記録 | |
| コンパイル時間 | 1,021 ms |
| コンパイル使用メモリ | 186,732 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-09-14 06:24:38 |
| 合計ジャッジ時間 | 3,548 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i< (n); i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int mod = 998244353;
const int inf = (1<<30);
const ll INF = (1ull<<62);
int main(){
int n; cin>>n;
vector<ll> a(n);
rep(i,n) cin>>a[i];
sort(a.begin(),a.end());
if(n >= 3 && n%2 == 1) cout<<1<<endl;
else if(n == 2){
cout<<a[0]*a[1]<<endl;
}else if(n == 1){
cout<<a[0]<<endl;
}else{
ll ans = a[0]*a[1];
rep(i,n-2) ans = min(ans,a[i+2]);
cout<<ans<<endl;
}
}
nyuminyusupe