結果

問題 No.818 Dinner time
ユーザー RyutaroYamauchiRyutaroYamauchi
提出日時 2019-04-25 19:05:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 436 bytes
コンパイル時間 206 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 48,936 KB
最終ジャッジ日時 2024-05-01 05:20:27
合計ジャッジ時間 22,256 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 459 ms
44,452 KB
testcase_01 AC 467 ms
44,460 KB
testcase_02 AC 450 ms
44,708 KB
testcase_03 AC 434 ms
44,204 KB
testcase_04 AC 448 ms
44,332 KB
testcase_05 AC 453 ms
44,448 KB
testcase_06 AC 453 ms
44,196 KB
testcase_07 AC 440 ms
44,336 KB
testcase_08 AC 448 ms
44,192 KB
testcase_09 AC 440 ms
44,324 KB
testcase_10 AC 447 ms
44,596 KB
testcase_11 AC 438 ms
44,200 KB
testcase_12 AC 442 ms
44,192 KB
testcase_13 AC 445 ms
44,332 KB
testcase_14 AC 514 ms
44,196 KB
testcase_15 AC 453 ms
44,200 KB
testcase_16 AC 441 ms
44,324 KB
testcase_17 AC 777 ms
47,784 KB
testcase_18 AC 630 ms
46,340 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 609 ms
46,252 KB
testcase_23 AC 636 ms
47,252 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 627 ms
46,500 KB
testcase_27 WA -
testcase_28 AC 692 ms
47,012 KB
testcase_29 AC 735 ms
48,036 KB
testcase_30 AC 669 ms
47,404 KB
testcase_31 AC 697 ms
47,784 KB
testcase_32 AC 659 ms
46,476 KB
権限があれば一括ダウンロードができます

ソースコード

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
ind = np.argmax(S1)
S = S0 + S2

print(S[:ind+1].max())
0