結果

問題 No.818 Dinner time
ユーザー 双六双六
提出日時 2019-04-19 23:17:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 436 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 13,848 KB
最終ジャッジ日時 2023-10-24 12:36:03
合計ジャッジ時間 6,074 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 29 ms
10,092 KB
testcase_02 WA -
testcase_03 AC 28 ms
10,092 KB
testcase_04 AC 29 ms
10,092 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 29 ms
10,092 KB
testcase_12 AC 28 ms
10,096 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 349 ms
13,848 KB
testcase_18 AC 240 ms
12,416 KB
testcase_19 AC 237 ms
12,664 KB
testcase_20 AC 319 ms
13,640 KB
testcase_21 AC 276 ms
12,928 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def getlist():
	return list(map(int, input().split()))

N, M = getlist()

L = []
for i in range(N):
	ans = 0
	A, B = getlist()
	if 0 <= A and 0 <= B:
		if A < B:
			ans += (M - 1) * A + B
		else:
			ans += M * A
	elif A < 0 and 0 <= B:
		ans += B
	elif A < 0 and B < 0:
		if A * M < B:
			ans += B
		else:
			ans += A * M
	L.append(ans)

ANS = -float("inf")
val = 0
for i in range(N):
	val += L[i]
	if val > ANS:
		ANS = val

print(ANS)
0