結果

問題 No.633 バスの運賃
ユーザー kohei2019
提出日時 2022-02-17 22:50:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 197 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 82,576 KB
実行使用メモリ 53,912 KB
最終ジャッジ日時 2024-06-29 07:52:36
合計ジャッジ時間 1,116 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
lsa = [int(input()) for i in range(N-1)]
now = 0
ans = 0
for i in range(N-1):
    b,c = map(int,input().split())
    now -= b
    now += c
    ans += lsa[i]*now
input()
print(ans)
0