結果

問題 No.909 たぴの配置
ユーザー qsako6qsako6
提出日時 2019-11-09 01:41:05
言語 Ruby
(3.2.1 )
結果
AC  
実行時間 389 ms / 3,000 ms
コード長 221 bytes
コンパイル時間 550 ms
コンパイル使用メモリ 11,328 KB
実行使用メモリ 44,784 KB
最終ジャッジ日時 2023-07-13 17:27:00
合計ジャッジ時間 8,011 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,272 KB
testcase_01 AC 80 ms
15,264 KB
testcase_02 AC 83 ms
15,060 KB
testcase_03 AC 80 ms
15,060 KB
testcase_04 AC 80 ms
15,016 KB
testcase_05 AC 372 ms
44,540 KB
testcase_06 AC 384 ms
44,784 KB
testcase_07 AC 357 ms
43,656 KB
testcase_08 AC 380 ms
44,436 KB
testcase_09 AC 389 ms
44,596 KB
testcase_10 AC 361 ms
43,784 KB
testcase_11 AC 355 ms
43,796 KB
testcase_12 AC 375 ms
44,212 KB
testcase_13 AC 378 ms
44,644 KB
testcase_14 AC 363 ms
44,036 KB
testcase_15 AC 363 ms
43,784 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