結果

問題 No.633 バスの運賃
ユーザー akitsugu777akitsugu777
提出日時 2018-11-14 15:16:50
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 14 ms / 2,000 ms
コード長 236 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 10,688 KB
実行使用メモリ 7,952 KB
最終ジャッジ日時 2023-08-26 01:04:09
合計ジャッジ時間 990 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
7,888 KB
testcase_01 AC 12 ms
7,952 KB
testcase_02 AC 13 ms
7,872 KB
testcase_03 AC 13 ms
7,748 KB
testcase_04 AC 13 ms
7,788 KB
testcase_05 AC 13 ms
7,796 KB
testcase_06 AC 14 ms
7,788 KB
testcase_07 AC 13 ms
7,776 KB
testcase_08 AC 13 ms
7,892 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = [int(input()) for _ in range(n-1)]
b = [list(map(int, input().split())) for _ in range(n)]

c = []
d = 0
for i in b:
    d +=  i[1] - i[0]
    c.append(d)

e = 0
for i in range(len(a)):
    e += a[i] * c[i]
print(e)
0