結果
問題 | No.761 平均値ゲーム |
ユーザー |
![]() |
提出日時 | 2020-03-19 14:51:21 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 78 ms / 2,000 ms |
コード長 | 630 bytes |
コンパイル時間 | 111 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 21,120 KB |
最終ジャッジ日時 | 2024-12-14 03:13:22 |
合計ジャッジ時間 | 7,810 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 100 |
ソースコード
#!/usr/bin/ python3.8# %%import sysread = sys.stdin.buffer.readreadline = sys.stdin.buffer.readlinereadlines = sys.stdin.buffer.readlinessys.setrecursionlimit(10 ** 5)import itertoolsfrom bisect import bisect_leftN = int(readline())A = tuple(map(int, read().split()))Acum = (0,) + tuple(itertools.accumulate(A))def solve(L, R):"""result on interval [L,R)"""S = Acum[R] - Acum[L]n = R - Lx = (S + n - 1) // ni = bisect_left(A, x, lo=L, hi=R)if i == L:return Trueif not solve(L, i):return Truereturn not solve(i, R)print('First' if solve(0,N) else 'Second')