結果
問題 | No.761 平均値ゲーム |
ユーザー |
|
提出日時 | 2022-01-09 19:11:56 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 193 ms / 2,000 ms |
コード長 | 547 bytes |
コンパイル時間 | 146 ms |
コンパイル使用メモリ | 81,708 KB |
実行使用メモリ | 97,784 KB |
最終ジャッジ日時 | 2024-11-14 10:28:54 |
合計ジャッジ時間 | 14,895 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 100 |
ソースコード
import syssys.setrecursionlimit(10 ** 8)N = int(input())A = list(map(int,input().split()))Sum = sum(A)def calc(l = A,s = Sum):m = s / len(l)if l[0] >= m:return Truestart = 0end = len(l)-1while end - start > 1:mid = (end + start) // 2if l[mid] < m:start = midelse:end = mids0 = sum(l[:end])s1 = s - s0f0 = calc(l[:end],s0)f1 = calc(l[end:],s1)if f0 and f1:return Falseelse:return Trueprint('First' if calc() else 'Second')