結果
問題 | No.939 and or |
ユーザー |
![]() |
提出日時 | 2019-12-02 21:29:58 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 313 bytes |
コンパイル時間 | 1,701 ms |
コンパイル使用メモリ | 167,900 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-24 22:03:18 |
合計ジャッジ時間 | 2,606 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | WA * 30 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(void) { int A, B; cin >> A >> B; long long ans = 0; int digits = min((int)log2(A), (int)log2(B)); for (int i = 0; i < digits; i++) { if (!(A & (1 << i)) && (B & (1 << i))) { ans++; } } cout << 2 * (ans - 1) << endl; return 0; }