結果
問題 |
No.1808 Fullgold Alchemist
|
ユーザー |
|
提出日時 | 2022-01-15 10:09:33 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 112 ms / 2,000 ms |
コード長 | 325 bytes |
コンパイル時間 | 158 ms |
コンパイル使用メモリ | 82,708 KB |
実行使用メモリ | 102,656 KB |
最終ジャッジ日時 | 2024-11-21 08:00:11 |
合計ジャッジ時間 | 3,898 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
N,M = map(int,input().split()) A = list(map(int,input().split())) def is_ok(k): sgm = 0 for a in A: sgm += a - M * k if sgm < 0: return False return True ok = 0 ng = 10 ** 9 + 1 while ng - ok > 1: k = (ng+ok) //2 if is_ok(k): ok = k else: ng = k print(ok)