結果
問題 | No.1816 MUL-DIV Game |
ユーザー |
![]() |
提出日時 | 2022-01-21 23:15:09 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 49 ms / 2,000 ms |
コード長 | 499 bytes |
コンパイル時間 | 3,777 ms |
コンパイル使用メモリ | 230,708 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-26 02:46:56 |
合計ジャッジ時間 | 5,432 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
#include<bits/stdc++.h> #include<atcoder/all> #define fi first #define se second #define eb emplace_back using namespace std; using namespace atcoder; using ll = long long; int main() { int N; cin >> N; vector<ll> A(N); for (int i = 0; i < N; ++i) cin >> A[i]; sort(A.begin(), A.end()); if (N == 1) cout << A[0] << endl; else if (N == 2) cout << A[0] * A[1] << endl; else if (N % 2) cout << 1 << endl; else cout << min(A[0] * A[1], A[2]) << endl; return 0; }