結果

問題 No.633 バスの運賃
ユーザー c-yanc-yan
提出日時 2021-02-23 02:12:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 215 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 11,656 KB
実行使用メモリ 9,916 KB
最終ジャッジ日時 2023-10-21 19:51:57
合計ジャッジ時間 1,092 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
9,916 KB
testcase_01 AC 25 ms
9,916 KB
testcase_02 AC 25 ms
9,916 KB
testcase_03 AC 26 ms
9,916 KB
testcase_04 AC 27 ms
9,916 KB
testcase_05 AC 26 ms
9,916 KB
testcase_06 AC 26 ms
9,916 KB
testcase_07 AC 27 ms
9,916 KB
testcase_08 AC 27 ms
9,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = [int(input()) for _ in range(n - 1)]

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