結果
| 問題 | No.817 Coin donation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-27 15:06:17 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 454 bytes |
| 記録 | |
| コンパイル時間 | 363 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 82,648 KB |
| 最終ジャッジ日時 | 2024-12-25 13:30:28 |
| 合計ジャッジ時間 | 3,256 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 2 |
| other | RE * 14 |
ソースコード
N,K = map(int,input().split())
edge = []
for _ in range(N):
a,b = map(int,input().split())
edge.append((a,b))
def check(x):
count = 0
for a,b in edge:
if a <= x <= b:
count += x - a + 1
elif x > b:
count += b - a + 1
return count <= K
start = 0
end = 10 ** 9
while end - start > 1:
mid = (end + start) // 2
if chekc(mid):
end = mid
else:
start = mid
print(end)