結果

問題 No.1298 OR XOR
ユーザー キョウチク
提出日時 2022-05-15 09:48:32
言語 Java
(openjdk 23)
結果
TLE  
実行時間 -
コード長 464 bytes
コンパイル時間 5,090 ms
コンパイル使用メモリ 84,032 KB
実行使用メモリ 61,796 KB
最終ジャッジ日時 2024-07-23 21:50:58
合計ジャッジ時間 9,706 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 4 TLE * 1 -- * 8
権限があれば一括ダウンロードができます

ソースコード

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=0;
    for(int i=1;i<=c;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);
    }
  }
}
0