結果

問題 No.683 Two Operations No.3
ユーザー maimai
提出日時 2018-05-11 22:45:54
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 299 bytes
コンパイル時間 426 ms
コンパイル使用メモリ 11,384 KB
実行使用メモリ 15,344 KB
最終ジャッジ日時 2023-09-10 17:40:53
合計ジャッジ時間 3,065 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,232 KB
testcase_01 WA -
testcase_02 AC 78 ms
15,236 KB
testcase_03 AC 78 ms
15,236 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 78 ms
15,028 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 78 ms
15,228 KB
testcase_11 AC 78 ms
15,124 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 77 ms
15,136 KB
testcase_15 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 > 0 && a.even? && check(a/2,b-1)
    return true if b > 0 && b.even? && check(a-1,b/2)
    return false
end

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