結果
| 問題 | No.1298 OR XOR |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-01-08 01:20:05 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 328µs | |
| コード長 | 670 bytes |
| 記録 | |
| コンパイル時間 | 934 ms |
| コンパイル使用メモリ | 190,332 KB |
| 実行使用メモリ | 9,868 KB |
| 最終ジャッジ日時 | 2026-09-22 04:19:49 |
| 合計ジャッジ時間 | 2,299 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr char newl = '\n';
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll n;
cin >> n;
vector<ll> ans(3, 0);
int tar = 0;
for (int i = 30; i >= 0; i--) {
if (n >> i & 1) {
for (int j = 0; j < 3; j++) {
if (j == tar) continue;
ans[j] |= (1LL << i);
}
tar = (tar + 1) % 3;
}
}
sort(ans.begin(), ans.end());
if (ans[0] == 0) {
cout << "-1 -1 -1\n";
} else {
cout << ans[0] << " " << ans[1] << " " << ans[2] << newl;
}
return 0;
}