結果
| 問題 | No.1298 OR XOR | 
| コンテスト | |
| ユーザー |  ocvret_ | 
| 提出日時 | 2020-11-27 21:45:31 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 548 bytes | 
| コンパイル時間 | 1,528 ms | 
| コンパイル使用メモリ | 166,636 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-26 12:08:14 | 
| 合計ジャッジ時間 | 2,241 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 13 | 
ソースコード
#include<bits/stdc++.h>
// #include<atcoder/all>
using namespace std;
// using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007
int main(){
  
  int n;
  cin >> n;
  int cnt = 0,last = 0;
  rep(i,31)if(n >> i & 1)cnt++,last = i;
  if(cnt == 1){
    cout << "-1 -1 -1\n";
    return 0;
  }
  cout << n << " ";
  cout << (1 << last) << " ";
  cout << ((1 << last) ^ n) << "\n";
  return 0;
}
            
            
            
        