結果

問題 No.633 バスの運賃
ユーザー ddsyg1
提出日時 2019-05-14 16:21:51
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 241 bytes
コンパイル時間 131 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-18 15:39:22
合計ジャッジ時間 824 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = []
ppl = 0
ans = 0

for x in range(0,n-1):
    a.append(input())

b, c = map(int,input().split())
ppl += c

for y in a:
    b, c = map(int,input().split())
    ans = (ppl * int(y)) + ans
    ppl = ppl - b + c

print(ans)
0