結果
問題 | No.761 平均値ゲーム |
ユーザー |
![]() |
提出日時 | 2020-12-16 13:52:30 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 852 bytes |
コンパイル時間 | 306 ms |
コンパイル使用メモリ | 82,816 KB |
実行使用メモリ | 103,168 KB |
最終ジャッジ日時 | 2024-09-20 05:02:28 |
合計ジャッジ時間 | 15,216 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 93 WA * 7 |
ソースコード
import sys sys.setrecursionlimit(10**7) def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int,sys.stdin.readline().rstrip().split()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI2(): return list(map(int,sys.stdin.readline().rstrip())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) def LS2(): return list(sys.stdin.readline().rstrip()) N = I() A = LI() def f(X): if len(X) == 0: return 0 if len(X) == 1: return 1 ave = (sum(X)+len(X)-1)/len(X) X0 = [x for x in X if x >= ave] X1 = [x for x in X if x < ave] if len(X0) == 0 or len(X1) == 0: return 1 else: if f(X0) == f(X1) == 1: return 0 else: return 1 print('First' if f(A) else 'Second')