結果

問題 No.1852 Divide or Reduce
ユーザー 👑 KazunKazun
提出日時 2022-02-25 22:13:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 766 bytes
コンパイル時間 469 ms
コンパイル使用メモリ 86,652 KB
実行使用メモリ 136,592 KB
最終ジャッジ日時 2023-09-16 17:13:00
合計ジャッジ時間 6,656 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
72,260 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 183 ms
121,064 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 194 ms
129,696 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 226 ms
106,168 KB
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import lru_cache
from os import sep

@lru_cache(maxsize=None)
def greedy(A):
    if not A:
        return False

    flag=False
    for i in range(len(A)):
        B=A[:i]+A[i+1:]
        for p in range(1,A[i]):
            flag|=not greedy(tuple(sorted(B+(p,A[i]-p))))

    if min(A)>=2:
        flag|=not(tuple([a-1 for a in A]))

    return flag

"""
for a in range(1,10):
    for b in range(1,10):
        print(*[1 if greedy((a,b,c)) else 0 for c in range(1,10)])
    print()
"""

import sys
input=sys.stdin.readline
write=sys.stdout.write

T=int(input())
Ans=[0]*T
for t in range(T):
    N=int(input())
    A=list(map(int,input().split()))
    if (N+sum(A))%2==0:
        Ans[t]=1

write("\n".join(map(lambda x:"Second" if x else "First",Ans)))
0