結果
問題 | No.683 Two Operations No.3 |
ユーザー |
![]() |
提出日時 | 2020-06-10 17:40:41 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 537 bytes |
コンパイル時間 | 1,497 ms |
コンパイル使用メモリ | 157,572 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-23 09:51:13 |
合計ジャッジ時間 | 2,258 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 |
ソースコード
/** * @FileName a.cpp * @Author kanpurin * @Created 2020.06.10 17:40:31 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; bool isOK(ll x, ll y) { if (x == 0 || y == 0) return true; if (x % 2 == 1 && y % 2 == 1) return false; if (x % 2 == 0 && y % 2 == 0) return isOK(x - 1, y / 2) | isOK(x / 2, y - 1); if (y % 2 == 0) return isOK(x - 1, y / 2); return isOK(x / 2, y - 1); } int main() { ll x,y;cin >> x >> y; if (isOK(x,y)) puts("Yes"); else puts("No"); return 0; }