結果
問題 |
No.3088 XOR = SUM
|
ユーザー |
![]() |
提出日時 | 2025-04-04 21:57:06 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 659 bytes |
コンパイル時間 | 5,029 ms |
コンパイル使用メモリ | 333,352 KB |
実行使用メモリ | 7,720 KB |
最終ジャッジ日時 | 2025-04-04 21:57:22 |
合計ジャッジ時間 | 12,416 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 1 WA * 21 |
ソースコード
#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; rep(i, 0, 62) { if (n & (1LL << i)) { p = i; } } ll m = 1LL << p; a = m; b = n ^ m; cout << a << ' ' << b << '\n'; } }