結果

問題 No.818 Dinner time
ユーザー RyutaroYamauchi
提出日時 2019-04-25 19:02:18
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 408 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 49,328 KB
最終ジャッジ日時 2024-11-21 06:35:10
合計ジャッジ時間 23,221 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 23 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

A = []
B = []

N, M = map(int, input().strip().split(' '))

for i in range(N):
    a, b = map(int, input().strip().split(' '))
    A.append(a)
    B.append(b)

A = np.array(A, dtype=np.int64)
B = np.array(B, dtype=np.int64)

S0 = np.maximum(np.maximum(A * M, A * (M - 1) + B), B)
S1 = np.maximum(A, B)

S0 = np.cumsum(S0)
S1 = np.cumsum(S1)
S2 = S1.max() - S1
S = S0 + S2

print(S.max())
0