結果

問題 No.683 Two Operations No.3
ユーザー maimai
提出日時 2018-05-11 22:37:27
言語 Ruby
(3.3.0)
結果
RE  
実行時間 -
コード長 280 bytes
コンパイル時間 508 ms
コンパイル使用メモリ 11,240 KB
実行使用メモリ 18,288 KB
最終ジャッジ日時 2023-09-10 17:36:28
合計ジャッジ時間 2,826 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,080 KB
testcase_01 AC 80 ms
15,308 KB
testcase_02 AC 80 ms
15,256 KB
testcase_03 AC 82 ms
15,164 KB
testcase_04 AC 82 ms
15,080 KB
testcase_05 AC 82 ms
15,092 KB
testcase_06 RE -
testcase_07 AC 81 ms
15,152 KB
testcase_08 RE -
testcase_09 AC 80 ms
15,276 KB
testcase_10 AC 80 ms
15,080 KB
testcase_11 AC 81 ms
15,288 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 AC 83 ms
15,240 KB
testcase_15 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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