結果

問題 No.561 東京と京都
ユーザー Ricky-yuRicky-yu
提出日時 2018-07-15 23:38:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 475 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 10,680 KB
実行使用メモリ 7,944 KB
最終ジャッジ日時 2023-08-07 09:22:13
合計ジャッジ時間 1,448 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 15 ms
7,752 KB
testcase_02 AC 15 ms
7,888 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 14 ms
7,916 KB
testcase_06 AC 15 ms
7,764 KB
testcase_07 AC 15 ms
7,800 KB
testcase_08 AC 14 ms
7,800 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 15 ms
7,896 KB
testcase_13 WA -
testcase_14 AC 15 ms
7,828 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

D_C = input().split()
Tokyo = True
Total = 0
for i in range(int(D_C[0])):
    money = input().split()
    if Tokyo:
       if int(money[0]) < int(money[1])-int(D_C[1]):
            Tokyo = False
            Total += int(money[1])-int(D_C[1])
       else:
           Total += int(money[0])
    else:
        if int(money[1]) < int(money[0])-int(D_C[1]):
            Tokyo = True
            Total += int(money[0])
        else:
            Total += int(money[1])
print(Total)
0