結果

問題 No.3088 XOR = SUM
コンテスト
ユーザー akiponggg0119
提出日時 2026-11-06 01:03:43
言語 C++23(gcc16)
(gcc 16.2.0 + boost 1.92.0 + ACL)
コンパイル:
g++-16 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc16.so -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 1,147 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 5,815 ms
コンパイル使用メモリ 351,608 KB
実行使用メモリ 9,920 KB
最終ジャッジ日時 2026-11-06 01:04:18
合計ジャッジ時間 29,818 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge7_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
const ll INF = LLONG_MAX / 4;
bool chmin(auto& a, const auto& b) { return a > b ? a = b, 1 : 0; }
bool chmax(auto& a, const auto& b) { return a < b ? a = b, 1 : 0; }
auto sz(const auto& a) { return ssize(a); }
#define P 998244353
#define OVERLOAD_REP(a, b, c, d, name, ...) name
#define rep(...) OVERLOAD_REP(__VA_ARGS__, REP3, REP2, REP1, REP0)(__VA_ARGS__)
#define REP0(x) for (ll _rep_counter = 0; _rep_counter < (x); ++_rep_counter)
#define REP1(i, x) for (ll i = 0; (i) < (x); ++(i))
#define REP2(i, l, r) for (ll i = (l); (i) < (r); ++(i))
#define REP3(i, l, r, c) for (ll i = (l); ((c) > 0 ? (i) < (r) : (i) > (r)); i += (c))
#define each(x,a) for (auto&& x : a)

void solve() {
	ll t; cin >> t;
	rep(t) {
		ll n; cin >> n;
	    int digits = (n == 0) ? 1 : (sizeof(unsigned int) * 8 - __builtin_clz(n));
		ll x = 1 << (digits-1);
		ll y = n - x;
		cout << x << y << endl;
	}
}
int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    solve();
}
0