結果

問題 No.909 たぴの配置
ユーザー qsako6qsako6
提出日時 2019-11-09 01:41:05
言語 Ruby
(3.3.0)
結果
AC  
実行時間 353 ms / 3,000 ms
コード長 221 bytes
コンパイル時間 367 ms
コンパイル使用メモリ 11,300 KB
実行使用メモリ 44,780 KB
最終ジャッジ日時 2023-10-13 06:30:48
合計ジャッジ時間 7,687 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
15,364 KB
testcase_01 AC 70 ms
15,144 KB
testcase_02 AC 71 ms
15,272 KB
testcase_03 AC 71 ms
15,272 KB
testcase_04 AC 74 ms
15,308 KB
testcase_05 AC 353 ms
44,224 KB
testcase_06 AC 341 ms
44,720 KB
testcase_07 AC 322 ms
44,064 KB
testcase_08 AC 347 ms
44,540 KB
testcase_09 AC 345 ms
44,780 KB
testcase_10 AC 331 ms
43,860 KB
testcase_11 AC 328 ms
43,792 KB
testcase_12 AC 332 ms
44,280 KB
testcase_13 AC 341 ms
44,632 KB
testcase_14 AC 321 ms
44,032 KB
testcase_15 AC 324 ms
43,844 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i
x = gets.split.map(&:to_i)
y = gets.split.map(&:to_i)
d = Float::INFINITY
n.times do |i|
  d = [d, x[i] + y[i]].min
end

pos = [0]
n.times do |i|
  pos << (d <= x[i] ? d : x[i])
end
pos << d
puts d
puts pos
0