結果

問題 No.761 平均値ゲーム
コンテスト
ユーザー ああいい
提出日時 2022-01-09 19:11:56
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 547 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 755 ms
コンパイル使用メモリ 84,864 KB
実行使用メモリ 102,528 KB
最終ジャッジ日時 2026-05-09 22:49:52
合計ジャッジ時間 12,524 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 100
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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