結果

問題 No.633 バスの運賃
ユーザー Akijin_007Akijin_007
提出日時 2023-07-27 20:09:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 256 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 82,428 KB
実行使用メモリ 53,164 KB
最終ジャッジ日時 2024-04-15 06:54:49
合計ジャッジ時間 1,209 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,444 KB
testcase_01 AC 39 ms
52,376 KB
testcase_02 AC 39 ms
52,792 KB
testcase_03 AC 39 ms
52,704 KB
testcase_04 AC 41 ms
52,764 KB
testcase_05 AC 39 ms
53,164 KB
testcase_06 AC 39 ms
52,564 KB
testcase_07 AC 39 ms
52,264 KB
testcase_08 AC 39 ms
52,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

a = [0] *(N-1)
for i in range(N-1):
    a[i] = int(input())

b = [0] * N
for i in range(N):
    b[i] = list(map(int, input().split()))

ans = 0
p = 0
for i in range(N-1):
    p += b[i][1]
    ans += p * a[i]
    p -= b[i+1][0]

print(ans)
0