結果

問題 No.531 エヌスクミ島の平和協定
ユーザー maimai
提出日時 2017-06-23 22:44:56
言語 Ruby
(3.4.1)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 145 bytes
コンパイル時間 51 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-09-19 16:19:06
合計ジャッジ時間 4,073 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 37
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:11: warning: ambiguous first argument; put parentheses or a space even after `-' operator
Syntax OK

ソースコード

diff #

def ascan; gets.split.map(&:to_i); end
def scan; gets.to_i; end

n,m = ascan

if n<=m
    p 1
elsif n.even? && n/2 <= m
    p 2
else
    p -1
end
0