結果
| 問題 | 
                            No.633 バスの運賃
                             | 
                    
| コンテスト | |
| ユーザー | 
                             convexineq
                         | 
                    
| 提出日時 | 2021-02-26 03:13:45 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 46 ms / 2,000 ms | 
| コード長 | 161 bytes | 
| コンパイル時間 | 240 ms | 
| コンパイル使用メモリ | 82,688 KB | 
| 実行使用メモリ | 52,480 KB | 
| 最終ジャッジ日時 | 2024-10-01 19:10:02 | 
| 合計ジャッジ時間 | 1,208 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 9 | 
ソースコード
n = int(input())
a = [int(input()) for _ in range(n-1)] + [0]
ans = x = 0
for ai in a:
    b,c = map(int,input().split())
    x += c-b
    ans += x*ai
print(ans)
            
            
            
        
            
convexineq