結果

問題 No.1715 Dinner 2
ユーザー HydruHydru
提出日時 2021-10-22 22:12:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 636 bytes
コンパイル時間 230 ms
コンパイル使用メモリ 81,820 KB
実行使用メモリ 70,496 KB
最終ジャッジ日時 2023-10-24 13:24:50
合計ジャッジ時間 3,480 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,500 KB
testcase_01 AC 36 ms
53,500 KB
testcase_02 AC 36 ms
53,500 KB
testcase_03 AC 35 ms
53,500 KB
testcase_04 AC 36 ms
53,500 KB
testcase_05 WA -
testcase_06 AC 35 ms
53,500 KB
testcase_07 AC 35 ms
53,500 KB
testcase_08 AC 35 ms
53,500 KB
testcase_09 AC 35 ms
53,500 KB
testcase_10 WA -
testcase_11 AC 86 ms
68,352 KB
testcase_12 AC 92 ms
68,432 KB
testcase_13 AC 102 ms
70,496 KB
testcase_14 AC 106 ms
68,448 KB
testcase_15 AC 98 ms
70,496 KB
testcase_16 AC 80 ms
68,356 KB
testcase_17 AC 71 ms
68,360 KB
testcase_18 AC 35 ms
53,500 KB
testcase_19 AC 35 ms
53,500 KB
testcase_20 AC 35 ms
53,500 KB
testcase_21 AC 35 ms
53,500 KB
testcase_22 AC 35 ms
53,500 KB
testcase_23 AC 35 ms
53,500 KB
testcase_24 AC 36 ms
53,500 KB
testcase_25 AC 50 ms
63,920 KB
testcase_26 AC 51 ms
63,928 KB
testcase_27 AC 49 ms
63,916 KB
testcase_28 AC 50 ms
63,920 KB
testcase_29 AC 50 ms
63,916 KB
testcase_30 AC 51 ms
63,916 KB
testcase_31 AC 51 ms
63,940 KB
testcase_32 AC 104 ms
70,492 KB
testcase_33 AC 105 ms
70,492 KB
testcase_34 AC 105 ms
70,484 KB
testcase_35 AC 102 ms
70,484 KB
testcase_36 AC 35 ms
53,500 KB
testcase_37 WA -
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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