結果
問題 | No.633 バスの運賃 |
ユーザー |
![]() |
提出日時 | 2020-07-30 22:37:04 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 41 ms / 2,000 ms |
コード長 | 305 bytes |
コンパイル時間 | 184 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 52,480 KB |
最終ジャッジ日時 | 2024-07-04 22:13:54 |
合計ジャッジ時間 | 1,148 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 |
ソースコード
n=int(input()) ab = [] for _ in range(n-1): a = int(input()) ab.append(a) men_in_bus = 0 ans = 0 for i in range(n): b,c = map(int,input().split()) if i == 0: men_in_bus += c elif i == n-1: break else: men_in_bus += c-b ans += men_in_bus*ab[i] print(ans)