結果
問題 | No.633 バスの運賃 |
ユーザー |
![]() |
提出日時 | 2025-03-20 21:08:40 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 40 ms / 2,000 ms |
コード長 | 352 bytes |
コンパイル時間 | 188 ms |
コンパイル使用メモリ | 82,700 KB |
実行使用メモリ | 53,316 KB |
最終ジャッジ日時 | 2025-03-20 21:09:27 |
合計ジャッジ時間 | 1,098 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 |
ソースコード
n = int(input()) a = [int(input()) for _ in range(n-1)] b = [] c = [] for _ in range(n): bi, ci = map(int, input().split()) b.append(bi) c.append(ci) current_passengers = 0 total = 0 for i in range(n): current_passengers -= b[i] current_passengers += c[i] if i + 1 < n: total += a[i] * current_passengers print(total)