結果

問題 No.817 Coin donation
ユーザー tempura_pptempura_pp
提出日時 2019-04-01 16:49:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 939 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 106 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 25,728 KB
最終ジャッジ日時 2024-05-04 02:07:04
合計ジャッジ時間 5,244 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,752 KB
testcase_01 AC 31 ms
10,752 KB
testcase_02 AC 32 ms
10,752 KB
testcase_03 AC 34 ms
10,752 KB
testcase_04 AC 31 ms
10,752 KB
testcase_05 AC 56 ms
11,136 KB
testcase_06 AC 148 ms
12,672 KB
testcase_07 AC 176 ms
13,184 KB
testcase_08 AC 639 ms
20,992 KB
testcase_09 AC 197 ms
13,568 KB
testcase_10 AC 914 ms
25,728 KB
testcase_11 AC 939 ms
25,600 KB
testcase_12 AC 897 ms
25,600 KB
testcase_13 AC 31 ms
10,752 KB
testcase_14 AC 30 ms
10,624 KB
testcase_15 AC 30 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int,input().split())
query = []
for i in range (N) : 
    L, R = map(int,input().split())
    query.append([L,R])
ok = 10**9
ng = 0
while ok - ng > 1 : 
    mid = (ok + ng) // 2
    cnt = 0
    for L, R in query :
        if L > mid  : continue
        cnt += min(R, mid) - L + 1
    if cnt >= K : ok = mid
    else : ng = mid
print(ok)
0