結果
| 問題 | No.683 Two Operations No.3 |
| コンテスト | |
| ユーザー |
hiro71687k
|
| 提出日時 | 2023-03-31 03:56:24 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 758 bytes |
| 記録 | |
| コンパイル時間 | 3,100 ms |
| コンパイル使用メモリ | 276,552 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-30 02:45:06 |
| 合計ジャッジ時間 | 3,964 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll=long long;
using ld=long double;
ld pie=3.141592653589793;
ll mod=1000000007;
ll inf=999999999999999999;
int main(){
ll x,y;
cin >> x >> y;
queue<pair<ll,ll>>que;
que.push({x,y});
while (!que.empty())
{
ll a=que.front().first;
ll b=que.front().second;
que.pop();
if (a==0||b==0)
{
cout << "Yes" << endl;
return 0;
}
if (a%2&&b%2)
{
continue;
}
if (a%2==0)
{
que.push({a/2,b-1});
}
if (b%2==0)
{
que.push({a-1,b/2});
}
}
cout << "No" << endl;
}
hiro71687k