結果

問題 No.3088 XOR = SUM
ユーザー mono
提出日時 2025-04-04 21:27:57
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,209 bytes
コンパイル時間 5,147 ms
コンパイル使用メモリ 307,448 KB
実行使用メモリ 7,328 KB
最終ジャッジ日時 2025-04-04 21:28:49
合計ジャッジ時間 19,678 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize ("O3,inline,omit-frame-pointer,no-asynchronous-unwind-tables,fast-math")
#include <bits/stdc++.h>
#include <unordered_map>
#include <stdlib.h>
using namespace std;
#define rep(i, a, n) for(ll i = a; i < n; i++)
#define rrep(i, a, n) for(ll i = a; i >= n; i--)
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
//constexpr ll MOD = 1000000007;
constexpr ll MOD = 998244353;
constexpr int IINF = 1001001001;
constexpr ll INF = 1LL<<60;
template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}
 


int main() {
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    ll t; cin >> t;
    while(t--){
        ll n; cin >> n;
        ll x = 0, y = 0;
        ll flg = 0;
        ll flg2 = 0;
        rrep(i,60,0){
            if((n>>i)&1){
                if(flg) y += 1LL << i;
                else{
                    x += 1LL << i;
                    flg = true;
                }
            }else{
                if(flg){
                    x += 1LL << i;
                    y += 1LL << i;
                }
            }
        }
        cout << x << " " << y << endl;
    }
    return 0;
}
0