結果

問題 No.1715 Dinner 2
ユーザー HydruHydru
提出日時 2021-10-22 23:01:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 508 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 81,768 KB
実行使用メモリ 70,312 KB
最終ジャッジ日時 2023-10-24 14:33:49
合計ジャッジ時間 3,546 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,340 KB
testcase_01 AC 36 ms
53,340 KB
testcase_02 AC 40 ms
53,340 KB
testcase_03 AC 35 ms
53,340 KB
testcase_04 AC 35 ms
53,340 KB
testcase_05 WA -
testcase_06 AC 37 ms
53,340 KB
testcase_07 AC 37 ms
53,340 KB
testcase_08 AC 36 ms
53,340 KB
testcase_09 AC 36 ms
53,340 KB
testcase_10 AC 36 ms
53,340 KB
testcase_11 AC 79 ms
68,184 KB
testcase_12 AC 86 ms
70,312 KB
testcase_13 AC 87 ms
68,248 KB
testcase_14 AC 82 ms
70,312 KB
testcase_15 AC 86 ms
68,248 KB
testcase_16 AC 74 ms
68,184 KB
testcase_17 AC 69 ms
68,184 KB
testcase_18 AC 35 ms
53,340 KB
testcase_19 AC 35 ms
53,340 KB
testcase_20 AC 37 ms
53,340 KB
testcase_21 AC 36 ms
53,340 KB
testcase_22 AC 36 ms
53,340 KB
testcase_23 AC 35 ms
53,340 KB
testcase_24 AC 36 ms
53,340 KB
testcase_25 AC 50 ms
63,756 KB
testcase_26 AC 52 ms
63,740 KB
testcase_27 AC 51 ms
63,760 KB
testcase_28 AC 49 ms
63,756 KB
testcase_29 AC 49 ms
63,756 KB
testcase_30 AC 49 ms
63,752 KB
testcase_31 AC 50 ms
63,756 KB
testcase_32 AC 93 ms
70,296 KB
testcase_33 AC 93 ms
70,308 KB
testcase_34 AC 92 ms
70,308 KB
testcase_35 AC 92 ms
70,296 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 36 ms
53,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,d=map(int,input().split())
food=[]
for _ in range(n):
    p,q=map(int,input().split())
    food.append([-p,q,q-p])
food.sort()
las=food[-1][0]
ans=-10**9+1
for i in range(n):
    for j in range(n):
        if i==j:
            continue
        T=food[i][2]+food[j][2]
        tmp=min(food[i][0],food[i][2]+food[j][0])
        if T<0:
            if d%2==0:
                tmp=T*(d//2-1)+food[i][0]
            else:
                tmp=T*((d-1)//2)+min(-food[j][1],las)
        ans=max(ans,tmp)
print(ans)
0