結果
| 問題 | No.1298 OR XOR | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-11-27 21:25:02 | 
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                            (最新) 
                                CE
                                 
                            (最初) | 
| 実行時間 | - | 
| コード長 | 658 bytes | 
| コンパイル時間 | 2,546 ms | 
| コンパイル使用メモリ | 117,980 KB | 
| 最終ジャッジ日時 | 2025-01-16 06:22:45 | 
| ジャッジサーバーID (参考情報) | judge3 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 5 WA * 8 | 
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>
static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;
template<class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;
int main() {
    int n;
    cin >> n;
    if(__builtin_popcount(n) == 1) puts("-1 -1 -1");
    else {
        int a = -1, b = -1;
        for (int i = 0; i <= 30; ++i) {
            if(n & (1 << i)){
                if(a == -1) a = i;
                else b = i;
            }
        }
        printf("%d %d %d\n", n, n^(1 << a), n^(1 << b));
    }
    return 0;
}
            
            
            
        