結果
| 問題 |
No.1298 OR XOR
|
| コンテスト | |
| ユーザー |
SEEL
|
| 提出日時 | 2020-11-27 21:47:37 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,430 bytes |
| コンパイル時間 | 2,168 ms |
| コンパイル使用メモリ | 193,760 KB |
| 最終ジャッジ日時 | 2025-01-16 06:53:17 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 12 WA * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, b) for(ll i = a; i < b; i++)
#define Rep(i, a, b) for(ll i = a; i <= b; i++)
#define repr(i, a, b) for(ll i = b-1; i >= a; i--)
// #define _GLIBCXX_DEBUG
template <class T> using V = vector<T>;
#define ALL(v) (v).begin(),(v).end()
#define endl '\n'
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define sz(v) ((ll)(v).size())
const double pi = acos(-1.0);
// const ll MOD = 1000000007LL;
const ll MOD = 998244353LL;
const ll INF = 1LL << 60;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
const int dy2[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dx2[] = {1, 1, 0, -1, -1, -1, 0, 1};
// ios::sync_with_stdio(false);
// cin.tie(nullptr);
/*--------------------------------------------------------------------------------
--------------------------------------------------------------------------------*/
int main(){
ll n;
cin >> n;
bitset<25> s(n);
cerr << s << endl;
ll a = n, b = 0, c = 0;
rep(i, 0, 22){
if(s.test(i)){
b = 1;
rep(j, 0, i) b *= 2;
}
}
c = a^b;
if(c==0){
cout << "-1 -1 -1" << endl;
return 0;
}
cout << a << " " << b << " " << c << endl;
// bitset<25> A(a), B(b), C(c);
// cout << "a: " << A << endl;
// cout << "b: " << B << endl;
// cout << "c: " << C << endl;
}
SEEL