結果

問題 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
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.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 True
    start = 0
    end = len(l)-1
    while end - start > 1:
        mid = (end + start) // 2
        if l[mid] < m:
            start = mid
        else:
            end = mid
    s0 = sum(l[:end])
    s1 = s - s0
    f0 = calc(l[:end],s0)
    f1 = calc(l[end:],s1)
    if f0 and f1:return False
    else:return True
print('First' if calc() else 'Second')
0