結果

問題 No.817 Coin donation
ユーザー pluto77pluto77
提出日時 2019-04-28 13:33:22
言語 Python2
(2.7.18)
結果
AC  
実行時間 682 ms / 2,000 ms
コード長 260 bytes
コンパイル時間 1,387 ms
コンパイル使用メモリ 7,128 KB
実行使用メモリ 22,448 KB
最終ジャッジ日時 2023-08-22 06:59:47
合計ジャッジ時間 6,374 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
5,876 KB
testcase_01 AC 11 ms
5,952 KB
testcase_02 AC 11 ms
5,932 KB
testcase_03 AC 13 ms
5,996 KB
testcase_04 AC 11 ms
5,932 KB
testcase_05 AC 30 ms
6,308 KB
testcase_06 AC 96 ms
7,912 KB
testcase_07 AC 118 ms
8,548 KB
testcase_08 AC 457 ms
17,180 KB
testcase_09 AC 139 ms
9,088 KB
testcase_10 AC 679 ms
22,296 KB
testcase_11 AC 682 ms
22,448 KB
testcase_12 AC 674 ms
22,396 KB
testcase_13 AC 11 ms
5,856 KB
testcase_14 AC 11 ms
5,884 KB
testcase_15 AC 11 ms
5,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki817

n,k=map(int,raw_input().split())
ab=[]
for i in xrange(n):
 ab.append(map(int,raw_input().split()))
l=0
r=10**9
while r-l>1:
 mid=(l+r)/2
 cnt=0
 for a,b in ab:
  if a>mid:
   continue
  cnt+=min(b,mid)-a+1
 if cnt>=k:
  r=mid
 else:
  l=mid
print r
0