結果
| 問題 |
No.683 Two Operations No.3
|
| コンテスト | |
| ユーザー |
hanbei_dayo
|
| 提出日時 | 2020-09-03 11:26:02 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 921 bytes |
| コンパイル時間 | 870 ms |
| コンパイル使用メモリ | 83,380 KB |
| 実行使用メモリ | 818,048 KB |
| 最終ジャッジ日時 | 2024-11-23 00:54:19 |
| 合計ジャッジ時間 | 12,119 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 TLE * 1 MLE * 5 |
コンパイルメッセージ
main.cpp: In function 'bool dfs(ll, ll)':
main.cpp:46:1: warning: control reaches end of non-void function [-Wreturn-type]
46 | }
| ^
ソースコード
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<functional>
#include<math.h>
using namespace std;
//#define N (1000000000+7)
//#define N (998244353)
#define N 17
#define INF 1e16
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
typedef vector<vec> mat;
const int inf = 1e9;
bool dfs(ll A,ll B){
if(A<0){
return false;
}
if(B<0){
return false;
}
if(A==0 && B==0){
return true;
}
if(A%2==1 && B%2==1){
return false;
}
if(A%2==0 && B%2==1){
return dfs(A/2,B-1);
}
if(A%2==1 && B%2==0){
return dfs(A-1,B/2);
}
if(A%2==0 && B%2==0){
return dfs(A-1,B/2)|dfs(A/2,B-1);
}
}
int main(void){
ll A,B;
cin>>A>>B;
if(dfs(A,B))cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
hanbei_dayo