結果
| 問題 |
No.683 Two Operations No.3
|
| コンテスト | |
| ユーザー |
wakannyaai
|
| 提出日時 | 2020-03-14 14:39:52 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,700 bytes |
| コンパイル時間 | 1,702 ms |
| コンパイル使用メモリ | 166,500 KB |
| 実行使用メモリ | 818,048 KB |
| 最終ジャッジ日時 | 2024-11-23 21:09:34 |
| 合計ジャッジ時間 | 12,903 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 TLE * 2 MLE * 3 |
ソースコード
#include "bits/stdc++.h"
#include <random>
#include <algorithm>
#include <unordered_set>
#define rep(i,n) for(int i = 0; i < n; i++)
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define vll vector<vector<long long>>
#define vl vector<long long>
#define vi vector<int>
#define vii vector<vector<int>>
#define pb push_back
#define pf push_front
#define ld long double
#define Sort(a) sort(a.begin(),a.end())
#define cSort(a,cmp) sort(a.begin(),a.end(),cmp)
#define reSort(a) sort(a.rbegin(), a.rend())
static const ll llMAX = numeric_limits<long long>::max();
static const int intMAX = numeric_limits<int>::max();
static const ll llMIN = numeric_limits<long long>::min();
static const int intMIN = numeric_limits<int>::min();
static const ll d_5 = 100000;
static const ll d9_7 = 1000000007;
static const ll d_9 = 1000000000;
static const double PI=3.14159265358979323846;
bool search(ull a,ull b){
if(a==0 && b==0){
return true;
}
if((a==0 && b==1) || (a==1 && b==0)){
return true;
}
if(a%2==1 && b%2==1){
return false;
}
bool ans=false;
if(a>0&& b%2==0){
ans|=search(a-1,b>>1);
}
if(ans){
return true;
}
if(b>0&&a%2==0){
ans|=search(a>>1,b-1);
}
return ans;
}
int main(void){
ull a,b;
cin>>a>>b;
if(search(a,b)){
cout<<"Yes"<<endl;
}else{
cout<<"No"<<endl;
}
return 0;
}
//<<std::setprecision(30)
//重複削除
/* std::sort(vec.begin(), vec.end());
vec.erase(std::unique(vec.begin(), vec.end()), vec.end());*/
//ペアの全探索
/*do{
int s=0;
for(int i=0;i<n/2;i++)s+=v[i]^v[i+n/2];
r=max(s,r);
reverse(v.begin()+n/2,v.end());
}while(next_permutation(v.begin(),v.end()));*/
wakannyaai