結果

問題 No.1816 MUL-DIV Game
ユーザー nyuminyusupe
提出日時 2024-10-11 21:20:22
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 548 bytes
コンパイル時間 2,042 ms
コンパイル使用メモリ 167,704 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-11 21:20:27
合計ジャッジ時間 4,283 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i< (n); i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int mod = 998244353;
const int inf = (1<<30);
const ll INF = (1ull<<62);

int main(){
    int n; cin>>n;
    vector<int> a(n);
    rep(i,n) cin>>a[i];
    if(n >= 3 && n%2 == 1) cout<<1<<endl;
    else if(n == 2){
        cout<<a[0]*a[1]<<endl;
    }else if(n == 1){
        cout<<a[0]<<endl;
    }else{
        int ans = a[0]*a[1];
        rep(i,n-2) ans = min(ans,a[i+2]);
        cout<<ans<<endl;
    }
}
0