結果

問題 No.909 たぴの配置
ユーザー qsako6qsako6
提出日時 2019-11-08 23:43:27
言語 Ruby
(3.3.0)
結果
AC  
実行時間 416 ms / 3,000 ms
コード長 264 bytes
コンパイル時間 58 ms
コンパイル使用メモリ 11,236 KB
実行使用メモリ 44,908 KB
最終ジャッジ日時 2023-10-13 05:27:08
合計ジャッジ時間 7,717 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,148 KB
testcase_01 AC 82 ms
15,144 KB
testcase_02 AC 82 ms
15,300 KB
testcase_03 AC 82 ms
15,160 KB
testcase_04 AC 80 ms
15,292 KB
testcase_05 AC 401 ms
44,500 KB
testcase_06 AC 410 ms
44,908 KB
testcase_07 AC 381 ms
44,020 KB
testcase_08 AC 404 ms
44,532 KB
testcase_09 AC 416 ms
44,724 KB
testcase_10 AC 383 ms
43,880 KB
testcase_11 AC 385 ms
43,876 KB
testcase_12 AC 405 ms
44,436 KB
testcase_13 AC 416 ms
44,656 KB
testcase_14 AC 382 ms
43,868 KB
testcase_15 AC 385 ms
43,880 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 << (x[i] < y[i] ? x[i] : d - y[i])
end
pos << d
pos.map! { |pi| pi + 1000000000 }
puts d
puts pos
0