結果

問題 No.633 バスの運賃
ユーザー syunsuke
提出日時 2018-07-03 00:31:01
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-01 01:41:59
合計ジャッジ時間 978 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
list1=[0]
list2=[]
count=0
for i in range(N-1):
    cost=int(input())
    list1.append(cost)
#print(list1)
for j in range(N):
    list2.append(count)
    line=input()
    line=line.rstrip().split(" ")
    a=int(line[0])
    b=int(line[1])
    count=count-a+b
    
#print(list2)
cost=0
for k in range(N):
    cost=cost+list1[k]*list2[k]
print(cost)
0