結果

問題 No.633 バスの運賃
ユーザー qibqib
提出日時 2023-01-28 15:54:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 186 bytes
コンパイル時間 1,415 ms
コンパイル使用メモリ 86,812 KB
実行使用メモリ 71,432 KB
最終ジャッジ日時 2023-09-11 04:45:47
合計ジャッジ時間 2,191 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,352 KB
testcase_01 AC 76 ms
71,244 KB
testcase_02 AC 77 ms
71,052 KB
testcase_03 AC 77 ms
71,404 KB
testcase_04 AC 78 ms
71,388 KB
testcase_05 AC 75 ms
71,088 KB
testcase_06 AC 75 ms
71,352 KB
testcase_07 AC 75 ms
71,148 KB
testcase_08 AC 78 ms
71,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

print(ans)
0