結果
問題 | No.1816 MUL-DIV Game |
ユーザー |
![]() |
提出日時 | 2022-01-21 23:13:38 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 47 ms / 2,000 ms |
コード長 | 519 bytes |
コンパイル時間 | 2,046 ms |
コンパイル使用メモリ | 197,580 KB |
最終ジャッジ日時 | 2025-01-27 14:28:21 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
#include <bits/stdc++.h> int main(){ using namespace std; unsigned long N; cin >> N; if(N & 1){ if(N == 1){ unsigned long A; cin >> A; cout << A << endl; }else puts("1"); return 0; } vector<unsigned long> A(N); for(auto&& i : A)cin >> i; nth_element(begin(A), end(A) - 2, end(A), greater<>{}); const auto a{A.back()}; A.pop_back(); A.back() *= a; cout << *min_element(begin(A), end(A)) << endl; return 0; }