結果

問題 No.633 バスの運賃
ユーザー ysys
提出日時 2018-01-19 21:33:13
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 7,952 KB
最終ジャッジ日時 2023-08-26 00:02:49
合計ジャッジ時間 909 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,764 KB
testcase_01 AC 16 ms
7,756 KB
testcase_02 AC 16 ms
7,824 KB
testcase_03 AC 16 ms
7,876 KB
testcase_04 AC 16 ms
7,944 KB
testcase_05 AC 16 ms
7,828 KB
testcase_06 AC 16 ms
7,952 KB
testcase_07 AC 17 ms
7,944 KB
testcase_08 AC 16 ms
7,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = []
for i in range(n - 1):
    a.append(int(input()))
ans = 0
d = 0
for i in range(n - 1):
    b, c = map(int, input().split())
    d = d - b + c
    ans += a[i] * d

print(ans)
0