結果
| 問題 |
No.683 Two Operations No.3
|
| コンテスト | |
| ユーザー |
xxxasdfghjk
|
| 提出日時 | 2018-08-13 14:35:55 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 814 bytes |
| コンパイル時間 | 633 ms |
| コンパイル使用メモリ | 71,680 KB |
| 実行使用メモリ | 814,720 KB |
| 最終ジャッジ日時 | 2024-09-24 08:00:38 |
| 合計ジャッジ時間 | 2,603 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 MLE * 1 -- * 9 |
ソースコード
#include<cstdio>
#include<queue>
#include<utility>
#include<cstring>
#include<stack>
#include<algorithm>
#include<cmath>
#include<iostream>
#include<map>
#define MAX_N 100001
#define INF_INT 2147483647
#define INF_LL 9223372036854775807
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
bool solve(ll A,ll B){
if(A == 0 && B == 0)
return true;
else if(A % 2 == 1 && B % 2 == 1)
return false;
else{
if(A % 2 == 0 && B % 2 == 0){
return solve(A/2,B-1) || solve(A-1,B/2);
}else{
if(A % 2 == 1)
return solve(A-1,B/2);
else
return solve(A/2,B-1);
}
}
}
int main()
{
ll A,B;
cin >> A >> B;
if(solve(A,B)){
cout << "Yes" << endl;
}else
cout << "No" << endl;
return 0;
}
xxxasdfghjk