結果

問題 No.1715 Dinner 2
ユーザー taiga0629kyoprotaiga0629kyopro
提出日時 2021-10-22 22:12:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 540 bytes
コンパイル時間 353 ms
コンパイル使用メモリ 81,724 KB
実行使用メモリ 75,568 KB
最終ジャッジ日時 2023-10-24 13:24:44
合計ジャッジ時間 6,254 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,504 KB
testcase_01 AC 40 ms
59,296 KB
testcase_02 AC 44 ms
61,884 KB
testcase_03 AC 40 ms
53,504 KB
testcase_04 AC 42 ms
59,692 KB
testcase_05 AC 44 ms
61,884 KB
testcase_06 AC 36 ms
53,504 KB
testcase_07 AC 42 ms
59,692 KB
testcase_08 AC 43 ms
61,428 KB
testcase_09 AC 42 ms
59,684 KB
testcase_10 AC 42 ms
59,692 KB
testcase_11 AC 288 ms
75,416 KB
testcase_12 AC 236 ms
75,564 KB
testcase_13 AC 204 ms
75,520 KB
testcase_14 AC 226 ms
75,556 KB
testcase_15 AC 270 ms
75,556 KB
testcase_16 AC 231 ms
75,408 KB
testcase_17 AC 170 ms
75,412 KB
testcase_18 AC 61 ms
72,224 KB
testcase_19 AC 63 ms
73,568 KB
testcase_20 AC 61 ms
72,220 KB
testcase_21 AC 55 ms
68,084 KB
testcase_22 AC 62 ms
72,884 KB
testcase_23 AC 69 ms
75,252 KB
testcase_24 AC 69 ms
75,276 KB
testcase_25 AC 86 ms
75,504 KB
testcase_26 AC 80 ms
75,400 KB
testcase_27 AC 80 ms
75,292 KB
testcase_28 AC 82 ms
75,280 KB
testcase_29 AC 82 ms
75,272 KB
testcase_30 AC 83 ms
75,412 KB
testcase_31 AC 86 ms
75,288 KB
testcase_32 AC 372 ms
75,564 KB
testcase_33 AC 360 ms
75,560 KB
testcase_34 AC 341 ms
75,568 KB
testcase_35 AC 329 ms
75,372 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,d=map(int,input().split())
p=[]
q=[]
for i in range(n):
    a,b=map(int,input().split())
    p.append(a)
    q.append(b)
def f(x):
    res=0
    f=-1
    for _ in range(d):
        up=-10**18
        ind=-1
        for i in range(n):
            if i!=f and res-p[i]>=x:
                up=max(up,q[i]-p[i])
                if up==q[i]-p[i]:ind=i

        if up == -10 ** 18: return False
        res+=up
        f=ind
    return True

ok=-10**18
ng=0
while ng-ok>1:
    mid=(ok+ng)//2
    if f(mid):ok=mid
    else:ng=mid
print(ok)




0