結果

問題 No.8057 A xor B = C
ユーザー yasunori
提出日時 2025-02-19 23:46:26
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 521 bytes
コンパイル時間 10,704 ms
コンパイル使用メモリ 466,412 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-02-19 23:46:37
合計ジャッジ時間 9,714 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using bigint = boost::multiprecision::cpp_int;

template <typename T> using min_priority_queue = priority_queue<T,vector<T>,greater<T>>;

random_device seed_gen;
mt19937 engine(seed_gen());

bigint x(bigint a, bigint b) {
    if(a == 0) return b;
    if(b == 0) return a;
    if(a == b) return 0;

    return x(a / 2, b / 2) * 2 + x(a % 2, b % 2);
}

int main() {
    bigint a, b;
    cin >> a >> b;
    cout << x(a, b) << endl;
}
0