結果

問題 No.1852 Divide or Reduce
ユーザー kai4096_donkai4096_don
提出日時 2022-02-25 22:01:01
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 475 ms / 2,000 ms
コード長 829 bytes
コンパイル時間 3,928 ms
コンパイル使用メモリ 229,520 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-03 16:51:04
合計ジャッジ時間 10,946 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
//const long nPrime = 1000000007;
//const long nPrime = 998244353;
typedef long long ll;
int main() {
    long t;
    cin >> t;
    while(t--){
        long n;
        cin >> n;
        long nSum = 0, nMin = 1e10;
        for(long i = 0; i < n; i++){
            long a;
            cin >> a;
            nSum += a;
            nMin = min(nMin,a);
        }
        if((n&1)==1){
            if((nSum&1)==0){
                cout << "First" << endl;
            } else {
                cout << "Second" << endl;
            }
        }else{
            if((nSum&1)==0 && (nMin&1)==1){
                cout << "Second" << endl;
            } else {
                cout << "First" << endl;
            }
        }
    }
    return 0;
}
0