結果
| 問題 | No.1298 OR XOR | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-11-30 12:33:44 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 385 bytes | 
| コンパイル時間 | 635 ms | 
| コンパイル使用メモリ | 67,528 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-09-13 02:20:24 | 
| 合計ジャッジ時間 | 1,341 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 13 | 
ソースコード
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int lsb(int x){
    return x & (~(x-1));
}
int main()
{
    
    int n;
    cin >> n;
    int x = lsb(n);
    int a = n, b = n, c = x;
    b = b & (~c);
    if(a == 0 || b == 0 || c == 0 ){
        cout << "-1 -1 -1 "<<endl;
    }else{
        cout << a << " "<< b << " "<< c <<endl;
    }
    return 0;
}
            
            
            
        