結果
問題 | No.1298 OR XOR |
ユーザー |
![]() |
提出日時 | 2020-11-27 22:09:06 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,253 bytes |
コンパイル時間 | 1,653 ms |
コンパイル使用メモリ | 167,816 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-26 13:01:25 |
合計ジャッジ時間 | 2,456 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 13 |
ソースコード
#include<bits/stdc++.h>using namespace std;#define rep(i, n) for (int i = 0; i < (int)(n); i++)#define rrep(i, k, n) for (int i = k; i < (int)(n); i++)#define repd(i, n) for (int i = n-1; i >= 0; i--)#define rrepd(i, k, n) for (int i = n-1; i >= (int)(k); i--)#define all(x) (x).begin(),(x).end()#define chmax(x,y) x=max(x,y)#define chmin(x,y) x=min(x,y)#define F first //pairの一つ目の要素#define S second //pairの二つ目の要素#define PB push_back //挿入#define MP make_pair //pairのコンストラクタ//V,Pは大文字i,l,bは小文字using ll = long long;using Vi = vector<int>;using VVi = vector<Vi>;using Vl = vector<ll>;using VVl = vector<Vl>;using Vb = vector<bool>;using VVb = vector<Vb>;using P = pair<int,int>;using Pl = pair<ll, ll>;using Vs = vector<string>;const ll mod = 1000000007;const ll inf = 1000000000000000000;//10の12乗#define yn {puts("Yes");}else{puts("No");}#define dame { puts("-1"); return 0;}int main() {ll n;cin >> n;ll cnt=0;ll a=-1;rep(i,40){if(n&(1<<i)){cnt++;a=pow(2,i);break;}}ll b=a^n;if(b==0){rep(i,3) cout << -1 << " ";}else{cout << n << " " << a << " " << b;}}