結果

問題 No.633 バスの運賃
ユーザー kept1994kept1994
提出日時 2021-09-01 01:46:24
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 86,696 KB
実行使用メモリ 71,316 KB
最終ジャッジ日時 2023-08-17 16:50:05
合計ジャッジ時間 2,177 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,088 KB
testcase_01 AC 74 ms
71,316 KB
testcase_02 AC 73 ms
71,276 KB
testcase_03 AC 76 ms
70,964 KB
testcase_04 AC 77 ms
71,224 KB
testcase_05 AC 76 ms
71,128 KB
testcase_06 AC 75 ms
70,940 KB
testcase_07 AC 76 ms
71,248 KB
testcase_08 AC 75 ms
71,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys

def main():
    N = int(input())
    A = [int(input()) for _ in range(N - 1)]
    num = 0
    ans = 0
    for i in range(N):
        B, C = map(int,input().split())
        num += C - B
        if i == N - 1:
            break
        ans += A[i] * num
    print(ans)
    return
   
        
if __name__ == '__main__':
    main()
0