結果

問題 No.1816 MUL-DIV Game
ユーザー nok0
提出日時 2021-12-20 00:51:01
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 346 bytes
コンパイル時間 1,937 ms
コンパイル使用メモリ 198,504 KB
最終ジャッジ日時 2025-01-27 04:05:08
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
	int n;
	cin >> n;
	vector<int> a(n);
	for(auto &v : a) cin >> v;
	sort(a.begin(), a.end());
	if(n == 1) {
		cout << a[0] << endl;
	} else if(n == 2) {
		cout << (long long)a[0] * a[1] << endl;
	} else if(n % 2) {
		cout << 1 << endl;
	} else
		cout << (long long)a[0] * a[1] << endl;
}
0