結果

問題 No.633 バスの運賃
ユーザー Ryuto
提出日時 2018-01-23 17:47:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 283 bytes
コンパイル時間 1,043 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2024-12-26 03:10:41
合計ジャッジ時間 1,586 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
al = list()
bcl = list()
for i in range(n-1):
    al.append(int(input()))
for i in range(n):
    bcl.append([int(x) for x in input().split()])

ans = 0
pas = 0
for i in range(n-1):
    bc = bcl[i]
    pas -= bc[0]
    pas += bc[1]
    ans += pas * al[i]

print(ans)
0