結果

問題 No.467 隠されていたゲーム
ユーザー fine
提出日時 2016-12-20 00:26:22
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 193 bytes
コンパイル時間 558 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-12-14 09:03:19
合計ジャッジ時間 3,518 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 21 WA * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

n=gets.to_i
d=gets.split.map(&:to_i)
dmax = d.max
x=gets.split.map(&:to_i).map(&:abs).max
ans = x / (2 * dmax) * 2
x %= 2 * dmax
if d.include?(x)
    ans += 1
elsif x > 0
    ans += 2
end
p ans
0