結果

問題 No.1715 Dinner 2
ユーザー taiga0629kyoprotaiga0629kyopro
提出日時 2021-10-22 21:45:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 660 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 81,592 KB
実行使用メモリ 75,688 KB
最終ジャッジ日時 2023-10-24 12:47:33
合計ジャッジ時間 3,753 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,372 KB
testcase_01 AC 37 ms
53,372 KB
testcase_02 AC 37 ms
53,372 KB
testcase_03 AC 37 ms
53,372 KB
testcase_04 AC 37 ms
53,372 KB
testcase_05 AC 36 ms
53,372 KB
testcase_06 AC 35 ms
53,372 KB
testcase_07 AC 36 ms
53,372 KB
testcase_08 AC 36 ms
53,372 KB
testcase_09 AC 37 ms
53,372 KB
testcase_10 WA -
testcase_11 AC 109 ms
75,496 KB
testcase_12 AC 133 ms
75,424 KB
testcase_13 AC 132 ms
75,420 KB
testcase_14 AC 125 ms
75,424 KB
testcase_15 AC 132 ms
75,420 KB
testcase_16 AC 103 ms
75,468 KB
testcase_17 AC 92 ms
75,472 KB
testcase_18 AC 37 ms
53,372 KB
testcase_19 AC 37 ms
53,372 KB
testcase_20 AC 36 ms
53,372 KB
testcase_21 AC 37 ms
53,372 KB
testcase_22 AC 36 ms
53,372 KB
testcase_23 AC 36 ms
53,372 KB
testcase_24 AC 37 ms
53,372 KB
testcase_25 AC 53 ms
64,028 KB
testcase_26 AC 56 ms
66,068 KB
testcase_27 AC 53 ms
64,028 KB
testcase_28 AC 53 ms
64,028 KB
testcase_29 AC 53 ms
64,028 KB
testcase_30 AC 53 ms
64,028 KB
testcase_31 AC 55 ms
66,068 KB
testcase_32 AC 135 ms
75,688 KB
testcase_33 AC 135 ms
75,684 KB
testcase_34 AC 129 ms
75,668 KB
testcase_35 AC 127 ms
75,652 KB
testcase_36 AC 37 ms
53,372 KB
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)

ans=-2**64
for i in range(n):
    for j in range(n):
        if i==j:continue
        pi,qi=p[i],q[i]
        pj,qj=p[j],q[j]
        res=0
        day=d
        res=min(-pi,-pi+qi-pj)
        go=((d-2)//2)*2
        sub=(-pi+qi-pj+qj)*go
        day-=go
        for j in range(1,day+1):
            if j%2==1:
                sub-=pi
                res=min(res,sub)
                sub+=qi
            else:
                sub -= pj
                res = min(res, sub)
                sub += qj
        ans=max(ans,res)
print(ans)

0