結果
問題 | No.1298 OR XOR |
ユーザー |
![]() |
提出日時 | 2020-12-21 22:28:25 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 617 bytes |
コンパイル時間 | 1,702 ms |
コンパイル使用メモリ | 166,428 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-21 13:10:36 |
合計ジャッジ時間 | 2,244 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long ll;typedef pair<ll,ll> P;ll n;ll a[35];ll b;ll A,B,C;int main(void){cin.tie(0);ios::sync_with_stdio(0);cin>>n;for(int i=0;i<35;i++){if(n%2==1){a[i]=1;b++;}n/=2;}if(b==1){cout<<-1<<" "<<-1<<" "<<-1<<endl;return 0;}for(int i=0;i<35;i++){if(a[i]==1&&A==0){A+=(1<<i);B+=(1<<i);}else if(a[i]==1){B+=(1<<i);C+=(1<<i);}}cout<<A<<" "<<B<<" "<<C<<endl;}