結果

問題 No.3088 XOR = SUM
ユーザー SnowBeenDiding
提出日時 2025-04-04 21:55:26
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 652 bytes
コンパイル時間 5,650 ms
コンパイル使用メモリ 331,920 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-04-04 21:55:52
合計ジャッジ時間 14,013 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 1 WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <atcoder/all>
#include <bits/stdc++.h>
#define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
using namespace atcoder;
using namespace std;

typedef long long ll;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t;
    cin >> t;
    while (t--) {
        ll n;
        cin >> n;
        if (n == 0) {
            cout << "0 0\n";
            continue;
        }
        ll a = 0, b = 0;
        int p = 0;
        int bi = 63;
        rep(i, 0, 61) {
            if (n & (1LL << i)) {
                p = i;
            }
        }
        ll m = 1LL << p;
        cout << m << ' ' << (n ^ m) << '\n';
    }
}
0