結果

問題 No.1298 OR XOR
ユーザー キョウチクキョウチク
提出日時 2022-05-15 10:05:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 165 ms / 2,000 ms
コード長 482 bytes
コンパイル時間 5,576 ms
コンパイル使用メモリ 73,732 KB
実行使用メモリ 57,088 KB
最終ジャッジ日時 2023-10-01 04:46:42
合計ジャッジ時間 8,864 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 164 ms
56,800 KB
testcase_01 AC 122 ms
55,728 KB
testcase_02 AC 123 ms
55,932 KB
testcase_03 AC 125 ms
55,592 KB
testcase_04 AC 123 ms
55,780 KB
testcase_05 AC 123 ms
55,812 KB
testcase_06 AC 162 ms
56,816 KB
testcase_07 AC 161 ms
56,708 KB
testcase_08 AC 163 ms
56,932 KB
testcase_09 AC 163 ms
56,932 KB
testcase_10 AC 165 ms
56,916 KB
testcase_11 AC 163 ms
57,088 KB
testcase_12 AC 162 ms
56,956 KB
testcase_13 AC 164 ms
57,068 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Test10 {
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    String line;
    line=sc.nextLine();
    int c=Integer.parseInt(line);
    int n=1;
    for(int i=1;i<=c/2;i*=2){
      n++;
    }
    int a=(int)Math.pow(2,n-1);
    int b=c%a;
    //System.out.println((b|c)+","+(a^b^c));
    if(b==0){
      System.out.println("-1 -1 -1");
    }else{
      System.out.println(a+" "+b+" "+c);
    }
    sc.close();
  }
}
0