結果
問題 |
No.1816 MUL-DIV Game
|
ユーザー |
![]() |
提出日時 | 2022-02-13 20:54:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 50 ms / 2,000 ms |
コード長 | 355 bytes |
コンパイル時間 | 1,567 ms |
コンパイル使用メモリ | 169,100 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-29 05:47:02 |
合計ジャッジ時間 | 3,180 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; long long A[N]; for(int i=0;i<N;++i){ cin>>A[i]; } sort(A,A+N); 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[2],A[0]*A[1])<<endl; } }