結果

問題 No.633 バスの運賃
ユーザー syunsukesyunsuke
提出日時 2018-07-03 00:31:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 10,636 KB
実行使用メモリ 7,908 KB
最終ジャッジ日時 2023-09-13 17:06:04
合計ジャッジ時間 992 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,844 KB
testcase_01 AC 15 ms
7,760 KB
testcase_02 AC 15 ms
7,784 KB
testcase_03 AC 15 ms
7,756 KB
testcase_04 AC 15 ms
7,688 KB
testcase_05 AC 14 ms
7,764 KB
testcase_06 AC 15 ms
7,812 KB
testcase_07 AC 15 ms
7,908 KB
testcase_08 AC 16 ms
7,776 KB
権限があれば一括ダウンロードができます

ソースコード

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