結果

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int T; cin >> T;
    while(T--){
        long long N; cin >> N;
        long long X = 0,Y = 0;
        for(int i=59; i>=0; i--) if(N&(1LL<<i)){
            if(X == 0) X = 1LL<<i;
            else Y += 1LL<<i;
        }
        cout << X << " " << Y << "\n";
    }
}
0