結果

問題 No.818 Dinner time
ユーザー convexineqconvexineq
提出日時 2021-03-23 06:30:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 272 bytes
コンパイル時間 2,202 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 87,780 KB
最終ジャッジ日時 2023-08-16 10:08:06
合計ジャッジ時間 8,724 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,268 KB
testcase_01 AC 69 ms
71,308 KB
testcase_02 WA -
testcase_03 AC 69 ms
71,020 KB
testcase_04 WA -
testcase_05 AC 70 ms
71,424 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 74 ms
71,380 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(n)]

INF = 10**18
X,Y,Z,V,W = [0]*5
for a,b in ab:
    x = a*m
    y = a*(m-1) + b
    X,Y,Z,V,W = max(X,Y)+x, max(X,Y)+y, max(X,Y,Z)+a, max(X,Y,Z,V)+b, max(X,Y,Z,V,W)
print(max(X,Y,Z,V,W))
0