結果

問題 No.2533 A⇒B問題
ユーザー kusagame12kusagame12
提出日時 2024-03-04 18:35:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 545 bytes
コンパイル時間 6,779 ms
コンパイル使用メモリ 79,972 KB
実行使用メモリ 57,840 KB
最終ジャッジ日時 2024-03-04 18:35:56
合計ジャッジ時間 6,261 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
56,680 KB
testcase_01 AC 124 ms
57,692 KB
testcase_02 AC 122 ms
57,572 KB
testcase_03 AC 122 ms
57,828 KB
testcase_04 AC 122 ms
57,700 KB
testcase_05 AC 121 ms
57,568 KB
testcase_06 AC 122 ms
57,824 KB
testcase_07 AC 112 ms
56,676 KB
testcase_08 AC 121 ms
57,568 KB
testcase_09 AC 122 ms
57,564 KB
testcase_10 AC 120 ms
57,812 KB
testcase_11 AC 112 ms
56,676 KB
testcase_12 AC 121 ms
57,672 KB
testcase_13 AC 120 ms
57,712 KB
testcase_14 AC 111 ms
56,672 KB
testcase_15 AC 121 ms
57,572 KB
testcase_16 AC 113 ms
56,680 KB
testcase_17 AC 122 ms
57,840 KB
testcase_18 AC 122 ms
57,700 KB
testcase_19 AC 122 ms
57,704 KB
testcase_20 AC 136 ms
56,672 KB
testcase_21 AC 113 ms
56,660 KB
testcase_22 AC 120 ms
57,700 KB
testcase_23 AC 123 ms
57,604 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();
       
        while(a > 0 || b > 0){
            
            if(a % 2 == 1 && b % 2 != 1){
                System.out.println("No");
                return;
            }
         
            a = a / 2;
            b = b / 2;
            
        }
       
        System.out.println("Yes");
        
    }
   
}
0