結果

問題 No.1852 Divide or Reduce
ユーザー ああいいああいい
提出日時 2022-02-25 22:00:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 768 ms / 2,000 ms
コード長 656 bytes
コンパイル時間 586 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 135,580 KB
最終ジャッジ日時 2023-09-16 16:54:41
合計ジャッジ時間 9,631 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,168 KB
testcase_01 AC 275 ms
79,496 KB
testcase_02 AC 259 ms
78,404 KB
testcase_03 AC 256 ms
78,372 KB
testcase_04 AC 260 ms
78,320 KB
testcase_05 AC 250 ms
78,368 KB
testcase_06 AC 169 ms
125,340 KB
testcase_07 AC 172 ms
126,384 KB
testcase_08 AC 178 ms
130,844 KB
testcase_09 AC 176 ms
122,520 KB
testcase_10 AC 174 ms
128,040 KB
testcase_11 AC 181 ms
135,472 KB
testcase_12 AC 184 ms
134,616 KB
testcase_13 AC 184 ms
135,580 KB
testcase_14 AC 182 ms
135,096 KB
testcase_15 AC 179 ms
134,768 KB
testcase_16 AC 761 ms
103,068 KB
testcase_17 AC 768 ms
101,500 KB
testcase_18 AC 744 ms
101,452 KB
testcase_19 AC 641 ms
104,904 KB
testcase_20 AC 711 ms
101,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
S = "Second"
F = "First"
for _ in range(T):
    N = int(input())
    A = list(map(int,input().split()))
    flag = False
    _sum = 0
    _min = min(A)
    for a in A:
        if a == 1:
            flag = True
        _sum += a - 1
    if _sum == 0:
        print(S)
        continue
    if flag:
        if _sum % 2 == 0:
            print(S)
        else:
            print(F)
    else:
        if _sum % 2 == 1:
            print(F)
        else:
            if N % 2 == 1:
                print(S)
            else:
                if (_min-1) % 2 == 1:
                    print(F)
                else:
                    print(S)
0