結果

問題 No.683 Two Operations No.3
ユーザー maimai
提出日時 2018-05-11 22:46:19
言語 Ruby
(3.3.0)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 298 bytes
コンパイル時間 244 ms
コンパイル使用メモリ 11,360 KB
実行使用メモリ 15,316 KB
最終ジャッジ日時 2023-09-10 18:43:58
合計ジャッジ時間 2,241 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,180 KB
testcase_01 AC 78 ms
15,316 KB
testcase_02 AC 77 ms
15,012 KB
testcase_03 AC 77 ms
15,016 KB
testcase_04 AC 77 ms
15,228 KB
testcase_05 AC 78 ms
15,124 KB
testcase_06 AC 77 ms
15,016 KB
testcase_07 AC 78 ms
15,292 KB
testcase_08 AC 78 ms
15,044 KB
testcase_09 AC 78 ms
15,184 KB
testcase_10 AC 79 ms
15,276 KB
testcase_11 AC 79 ms
15,256 KB
testcase_12 AC 78 ms
15,264 KB
testcase_13 AC 78 ms
15,016 KB
testcase_14 AC 78 ms
15,040 KB
testcase_15 AC 80 ms
15,108 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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