結果
| 問題 | No.633 バスの運賃 | 
| コンテスト | |
| ユーザー |  ntuda | 
| 提出日時 | 2024-06-08 15:56:09 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 42 ms / 2,000 ms | 
| コード長 | 188 bytes | 
| コンパイル時間 | 1,529 ms | 
| コンパイル使用メモリ | 81,840 KB | 
| 実行使用メモリ | 53,696 KB | 
| 最終ジャッジ日時 | 2024-12-28 02:50:52 | 
| 合計ジャッジ時間 | 1,503 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 9 | 
ソースコード
N = int(input())
A = [int(input()) for _ in range(N-1)]
now = 0
ans = 0
for i in range(N - 1):
    b,c = map(int,input().split())
    now += c
    now -= b
    ans += A[i] * now
print(ans)
            
            
            
        