結果

問題 No.1511 A ? B Problem
ユーザー CecilCecil
提出日時 2023-01-12 20:15:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 1,924 ms
コンパイル使用メモリ 71,784 KB
実行使用メモリ 56,564 KB
最終ジャッジ日時 2023-08-25 01:34:10
合計ジャッジ時間 5,452 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
55,852 KB
testcase_01 AC 109 ms
55,844 KB
testcase_02 AC 107 ms
54,280 KB
testcase_03 AC 112 ms
56,240 KB
testcase_04 AC 112 ms
56,084 KB
testcase_05 AC 105 ms
56,352 KB
testcase_06 AC 105 ms
55,956 KB
testcase_07 AC 106 ms
55,888 KB
testcase_08 AC 107 ms
56,256 KB
testcase_09 AC 106 ms
56,564 KB
testcase_10 AC 110 ms
56,308 KB
testcase_11 AC 108 ms
55,732 KB
testcase_12 AC 109 ms
55,532 KB
testcase_13 AC 111 ms
56,152 KB
testcase_14 AC 112 ms
56,060 KB
testcase_15 AC 109 ms
55,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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

		int a = scan.hasNextInt() ? scan.nextInt() : -1;
		int b = scan.hasNextInt() ? scan.nextInt() : -1;
		if (a > 1000 || a < 0 || b > 1000 || b < 1) {
			System.out.println("入力エラー");
			return;
		}

		int ans = (a | b) - (a & b);

		// 結果出力
		System.out.println(ans);

	}
}
0