結果

問題 No.1298 OR XOR
ユーザー ate
提出日時 2020-12-10 08:31:32
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 287 bytes
コンパイル時間 730 ms
コンパイル使用メモリ 66,544 KB
最終ジャッジ日時 2025-01-16 21:14:49
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
int main(){
    int64_t n;
    std::cin>>n;
    int64_t a=n,b=n,c=0;
    for(int i=0;i<=30;++i)if((n>>i)&1){
        b -= 1<<i;
        c |= 1<<i;
        break;
    }
    if(b and c)std::cout<<a<<" "<<b<<" "<<c<<std::endl;
    else std::cout<<"-1 -1 -1"<<std::endl;
}
0