結果

問題 No.2533 A⇒B問題
ユーザー kusagame12kusagame12
提出日時 2024-03-04 18:26:35
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 650 bytes
コンパイル時間 1,964 ms
コンパイル使用メモリ 75,532 KB
実行使用メモリ 57,956 KB
最終ジャッジ日時 2024-03-04 18:26:43
合計ジャッジ時間 6,308 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
57,956 KB
testcase_01 AC 119 ms
57,780 KB
testcase_02 AC 136 ms
57,700 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 149 ms
57,668 KB
testcase_07 AC 120 ms
57,816 KB
testcase_08 AC 120 ms
57,592 KB
testcase_09 AC 121 ms
57,564 KB
testcase_10 AC 124 ms
57,568 KB
testcase_11 AC 125 ms
57,588 KB
testcase_12 AC 123 ms
57,568 KB
testcase_13 AC 123 ms
57,936 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 123 ms
57,688 KB
testcase_17 WA -
testcase_18 AC 122 ms
57,696 KB
testcase_19 AC 123 ms
57,584 KB
testcase_20 WA -
testcase_21 AC 121 ms
57,696 KB
testcase_22 AC 139 ms
57,696 KB
testcase_23 AC 124 ms
57,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
       
        Scanner sc = new Scanner(System.in);
        
        long a = sc.nextLong();
        long b = sc.nextLong();
       
        long bigger = Math.max(a,b);
        long smaller = Math.min(a,b);
       
        while(bigger > 0){
            
            bigger = bigger / 2;
            smaller = smaller / 2;
            
            if(bigger % 2 != smaller % 2){
                System.out.println("No");
                return;
            }
            
        }
       
        System.out.println("Yes");
        
    }
   
}
0