結果
| 問題 | No.1816 MUL-DIV Game | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2022-01-21 21:59:18 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 764 bytes | 
| コンパイル時間 | 3,009 ms | 
| コンパイル使用メモリ | 157,836 KB | 
| 最終ジャッジ日時 | 2025-01-27 13:46:00 | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 9 WA * 18 | 
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
#include <cstring>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < int(n);i++)
int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  if (n == 1){
    cout << a[0] << endl;
    return 0;
  }
  if (n%2 == 0){
    if (a[0] == 1){
      cout << a[1] << endl;
      return 0;
    }
    else if (n == 2){
      cout << a[0] * a[1] << endl;
      return 0;
    }
    else if (n > 2){
      cout << a[2] << endl;
      return 0; 
    }
  }
  else{
    cout << 1 << endl;
    return 0;
  }
  return 0;
}
            
            
            
        