結果
| 問題 |
No.1211 円環はお断り
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-16 16:42:27 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 597 bytes |
| コンパイル時間 | 226 ms |
| コンパイル使用メモリ | 82,476 KB |
| 実行使用メモリ | 90,452 KB |
| 最終ジャッジ日時 | 2025-04-16 16:44:19 |
| 合計ジャッジ時間 | 4,229 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 36 WA * 5 |
ソースコード
n, k = map(int, input().split())
a = list(map(int, input().split()))
def is_possible(mid):
current_sum = 0
count = 0
for num in a:
current_sum += num
if current_sum >= mid:
count += 1
current_sum = 0
return count >= k
low = 0
high = sum(a)
answer = 0
while low <= high:
mid = (low + high) // 2
if mid == 0:
if is_possible(1):
low = mid + 1
else:
answer = 0
break
if is_possible(mid):
answer = mid
low = mid + 1
else:
high = mid - 1
print(answer)
lam6er