結果

問題 No.633 バスの運賃
ユーザー zaki_chemtechzaki_chemtech
提出日時 2020-07-30 22:37:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 305 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 71,536 KB
最終ジャッジ日時 2023-09-18 05:54:29
合計ジャッジ時間 1,775 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,144 KB
testcase_01 AC 73 ms
71,472 KB
testcase_02 AC 76 ms
71,324 KB
testcase_03 AC 75 ms
71,536 KB
testcase_04 AC 77 ms
71,112 KB
testcase_05 AC 73 ms
71,444 KB
testcase_06 AC 73 ms
71,472 KB
testcase_07 AC 74 ms
71,252 KB
testcase_08 AC 74 ms
71,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
0