結果
問題 | No.817 Coin donation |
ユーザー |
|
提出日時 | 2019-04-28 13:33:22 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 739 ms / 2,000 ms |
コード長 | 260 bytes |
コンパイル時間 | 816 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 22,912 KB |
最終ジャッジ日時 | 2024-12-16 02:00:52 |
合計ジャッジ時間 | 5,372 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 14 |
ソースコード
#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