結果
| 問題 | No.683 Two Operations No.3 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-11-22 16:44:55 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 658 bytes |
| 記録 | |
| コンパイル時間 | 355 ms |
| コンパイル使用メモリ | 77,708 KB |
| 実行使用メモリ | 9,868 KB |
| 最終ジャッジ日時 | 2026-11-22 16:45:03 |
| 合計ジャッジ時間 | 6,829 ms |
|
ジャッジサーバーID (参考情報) |
judge6_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 4 OLE * 1 -- * 11 |
ソースコード
#include <iostream>
#include <cstdio>
using namespace std;
typedef long long LL;
bool DFS(LL x, LL y) {
if (x == 0 || y == 0) return true;
if (x % 2 == 0 && y % 2 == 0) {
if (DFS(x / 2, y - 1)) return true;
return DFS(x - 1, y / 2);
} else if (x % 2 == 0) return DFS(x / 2, y - 1);
else if (y % 2 == 0) return DFS(x - 1, y / 2);
return false;
}
void Solve() {
LL x, y;
scanf("%lld%lld", &x, &y);
puts(DFS(x, y) ? "Yes" : "No");
}
int main() {
// freopen("ops.in", "r", stdin);
// freopen("ops.out", "w", stdout);
int t;
scanf("%d", &t);
while (t--) Solve();
return 0;
}