結果

問題 No.633 バスの運賃
ユーザー fjafjafjafjafjafja
提出日時 2018-02-04 22:58:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 292 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 10,864 KB
実行使用メモリ 7,968 KB
最終ジャッジ日時 2023-09-12 16:09:58
合計ジャッジ時間 900 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,860 KB
testcase_01 AC 16 ms
7,748 KB
testcase_02 AC 16 ms
7,796 KB
testcase_03 AC 15 ms
7,844 KB
testcase_04 AC 16 ms
7,840 KB
testcase_05 AC 16 ms
7,968 KB
testcase_06 AC 15 ms
7,968 KB
testcase_07 AC 16 ms
7,960 KB
testcase_08 AC 16 ms
7,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
yen=[]
cnt=0
fee=0
h=[[] for i in range(2)]
for i in range(n-1):
    yen.append(int(input()))
for i in range(n):
    a=list(map(int,(input().split())))
    h[0].append(a[0])
    h[1].append(a[1])
for i in range(n-1):
    cnt+=(-h[0][i]+h[1][i])
    fee+=(cnt*yen[i])
print(fee)
0