結果
問題 |
No.818 Dinner time
|
ユーザー |
![]() |
提出日時 | 2021-03-23 06:30:00 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 272 bytes |
コンパイル時間 | 235 ms |
コンパイル使用メモリ | 82,152 KB |
実行使用メモリ | 86,676 KB |
最終ジャッジ日時 | 2024-11-24 22:21:44 |
合計ジャッジ時間 | 5,310 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 2 WA * 27 |
ソースコード
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))