結果
| 問題 |
No.1298 OR XOR
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-11-27 21:24:18 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
WA
(最新)
CE
(最初)
|
| 実行時間 | - |
| コード長 | 651 bytes |
| コンパイル時間 | 2,463 ms |
| コンパイル使用メモリ | 118,116 KB |
| 最終ジャッジ日時 | 2025-01-16 06:21:22 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 13 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>
static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;
template<class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;
int main() {
int n;
cin >> n;
if(__builtin_popcount(n) == 1) puts("0");
else {
int a = -1, b = -1;
for (int i = 0; i <= 30; ++i) {
if(n & (1 << i)){
if(a == -1) a = i;
else b = i;
}
}
printf("%d %d %d\n", n, n^(1 << a), n^(1 << b));
}
return 0;
}