結果

問題 No.683 Two Operations No.3
ユーザー matsuyoshi30matsuyoshi30
提出日時 2018-05-11 23:13:03
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 853 bytes
コンパイル時間 4,110 ms
コンパイル使用メモリ 71,776 KB
実行使用メモリ 57,640 KB
最終ジャッジ日時 2023-09-10 17:49:03
合計ジャッジ時間 7,054 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 128 ms
55,872 KB
testcase_02 AC 134 ms
55,552 KB
testcase_03 AC 129 ms
55,896 KB
testcase_04 AC 132 ms
55,928 KB
testcase_05 WA -
testcase_06 AC 127 ms
55,848 KB
testcase_07 WA -
testcase_08 AC 130 ms
55,692 KB
testcase_09 AC 129 ms
55,596 KB
testcase_10 AC 129 ms
55,632 KB
testcase_11 WA -
testcase_12 AC 128 ms
55,708 KB
testcase_13 AC 127 ms
55,688 KB
testcase_14 AC 128 ms
55,444 KB
testcase_15 AC 126 ms
55,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Long a = in.nextLong();
        Long b = in.nextLong();

        String ans = "Yes";

        if(a == 0 && b == 0) {

        } else if(a == b && a != 4 && b != 4) {
            ans = "No";
        } else if(a % 2 != 0 && b % 2 != 0) {
            ans = "No";
        } else if(a % 2 == 0 && b % 2 == 0) {
            if(a > b && b != 0) {
                if((a/b)%2 != 0) ans = "No";
            } else if(b > a && a != 0) {
                if((b/a)%2 != 0) ans = "No";
            }
        } else {
            if(a % 2 == 0 && b % 2 != 0)
                if((a-b) == 1) ans = "No";
            if(b % 2 == 0 && a % 2 != 0)
                if((b-a) == 1) ans = "No";
        }

        System.out.println(ans);
    }
}
0