結果
問題 |
No.939 and or
|
ユーザー |
![]() |
提出日時 | 2019-12-15 10:19:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 309 bytes |
コンパイル時間 | 526 ms |
コンパイル使用メモリ | 63,872 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-02 18:10:16 |
合計ジャッジ時間 | 1,810 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 29 WA * 1 |
ソースコード
#include <iostream> using namespace std; int main() { int A, B; cin >> A >> B; int ans = 1; for (int i = 0; i <= 30; i++) { int a = (A >> i) & 1, b = (B >> i) & 1; if (a > b) ans = 0; else if (a == 0 && b == 1) ans *= 2; } cout << (ans == 1 ? 1 : ans/2) << endl; }