結果
| 問題 |
No.1298 OR XOR
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-05-14 13:03:29 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 30 ms / 2,000 ms |
| コード長 | 1,058 bytes |
| コンパイル時間 | 1,908 ms |
| コンパイル使用メモリ | 193,880 KB |
| 最終ジャッジ日時 | 2025-01-29 07:59:18 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 |
ソースコード
#include <bits/stdc++.h>
//#include <atcoder/all>
//using namespace atcoder;
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
#define all(A) A.begin(),A.end()
#define rep(i, n) for (ll i = 0; i < (ll) (n); i++)
bool chmax(ll& p, ll q) {
if (p < q) {
p = q;
return 1;
}
else {
return 0;
}
}
bool chmin(ll& p, ll q) {
if (p > q) {
p = q;
return 1;
}
else {
return 0;
}
}
ll gcd(ll(a), ll(b)) {
ll c = a;
while (a % b != 0) {
c = a % b;
a = b;
b = c;
}
return b;
}
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll N;
cin>>N;
ll k=0;
ll p=-1;
ll M=N;
ll j=0;
while(M>0){
if(M%2==1){
p=j;
k++;
}
M/=2;
j++;
}
if(k==1){
cout<<-1<<" "<<-1<<" "<<-1<<endl;
}
else{
cout<<N<<" "<<(1ll<<p)<<" "<<(N^(1ll<<p))<<endl;
}
}