結果

問題 No.1298 OR XOR
ユーザー 蜜蜂
提出日時 2020-11-27 21:32:35
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 428 bytes
コンパイル時間 1,977 ms
コンパイル使用メモリ 167,848 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-23 22:16:04
合計ジャッジ時間 2,449 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
#define fi first
#define se second

int main(){
  ll x;
  cin>>x;
  ll pow2[40];
  pow2[0]=1;
  for(int i=1;i<40;i++){
    pow2[i]=pow2[i-1]*2;
    if(pow2[i-1]==x){
      cout<<"-1 -1 -1"<<endl;
      return 0;
    }
  }
  for(int i=0;i<40;i++){
    if(x&(1<<i)){
      ll a=pow2[i],b=x-a,c=x;
      cout<<a<<" "<<b<<" "<<c<<endl;
      return 0;
    }
  }
}
0