結果
| 問題 | No.1298 OR XOR | 
| コンテスト | |
| ユーザー |  yamake | 
| 提出日時 | 2020-11-27 21:25:39 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 841 bytes | 
| コンパイル時間 | 684 ms | 
| コンパイル使用メモリ | 75,944 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-23 21:57:49 | 
| 合計ジャッジ時間 | 1,314 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 13 | 
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<cstdio>
#include<cmath>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define ALL(x) x.begin(),x.end()
#define debug(output) cout<<#output<<"= "<<output<<endl
using lint=long long;
int MOD=1000000007;
signed main(){
    int n;cin>>n;
    int a,b,c;
    if(__builtin_popcount(n)==1){
        a=-1;b=-1;c=-1;
    }
    else{
        a=n;
        b=n;
        c=n;
        bool flag=true;
        rep(i,31){
            if(n&(1<<i)){
                if(flag){
                    b-=(1<<i);
                    flag=false;
                }
                else{
                    c-=(1<<i);
                }
            }
        }
    }
    cout<<a<<" "<<b<<" "<<c<<endl;
    return 0;
}
            
            
            
        