結果

問題 No.1816 MUL-DIV Game
ユーザー ぷら
提出日時 2022-01-21 21:24:05
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 458 bytes
コンパイル時間 2,116 ms
コンパイル使用メモリ 201,108 KB
最終ジャッジ日時 2025-01-27 13:21:19
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    int N;
    cin >> N;
    vector<long long>A(N);
    for(int i = 0; i < N; i++) {
        cin >> A[i];
    }
    sort(A.rbegin(),A.rend());
    if(N == 1) {
        cout << A[0] << endl;
    }
    else if(N == 2) {
        cout << A[0]*A[1] << endl;
    }
    else if(N%2 == 1) {
        cout << 1 << endl;
    }
    else {
        cout << A[N/2-1] << endl;
    }
}

/*
 1 2 3 4
 2 3 4
 2 1
 */
0