結果
問題 | No.1298 OR XOR |
ユーザー | oliverx3 |
提出日時 | 2020-11-27 22:09:22 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 483 bytes |
コンパイル時間 | 1,338 ms |
コンパイル使用メモリ | 167,496 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-26 13:01:31 |
合計ジャッジ時間 | 2,026 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 13 |
ソースコード
#include<bits/stdc++.h>// #include<atcoder/all>using namespace std;// using namespace atcoder;#define int long long#define rep(i, n) for(int i = 0;i<(int)(n);i++)#define all(v) (v).begin(),(v).end()using ll = long long;using P = pair<int,int>;signed main() {int n;cin >> n;int k = 0,count = 0;rep(i, 32) if(n&(1LL<<i)) k = i,count++;if(count==1) printf("-1 -1 -1\n");else cout << n << ' ' << (1LL<<k) << ' ' << (n^(1LL<<k)) << endl;return 0;}