結果

問題 No.467 隠されていたゲーム
ユーザー zazaboonzazaboon
提出日時 2017-02-03 21:02:51
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 284 bytes
コンパイル時間 56 ms
コンパイル使用メモリ 11,344 KB
実行使用メモリ 15,380 KB
最終ジャッジ日時 2023-08-25 18:28:40
合計ジャッジ時間 3,395 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
15,336 KB
testcase_01 AC 68 ms
15,032 KB
testcase_02 AC 70 ms
15,224 KB
testcase_03 AC 74 ms
15,380 KB
testcase_04 AC 70 ms
15,156 KB
testcase_05 AC 76 ms
15,052 KB
testcase_06 AC 76 ms
15,056 KB
testcase_07 WA -
testcase_08 AC 70 ms
15,316 KB
testcase_09 WA -
testcase_10 AC 67 ms
15,272 KB
testcase_11 AC 73 ms
15,140 KB
testcase_12 AC 71 ms
15,064 KB
testcase_13 AC 71 ms
15,136 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 71 ms
15,116 KB
testcase_18 AC 70 ms
15,112 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 68 ms
15,236 KB
testcase_23 AC 72 ms
15,140 KB
testcase_24 AC 71 ms
15,104 KB
testcase_25 AC 69 ms
15,312 KB
testcase_26 AC 67 ms
15,232 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

n = gets.chomp.to_i
d = gets.chomp.split(" ").map(&:to_i)
x,y = gets.chomp.split(" ").map(&:to_i)
dmax = d.max
kmax = [x,y].max
a = kmax / dmax 
sa = kmax - a * dmax
if sa == kmax
    puts (d.include?(sa))? 1 : 2
elsif sa == 0
    puts a 
else
    puts (d.include?(sa))? a : a + 1
end
0