結果
| 問題 |
No.467 隠されていたゲーム
|
| コンテスト | |
| ユーザー |
suppy193
|
| 提出日時 | 2017-01-11 12:50:52 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 100 ms / 2,000 ms |
| コード長 | 373 bytes |
| コンパイル時間 | 122 ms |
| コンパイル使用メモリ | 7,296 KB |
| 実行使用メモリ | 12,160 KB |
| 最終ジャッジ日時 | 2024-10-04 16:25:44 |
| 合計ジャッジ時間 | 3,843 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n Syntax OK
ソースコード
n = gets.to_i
cheby = gets.strip.split(' ').map(&:to_i)
#p @cheby
goal = gets.strip.split(' ').map(&:to_i).map(&:abs)
#p @goal
if goal == [0, 0]
puts "0"
exit
end
goal_max = goal.max
cheby_max = cheby.max
if cheby.include?(goal_max)
puts "1"
exit
end
if goal_max < cheby_max
puts (goal.max.to_f / cheby.max).ceil + 1
else
puts (goal.max.to_f / cheby.max).ceil
end
suppy193