結果

問題 No.1298 OR XOR
ユーザー oooooba
提出日時 2021-07-05 21:16:12
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 608 bytes
コンパイル時間 1,234 ms
コンパイル使用メモリ 112,800 KB
最終ジャッジ日時 2025-01-22 17:46:02
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <optional>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

int main() {
    int32_t n;
    cin >> n;
    int32_t c = 0, t = n;
    while ((t & 0b1) == 0) {
        t >>= 1;
        ++c;
    }
    if (t == 1) {
        cout << "-1 -1 -1" << endl;
        return 0;
    }
    cout << n << " " << (1 << c) << " " << ((t >> 1) << (c + 1)) << endl;
    return 0;
}
0