結果

問題 No.561 東京と京都
ユーザー dangodango
提出日時 2023-06-14 16:19:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 167 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 86,740 KB
実行使用メモリ 71,220 KB
最終ジャッジ日時 2023-09-05 03:50:20
合計ジャッジ時間 3,128 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,044 KB
testcase_01 AC 78 ms
71,040 KB
testcase_02 AC 77 ms
71,112 KB
testcase_03 AC 77 ms
71,212 KB
testcase_04 AC 77 ms
71,068 KB
testcase_05 AC 79 ms
70,956 KB
testcase_06 AC 77 ms
71,000 KB
testcase_07 AC 77 ms
71,036 KB
testcase_08 AC 79 ms
70,976 KB
testcase_09 AC 79 ms
71,216 KB
testcase_10 AC 79 ms
71,220 KB
testcase_11 AC 79 ms
71,132 KB
testcase_12 AC 80 ms
70,920 KB
testcase_13 AC 78 ms
71,064 KB
testcase_14 AC 80 ms
70,956 KB
testcase_15 AC 78 ms
71,216 KB
testcase_16 AC 80 ms
71,188 KB
testcase_17 AC 80 ms
70,924 KB
testcase_18 AC 79 ms
71,048 KB
testcase_19 AC 79 ms
71,108 KB
testcase_20 AC 81 ms
70,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, D = map(int,input().split())
T, K = 0, -D
for _ in '1' * N:
  A, B = map(int,input().split())
  T, K = max(T + A, K + A - D), max(T + B - D, K + B)
print(max(T, K))
0