結果
| 問題 |
No.683 Two Operations No.3
|
| コンテスト | |
| ユーザー |
どらら
|
| 提出日時 | 2018-05-12 00:25:50 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 836 bytes |
| コンパイル時間 | 1,487 ms |
| コンパイル使用メモリ | 168,216 KB |
| 実行使用メモリ | 13,756 KB |
| 最終ジャッジ日時 | 2024-06-28 09:18:39 |
| 合計ジャッジ時間 | 4,979 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 TLE * 1 -- * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;
bool check(ll A, ll B){
if(A == 0 && B == 0) return true;
if(A < 0 || B < 0) return false;
if(A > B){
if(A%2==0 && B>0){
if(check(A/2,B-1)) return true;
}
if(B%2==0 && A>0){
if(check(A-1,B/2)) return true;
}
}else{
if(B%2==0 && A>0){
if(check(A-1,B/2)) return true;
}
if(A%2==0 && B>0){
if(check(A/2,B-1)) return true;
}
}
return false;
}
int main(){
ll A, B;
cin >> A >> B;
if(check(A,B)) cout << "Yes" << endl;
else cout << "No" << endl;
return 0;
}
どらら