結果
| 問題 | 
                            No.1852 Divide or Reduce
                             | 
                    
| コンテスト | |
| ユーザー | 
                            👑  Kazun
                         | 
                    
| 提出日時 | 2022-02-25 22:31:25 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 714 bytes | 
| コンパイル時間 | 204 ms | 
| コンパイル使用メモリ | 82,432 KB | 
| 実行使用メモリ | 133,328 KB | 
| 最終ジャッジ日時 | 2024-07-03 17:26:41 | 
| 合計ジャッジ時間 | 5,443 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 3 WA * 17 | 
ソースコード
from functools import lru_cache
@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
"""
while True:
    B=tuple(map(int,input().split()))
    print(greedy(B))
"""
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()))
    X=0
    for a in A: X+=a-1
    if X%2==0:
        Ans[t]=1
write("\n".join(map(lambda x:"Second" if x else "First",Ans)))
            
            
            
        
            
Kazun