結果

問題 No.633 バスの運賃
ユーザー daleksprinterdaleksprinter
提出日時 2018-08-10 16:31:11
言語 Python2
(2.7.18)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 326 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 7,120 KB
実行使用メモリ 6,436 KB
最終ジャッジ日時 2023-10-24 13:23:46
合計ジャッジ時間 939 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
6,428 KB
testcase_01 AC 10 ms
6,428 KB
testcase_02 AC 10 ms
6,428 KB
testcase_03 AC 10 ms
6,428 KB
testcase_04 AC 11 ms
6,436 KB
testcase_05 AC 10 ms
6,428 KB
testcase_06 AC 10 ms
6,428 KB
testcase_07 AC 10 ms
6,428 KB
testcase_08 AC 10 ms
6,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

fee = []
for i in range(n-1):
	fee.append(int(input()))

imos = [0] * (n-1)

for i in range(n-1):
	out,get = map(int,raw_input().split())
	imos[i] += get
	imos[i] -= out

raw_input()

for i in range(1,n-1):
	imos[i] = imos[i-1] + imos[i]

ans = 0
for i in range(n-1):
	ans += fee[i] * imos[i]

print ans




0