結果

問題 No.1852 Divide or Reduce
ユーザー kai4096_donkai4096_don
提出日時 2022-02-25 22:01:01
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 475 ms / 2,000 ms
コード長 829 bytes
コンパイル時間 6,609 ms
コンパイル使用メモリ 226,800 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-16 16:55:18
合計ジャッジ時間 11,312 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 198 ms
4,376 KB
testcase_02 AC 200 ms
4,380 KB
testcase_03 AC 203 ms
4,376 KB
testcase_04 AC 200 ms
4,380 KB
testcase_05 AC 202 ms
4,380 KB
testcase_06 AC 166 ms
4,380 KB
testcase_07 AC 179 ms
4,384 KB
testcase_08 AC 170 ms
4,380 KB
testcase_09 AC 168 ms
4,376 KB
testcase_10 AC 170 ms
4,376 KB
testcase_11 AC 169 ms
4,380 KB
testcase_12 AC 171 ms
4,376 KB
testcase_13 AC 176 ms
4,380 KB
testcase_14 AC 172 ms
4,384 KB
testcase_15 AC 176 ms
4,376 KB
testcase_16 AC 464 ms
4,380 KB
testcase_17 AC 475 ms
4,376 KB
testcase_18 AC 460 ms
4,380 KB
testcase_19 AC 350 ms
4,380 KB
testcase_20 AC 471 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

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