結果
| 問題 | No.1298 OR XOR | 
| コンテスト | |
| ユーザー | 👑 | 
| 提出日時 | 2021-12-02 15:04:11 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 3 ms / 2,000 ms | 
| コード長 | 348 bytes | 
| コンパイル時間 | 464 ms | 
| コンパイル使用メモリ | 64,252 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-07-05 01:55:41 | 
| 合計ジャッジ時間 | 1,536 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 13 | 
ソースコード
#include <iostream>
using namespace std;
int main(){
    int n;cin>>n;
    if(__builtin_popcount(n) == 1){
        cout << "-1 -1 -1" << endl;
    }else{
        int tmp = n;
        int x = 1;
        while(tmp%2==0){
            tmp/= 2;
            x*=2;
        }
        tmp/=2;
        cout << n << " " << tmp*2*x << " " << x << endl;
    }
}
            
            
            
        