結果

問題 No.683 Two Operations No.3
ユーザー mai
提出日時 2018-05-11 22:37:27
言語 Ruby
(3.4.1)
結果
RE  
実行時間 -
コード長 280 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 15,104 KB
最終ジャッジ日時 2024-06-28 08:45:11
合計ジャッジ時間 2,920 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11 RE * 5
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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

A,B = ascan

def check(a,b)
    return true if a == 0 && b == 0
    return false if a < 0 || b < 0
    return true if a.even? && check(a/2,b-1)
    return true if b.even? && check(a-1,b/2)
    return false
end

puts check(A,B) ? "Yes" : "No"
0