結果

問題 No.818 Dinner time
ユーザー convexineqconvexineq
提出日時 2021-03-23 07:15:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 221 bytes
コンパイル時間 2,287 ms
コンパイル使用メモリ 86,876 KB
実行使用メモリ 87,852 KB
最終ジャッジ日時 2023-08-16 10:45:59
合計ジャッジ時間 6,947 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,344 KB
testcase_01 AC 70 ms
71,376 KB
testcase_02 AC 71 ms
71,332 KB
testcase_03 AC 71 ms
71,244 KB
testcase_04 AC 71 ms
71,276 KB
testcase_05 AC 71 ms
71,040 KB
testcase_06 AC 73 ms
71,044 KB
testcase_07 AC 74 ms
71,288 KB
testcase_08 AC 71 ms
71,368 KB
testcase_09 WA -
testcase_10 AC 70 ms
71,148 KB
testcase_11 WA -
testcase_12 AC 71 ms
71,308 KB
testcase_13 AC 71 ms
71,060 KB
testcase_14 AC 71 ms
71,168 KB
testcase_15 AC 74 ms
71,316 KB
testcase_16 AC 71 ms
71,536 KB
testcase_17 AC 195 ms
87,116 KB
testcase_18 AC 164 ms
83,892 KB
testcase_19 AC 160 ms
83,884 KB
testcase_20 AC 179 ms
85,924 KB
testcase_21 AC 169 ms
83,940 KB
testcase_22 AC 180 ms
83,872 KB
testcase_23 AC 188 ms
84,424 KB
testcase_24 AC 216 ms
87,852 KB
testcase_25 AC 186 ms
84,008 KB
testcase_26 AC 183 ms
83,476 KB
testcase_27 AC 207 ms
86,332 KB
testcase_28 AC 196 ms
85,120 KB
testcase_29 AC 207 ms
86,904 KB
testcase_30 AC 196 ms
85,608 KB
testcase_31 AC 199 ms
85,664 KB
testcase_32 AC 164 ms
83,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(n)]
X,Y,Z = [0]*3
for a,b in ab:
    x = a*m
    y = a*(m-1) + b
    X,Y,Z = X+max(x,y,b), max(X,Y)+max(a,b), max(X,Y,Z)
print(max(X,Y,Z))
0