結果
問題 | No.1298 OR XOR |
ユーザー |
|
提出日時 | 2020-11-27 21:32:00 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 9 ms / 2,000 ms |
コード長 | 343 bytes |
コンパイル時間 | 4,139 ms |
コンパイル使用メモリ | 191,400 KB |
最終ジャッジ日時 | 2025-01-16 06:35:04 |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 13 |
ソースコード
#include<bits/stdc++.h>//#include<atcoder/all>using namespace std;using ll = long long;int main(){ll n;cin >> n;ll a,b,c;a=b=n;c=0;for(int bit = 0;bit<40;bit++){if(n>>bit&1){a -= 1LL<<bit;c += 1LL<<bit;break;}}if(a*c==0){cout<<-1<<' '<<-1<<' '<<-1<<endl;}else cout<<a<<' '<<b<<' '<<c<<endl;}