結果

問題 No.602 隠されていたゲーム2
ユーザー maimai
提出日時 2017-12-02 00:53:16
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 242 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 19,200 KB
最終ジャッジ日時 2024-05-06 00:28:25
合計ジャッジ時間 4,251 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 100 ms
12,160 KB
testcase_02 AC 102 ms
11,904 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 95 ms
12,160 KB
testcase_07 AC 95 ms
12,032 KB
testcase_08 AC 98 ms
12,160 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 94 ms
12,032 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 137 ms
19,072 KB
testcase_23 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:20: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Syntax OK

ソースコード

diff #

gets
d = gets.split.map(&:to_i)
x1,y1 = gets.split.map(&:to_i)
z = [x1+y1,x1-y1].map(&:abs).max

if z==0
    p 0;exit
end

if d.include?(z)
    p 1;exit
end


dmax = d.max

if (((z+dmax-1)/dmax) <= 2)
    p ((z+dmax-1)/dmax)
else
    p -1
end
0