結果
問題 | No.818 Dinner time |
ユーザー | RyutaroYamauchi |
提出日時 | 2019-04-25 17:46:45 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 502 bytes |
コンパイル時間 | 79 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 54,348 KB |
最終ジャッジ日時 | 2024-04-30 22:27:16 |
合計ジャッジ時間 | 12,779 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 455 ms
50,596 KB |
testcase_01 | AC | 446 ms
43,564 KB |
testcase_02 | AC | 433 ms
43,712 KB |
testcase_03 | AC | 444 ms
43,684 KB |
testcase_04 | AC | 440 ms
43,584 KB |
testcase_05 | AC | 444 ms
43,812 KB |
testcase_06 | AC | 439 ms
43,812 KB |
testcase_07 | AC | 452 ms
43,704 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | AC | 442 ms
43,964 KB |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | AC | 432 ms
43,820 KB |
testcase_14 | AC | 437 ms
43,688 KB |
testcase_15 | AC | 439 ms
43,964 KB |
testcase_16 | AC | 441 ms
43,832 KB |
testcase_17 | TLE | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
ソースコード
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) B = np.array(B) S0 = np.maximum(np.maximum(A * M, A * (M - 1) + B), B) S1 = np.maximum(A, B) ans = None for k in range(1, N+1): score = S0[:k].sum() if k != N: score += np.cumsum(S1[k:]).max() if ans is None: ans = score if score > ans: ans = score print(ans)