結果

問題 No.761 平均値ゲーム
コンテスト
ユーザー titia
提出日時 2026-08-03 02:16:01
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 104 ms / 2,000 ms
+ 522µs
コード長 508 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 220 ms
コンパイル使用メモリ 96,368 KB
実行使用メモリ 105,856 KB
最終ジャッジ日時 2026-08-03 02:16:14
合計ジャッジ時間 12,010 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 100
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input = sys.stdin.readline

from bisect import bisect,bisect_left

N=int(input())
A=list(map(int,input().split()))

S=[0]
for a in A:
    S.append(S[-1]+a)

def calc(l,r,te):
    if r-l+1==1:
        return te
    
    SUM=S[r+1]-S[l]
    ko=r-l+1
    k=bisect_left(A,SUM/ko)

    if k==l:
        return te
    
    if calc(l,k-1,te^1)==te or calc(k,r,te^1)==te:
        return te
    else:
        return te^1

ANS=calc(0,N-1,0)

if ANS==0:
    print("First")
else:
    print("Second")
        
0