結果

問題 No.1511 A ? B Problem
ユーザー Cecil
提出日時 2023-01-12 20:15:03
言語 Java
(openjdk 23)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 2,034 ms
コンパイル使用メモリ 74,244 KB
実行使用メモリ 41,568 KB
最終ジャッジ日時 2024-12-23 13:19:58
合計ジャッジ時間 4,915 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

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