結果
問題 | No.1298 OR XOR |
ユーザー |
![]() |
提出日時 | 2020-11-27 21:43:44 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 548 bytes |
コンパイル時間 | 1,483 ms |
コンパイル使用メモリ | 166,684 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-26 12:04:54 |
合計ジャッジ時間 | 2,241 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 12 WA * 1 |
ソースコード
#include<bits/stdc++.h> // #include<atcoder/all> using namespace std; // using namespace atcoder; using ll = long long; using ull = unsigned long long; using P = pair<int,int>; #define rep(i,n) for(ll i = 0;i < (ll)n;i++) #define ALL(x) (x).begin(),(x).end() #define MOD 1000000007 int main(){ int n; cin >> n; int cnt = 0,last = 0; rep(i,30)if(n >> i & 1)cnt++,last = i; if(cnt == 1){ cout << "-1 -1 -1\n"; return 0; } cout << n << " "; cout << (1 << last) << " "; cout << ((1 << last) ^ n) << "\n"; return 0; }