結果

問題 No.633 バスの運賃
ユーザー cielciel
提出日時 2018-01-21 22:22:53
言語 Ruby
(3.3.0)
結果
AC  
実行時間 75 ms / 2,000 ms
コード長 114 bytes
コンパイル時間 58 ms
コンパイル使用メモリ 11,264 KB
実行使用メモリ 15,300 KB
最終ジャッジ日時 2023-08-26 20:07:19
合計ジャッジ時間 1,393 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
15,216 KB
testcase_01 AC 71 ms
15,300 KB
testcase_02 AC 72 ms
15,184 KB
testcase_03 AC 70 ms
15,148 KB
testcase_04 AC 69 ms
15,108 KB
testcase_05 AC 69 ms
15,108 KB
testcase_06 AC 70 ms
15,044 KB
testcase_07 AC 71 ms
15,292 KB
testcase_08 AC 75 ms
15,056 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

r=k=0
n=gets.to_i
a=(n-1).times.map{gets.to_i}
(n-1).times{|i|
	b,c=gets.split.map &:to_i
	k+=c-b
	r+=k*a[i]
}
p r
0