結果

問題 No.817 Coin donation
ユーザー tomarint2tomarint2
提出日時 2019-04-19 22:03:13
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 354 bytes
コンパイル時間 893 ms
コンパイル使用メモリ 81,348 KB
実行使用メモリ 833,852 KB
最終ジャッジ日時 2023-10-24 02:23:00
合計ジャッジ時間 4,306 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,304 KB
testcase_01 AC 48 ms
64,044 KB
testcase_02 MLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections

def solve():
    N,K=map(int,input().split())
    dn=collections.defaultdict(int)
    for i in range(N):
        a,b=map(int,input().split())
        dn[a]+=1
        dn[b+1]-=1
    c=0
    d=0
    i=0
    while True:
        i+=1
        d+=dn[i]
        c+=d
        #print(i,c)
        if c>K:
            return i

print(solve())
0