結果
| 問題 |
No.1808 Fullgold Alchemist
|
| コンテスト | |
| ユーザー |
vwxyz
|
| 提出日時 | 2024-08-09 05:41:08 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 1,696 ms / 2,000 ms |
| コード長 | 433 bytes |
| コンパイル時間 | 430 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 33,280 KB |
| 最終ジャッジ日時 | 2024-08-09 05:41:25 |
| 合計ジャッジ時間 | 17,683 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 |
ソースコード
def Bisect_Int(ok,ng,is_ok):
while abs(ok-ng)>1:
mid=(ok+ng)//2
if is_ok(mid):
ok=mid
else:
ng=mid
return ok
N,M=map(int,input().split())
A=list(map(int,input().split()))
def is_ok(ans):
C=A[:]
for i in range(N):
if C[i]<ans:
return False
if i<N-1:
C[i+1]+=C[i]-ans
return True
ans=Bisect_Int(0,max(A)+1,is_ok)//M
print(ans)
vwxyz