結果
問題 |
No.939 and or
|
ユーザー |
![]() |
提出日時 | 2021-01-28 20:15:20 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 427 bytes |
コンパイル時間 | 1,653 ms |
コンパイル使用メモリ | 165,712 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 04:35:20 |
合計ジャッジ時間 | 2,823 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ ll a, b; cin >> a >> b; if(a==b){ cout << 1 << endl; return 0; } ll ans = 1; while(a>0 || b>0){ if((a&1)>0 && (b&1)>0) ans *= 1; if((a&1)==0 && (b&1)>0) ans *= 2; if((a&1)>0 && (b&1)==0) ans *= 0; if((a&1)==0 && (b&1)==0) ans *= 1; a = a>>1; b = b>>1; } ans /= 2; cout << ans << endl; return 0; }