結果

問題 No.817 Coin donation
ユーザー tanon710tanon710
提出日時 2019-07-27 00:11:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 347 bytes
コンパイル時間 456 ms
コンパイル使用メモリ 10,648 KB
実行使用メモリ 27,952 KB
最終ジャッジ日時 2023-09-15 05:12:23
合計ジャッジ時間 4,702 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,864 KB
testcase_01 AC 16 ms
7,864 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 28 ms
8,528 KB
testcase_06 AC 75 ms
10,700 KB
testcase_07 AC 86 ms
11,516 KB
testcase_08 AC 327 ms
21,652 KB
testcase_09 AC 99 ms
11,956 KB
testcase_10 AC 494 ms
27,784 KB
testcase_11 AC 496 ms
27,824 KB
testcase_12 AC 479 ms
27,952 KB
testcase_13 AC 16 ms
7,828 KB
testcase_14 AC 16 ms
7,788 KB
testcase_15 AC 15 ms
7,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def cond(arr,m):
    ret=0
    for v1,v2 in arr:
        if v1<=m<=v2:
            ret+=(m-v1+1)
        elif v2<m:
            ret+=(v2-v1+1)
    return ret

n,k=map(int,input().split())
arr=[list(map(int,input().split())) for _ in range(n)]
l=0
r=k+1
while r-l!=1:
    m=(r+l)//2
    if cond(arr,m)>=k:
        r=m
    else:
        l=m
print(r)
0