結果

問題 No.1852 Divide or Reduce
ユーザー 👑 rin204rin204
提出日時 2022-02-25 22:05:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 851 ms / 2,000 ms
コード長 434 bytes
コンパイル時間 591 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 136,576 KB
最終ジャッジ日時 2023-09-16 17:02:39
合計ジャッジ時間 10,250 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,416 KB
testcase_01 AC 289 ms
79,208 KB
testcase_02 AC 289 ms
80,268 KB
testcase_03 AC 285 ms
79,540 KB
testcase_04 AC 285 ms
79,064 KB
testcase_05 AC 285 ms
79,020 KB
testcase_06 AC 175 ms
123,028 KB
testcase_07 AC 186 ms
113,216 KB
testcase_08 AC 184 ms
127,576 KB
testcase_09 AC 173 ms
113,688 KB
testcase_10 AC 192 ms
136,576 KB
testcase_11 AC 182 ms
135,480 KB
testcase_12 AC 191 ms
132,004 KB
testcase_13 AC 190 ms
134,396 KB
testcase_14 AC 186 ms
134,304 KB
testcase_15 AC 187 ms
134,348 KB
testcase_16 AC 823 ms
101,308 KB
testcase_17 AC 843 ms
101,380 KB
testcase_18 AC 833 ms
101,448 KB
testcase_19 AC 851 ms
106,132 KB
testcase_20 AC 829 ms
102,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    n = int(input())
    A = list(map(int, input().split()))
    if (sum(A) - n) % 2 == 1:
        print("First")
        return
    B = [a - 1 for a in A]
    if (sum(A) - n) % 2 == 1:
        print("Second")
        return
    mi = min(A)
    cnt = mi - 1
    cnt += sum(a - mi for a in A)
    if cnt % 2 == 1:
        print("First")
    else:
        print("Second")
    
    
for _ in range(int(input())):
    solve()
0