結果

問題 No.1298 OR XOR
ユーザー xRS43BofaUEZ5gcxRS43BofaUEZ5gc
提出日時 2021-03-08 10:33:03
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 475 bytes
コンパイル時間 4,951 ms
コンパイル使用メモリ 76,368 KB
実行使用メモリ 57,292 KB
最終ジャッジ日時 2024-04-18 01:57:26
合計ジャッジ時間 9,371 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class HelloWorld {

	    public static void main(String[] args) throws Exception {

	    	Scanner sc = new Scanner(System.in);
	    	int n = sc.nextInt();
	    	if (n < 3) {
	    		System.out.println("(-1,-1,-1)");
	    	}

	    	int a = n;
	    	int b = -n & n;
	    	int c = n ^ b;

	    	if (a >0 && b > 0 && c >0) {
	    		System.out.println(a + "," + b + "," + c);
	    	}else {
	    	System.out.println("(-1,-1,-1)");}

	    	}

	    }
0