結果
問題 |
No.818 Dinner time
|
ユーザー |
![]() |
提出日時 | 2019-04-25 17:25:34 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 582 bytes |
コンパイル時間 | 97 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 28,928 KB |
最終ジャッジ日時 | 2024-11-20 20:16:14 |
合計ジャッジ時間 | 49,801 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 TLE * 16 |
ソースコード
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) ans = None for k in range(1, N+1): score = 0 for i in range(k): score += max(A[i] * M, A[i] * (M - 1) + B[i], B[i]) max_score = score for i in range(k, N): score += max(A[i], B[i]) if score > max_score: max_score = score if ans is None: ans = max_score if max_score > ans: ans = max_score print(ans)