結果
問題 |
No.1816 MUL-DIV Game
|
ユーザー |
![]() |
提出日時 | 2022-01-21 21:21:59 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 358 bytes |
コンパイル時間 | 750 ms |
コンパイル使用メモリ | 74,380 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-25 22:30:09 |
合計ジャッジ時間 | 2,173 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 WA * 15 |
ソースコード
#include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { int N; cin >> N; vector<int> A(N); for (int i = 0; i < N; i++) { cin >> A[i]; } if (N % 2 == 1) { cout << (N == 1 ? A[0] : 1) << endl; } else { sort(A.begin(), A.end()); cout << (N == 2 ? 1LL * A[0] * A[1] : 1LL * A[N / 2]) << endl; } return 0; }