結果

問題 No.1298 OR XOR
ユーザー kaede2020kaede2020
提出日時 2020-11-28 06:48:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 480 bytes
コンパイル時間 1,657 ms
コンパイル使用メモリ 164,924 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-10-09 23:30:46
合計ジャッジ時間 3,288 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 1 ms
4,352 KB
testcase_04 AC 1 ms
4,352 KB
testcase_05 AC 1 ms
4,352 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
int main()
{
  ll n;
  cin>>n;
  ll a=n,b=n,c=0;
  rep(i,31){
    if((b>>i)&1){
      b^=(1LL<<i);
      c^=(1LL<<i);
      break;
    }
  }
  if(b==0){
    cout<<"-1 -1 -1"<<endl;
    return 0;
  }
  ll ans=a^b^c;
  ll ans2=a|b;
  ll ans3=b|c;
  ll ans4=c|a;
  //cout<<a<<" "<<b<<" "<<c<<endl;
  //cout<<ans<<" "<<ans2<<" "<<ans3<<" "<<ans4<<endl;
  return 0;
}
0