結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,296 KB
testcase_01 AC 78 ms
15,328 KB
testcase_02 AC 77 ms
15,056 KB
testcase_03 AC 78 ms
15,304 KB
testcase_04 AC 78 ms
15,188 KB
testcase_05 AC 77 ms
15,260 KB
testcase_06 AC 81 ms
15,256 KB
testcase_07 AC 76 ms
15,168 KB
testcase_08 AC 77 ms
15,296 KB
testcase_09 WA -
testcase_10 AC 78 ms
15,056 KB
testcase_11 AC 77 ms
15,280 KB
testcase_12 AC 77 ms
15,052 KB
testcase_13 AC 76 ms
15,256 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 78 ms
15,056 KB
testcase_18 AC 77 ms
15,052 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 78 ms
15,164 KB
testcase_23 AC 78 ms
15,052 KB
testcase_24 AC 78 ms
15,276 KB
testcase_25 AC 77 ms
15,300 KB
testcase_26 AC 78 ms
15,052 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 a+1
end
0