結果
問題 | No.683 Two Operations No.3 |
ユーザー |
![]() |
提出日時 | 2018-05-12 00:24:56 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 667 bytes |
コンパイル時間 | 1,594 ms |
コンパイル使用メモリ | 167,316 KB |
実行使用メモリ | 814,720 KB |
最終ジャッジ日時 | 2024-06-28 09:18:31 |
合計ジャッジ時間 | 3,201 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 MLE * 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%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; } return false; } int main(){ ll A, B; cin >> A >> B; if(check(A,B)) cout << "Yes" << endl; else cout << "No" << endl; return 0; }