結果
問題 |
No.1852 Divide or Reduce
|
ユーザー |
👑 ![]() |
提出日時 | 2022-02-25 22:13:30 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 766 bytes |
コンパイル時間 | 384 ms |
コンパイル使用メモリ | 82,496 KB |
実行使用メモリ | 134,028 KB |
最終ジャッジ日時 | 2024-07-03 17:06:37 |
合計ジャッジ時間 | 5,316 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 3 WA * 17 |
ソースコード
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)))