結果
問題 | No.761 平均値ゲーム |
ユーザー |
![]() |
提出日時 | 2021-05-21 00:43:45 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 202 ms / 2,000 ms |
コード長 | 444 bytes |
コンパイル時間 | 430 ms |
コンパイル使用メモリ | 82,792 KB |
実行使用メモリ | 95,748 KB |
最終ジャッジ日時 | 2024-10-10 07:24:10 |
合計ジャッジ時間 | 13,240 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 100 |
ソースコード
from bisect import bisect_left, bisect_rightdef f(L,R):if R-L<=1:return R-Lelif R-L==2:return int(a[L]==a[L+1])s = acc[R] - acc[L]i = bisect_left(a,(s+R-L-1)//(R-L))v = 0if L < i and f(i,R)==0: v = 1if i < R and f(L,i)==0: v = 1return vn = int(input())*a, = map(int,input().split())acc = [0]+a[:]for i in range(1,n+1):acc[i] += acc[i-1]print("First" if f(0,n) else "Second")