結果
| 問題 | No.683 Two Operations No.3 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2018-06-26 02:08:42 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 420 bytes | 
| コンパイル時間 | 559 ms | 
| コンパイル使用メモリ | 72,572 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-30 22:49:12 | 
| 合計ジャッジ時間 | 1,228 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 16 | 
コンパイルメッセージ
main.cpp:36:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   36 | main()
      | ^~~~
            
            ソースコード
#include<iostream>
#include<map>
using namespace std;
long a,b;
map<pair<long,long>,int>M;
bool f(long a,long b)
{
	if(a==0||b==0)return 1;
	else if(a%2)
	{
		if(b%2)
		{
			return 0;
		}
		else
		{
			return f(a-1,b/2);
		}
	}
	else if(b%2)
	{
		if(a%2)
		{
			return 0;
		}
		else
		{
			return f(a/2,b-1);
		}
	}
	else
	{
		return f(a-1,b/2)|f(a/2,b-1);
	}
}
main()
{
	cin>>a>>b;
	cout<<(!f(a,b)?"No":"Yes")<<endl;
}
            
            
            
        