結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,384 KB
testcase_01 AC 34 ms
53,384 KB
testcase_02 AC 34 ms
53,384 KB
testcase_03 AC 35 ms
53,384 KB
testcase_04 AC 36 ms
53,384 KB
testcase_05 AC 35 ms
53,384 KB
testcase_06 AC 34 ms
53,384 KB
testcase_07 AC 34 ms
53,384 KB
testcase_08 AC 38 ms
53,384 KB
testcase_09 AC 35 ms
53,384 KB
testcase_10 WA -
testcase_11 AC 80 ms
68,208 KB
testcase_12 AC 94 ms
70,360 KB
testcase_13 AC 101 ms
70,360 KB
testcase_14 AC 89 ms
70,360 KB
testcase_15 AC 99 ms
70,364 KB
testcase_16 AC 75 ms
66,160 KB
testcase_17 AC 67 ms
66,160 KB
testcase_18 AC 34 ms
53,384 KB
testcase_19 AC 34 ms
53,384 KB
testcase_20 AC 34 ms
53,384 KB
testcase_21 AC 35 ms
53,384 KB
testcase_22 AC 34 ms
53,384 KB
testcase_23 AC 35 ms
53,384 KB
testcase_24 AC 35 ms
53,384 KB
testcase_25 AC 49 ms
63,776 KB
testcase_26 AC 49 ms
63,780 KB
testcase_27 AC 49 ms
61,728 KB
testcase_28 AC 49 ms
63,776 KB
testcase_29 AC 49 ms
61,732 KB
testcase_30 AC 50 ms
61,724 KB
testcase_31 AC 52 ms
63,800 KB
testcase_32 AC 95 ms
68,280 KB
testcase_33 AC 97 ms
68,280 KB
testcase_34 AC 96 ms
68,280 KB
testcase_35 AC 95 ms
68,276 KB
testcase_36 AC 34 ms
53,384 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
        T=food[i][2]+food[j][2]
        tmp=min(food[i][0],food[i][2]+food[j][0])
        if T<0:
            if tmp==food[i][0]:
                if d%2==0:
                    tmp=T*(d//2-1)+food[i][0]
                else:
                    tmp=T*((d-1)//2)+food[i][0]
            else:
                if d%2==0:
                    tmp=T*(d//2-1)+tmp
                else:
                    tmp=T*((d-1)//2)+min(food[i][0],-food[j][1])
        ans=max(ans,tmp)
print(ans)
0