結果

問題 No.817 Coin donation
コンテスト
ユーザー tomarint2
提出日時 2019-04-19 22:03:13
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
MLE  
実行時間 -
コード長 354 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 238 ms
コンパイル使用メモリ 85,056 KB
実行使用メモリ 1,338,356 KB
最終ジャッジ日時 2026-04-11 01:54:42
合計ジャッジ時間 4,295 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other MLE * 2 -- * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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