結果
| 問題 | No.683 Two Operations No.3 | 
| コンテスト | |
| ユーザー |  e869120 | 
| 提出日時 | 2018-05-18 21:20:47 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 423 bytes | 
| コンパイル時間 | 489 ms | 
| コンパイル使用メモリ | 64,220 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-28 13:46:11 | 
| 合計ジャッジ時間 | 1,125 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 16 | 
ソースコード
#include <iostream>
using namespace std;
long long A, B;
bool solve(long long p, long long q) {
	if (p == 0 || q == 0) return true;
	if (p % 2 == 0) {
		if (solve(p / 2, q - 1) == true) return true;
	}
	if (q % 2 == 0) {
		if (solve(p - 1, q / 2) == true) return true;
	}
	return false;
}
int main() {
	cin >> A >> B;
	bool T = solve(A, B);
	if (T == true) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}
            
            
            
        