結果

問題 No.1852 Divide or Reduce
ユーザー boatmusclesboatmuscles
提出日時 2022-02-25 22:10:53
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 540 bytes
コンパイル時間 136 ms
コンパイル使用メモリ 32,160 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-16 17:10:02
合計ジャッジ時間 3,595 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 69 ms
4,380 KB
testcase_02 AC 68 ms
4,380 KB
testcase_03 AC 68 ms
4,376 KB
testcase_04 AC 68 ms
4,380 KB
testcase_05 AC 68 ms
4,376 KB
testcase_06 AC 65 ms
4,380 KB
testcase_07 AC 65 ms
4,376 KB
testcase_08 AC 65 ms
4,376 KB
testcase_09 AC 65 ms
4,376 KB
testcase_10 AC 64 ms
4,376 KB
testcase_11 AC 64 ms
4,380 KB
testcase_12 AC 64 ms
4,376 KB
testcase_13 AC 64 ms
4,376 KB
testcase_14 AC 64 ms
4,376 KB
testcase_15 AC 64 ms
4,376 KB
testcase_16 AC 89 ms
4,376 KB
testcase_17 AC 90 ms
4,380 KB
testcase_18 AC 89 ms
4,380 KB
testcase_19 AC 61 ms
4,376 KB
testcase_20 AC 92 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<cstdio>
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
int main(){
    int testcase_i;
    scanf("%d", &testcase_i);
    for (int ___ = 0; ___ < testcase_i; ___++){
        int N;
        scanf("%d", &N);
        bool odd = false;
        int mn = 1000000000;
        for(int i = 0; i < N; ++i){
            int A;
            scanf("%d", &A);
            chmin(mn, A);
            odd ^= (A-1)&1;
        }
        printf(odd || ((mn-1)&1 && !(N&1)) ? "First\n" : "Second\n");
    }
}
0