結果

問題 No.1852 Divide or Reduce
ユーザー titiatitia
提出日時 2022-02-27 00:25:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 600 ms / 2,000 ms
コード長 579 bytes
コンパイル時間 547 ms
コンパイル使用メモリ 10,980 KB
実行使用メモリ 38,744 KB
最終ジャッジ日時 2023-09-18 05:22:17
合計ジャッジ時間 8,362 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,764 KB
testcase_01 AC 184 ms
7,820 KB
testcase_02 AC 183 ms
7,876 KB
testcase_03 AC 180 ms
7,920 KB
testcase_04 AC 180 ms
8,344 KB
testcase_05 AC 179 ms
7,864 KB
testcase_06 AC 152 ms
24,996 KB
testcase_07 AC 162 ms
35,660 KB
testcase_08 AC 157 ms
33,256 KB
testcase_09 AC 152 ms
25,560 KB
testcase_10 AC 164 ms
32,976 KB
testcase_11 AC 162 ms
38,716 KB
testcase_12 AC 161 ms
38,408 KB
testcase_13 AC 159 ms
38,668 KB
testcase_14 AC 159 ms
38,408 KB
testcase_15 AC 161 ms
38,744 KB
testcase_16 AC 600 ms
30,288 KB
testcase_17 AC 597 ms
30,272 KB
testcase_18 AC 592 ms
30,416 KB
testcase_19 AC 539 ms
11,540 KB
testcase_20 AC 593 ms
30,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 概ね正しいことを考えていたのにまとめきれなかった

import sys
input = sys.stdin.readline

T=int(input())
for tests in range(T):
    N=int(input())
    A=list(map(int,input().split()))

    S=sum(A)
    MIN=min(A)

    if MIN==1:
        if (S-N)%2==1:
            print("First")
        else:
            print("Second")
        continue


    if (S-N)%2==1:
        print("First")
        continue

    if N%2==1:
        print("Second")
    else:
        if MIN%2==0:
            print("First")
        else:
            print("Second")
        

    
0