結果
問題 | No.683 Two Operations No.3 |
ユーザー | yuppe19 😺 |
提出日時 | 2018-05-11 22:32:30 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 539 bytes |
コンパイル時間 | 723 ms |
コンパイル使用メモリ | 77,112 KB |
実行使用メモリ | 7,696 KB |
最終ジャッジ日時 | 2023-09-10 13:04:40 |
合計ジャッジ時間 | 4,300 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
7,696 KB |
testcase_01 | AC | 2 ms
4,380 KB |
testcase_02 | AC | 1 ms
4,380 KB |
testcase_03 | AC | 2 ms
4,376 KB |
testcase_04 | AC | 1 ms
4,380 KB |
testcase_05 | AC | 2 ms
4,376 KB |
testcase_06 | TLE | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
ソースコード
#include <iostream> #include <queue> #include <tuple> #include <vector> using namespace std; using i64 = long long; bool f(i64 a, i64 b) { queue<pair<i64, i64>> que; que.emplace(a, b); while(!que.empty()) { i64 x, y; tie(x, y) = que.front(); que.pop(); if(x == 0 && y == 0) { return true; } if(x % 2 == 0) { que.emplace(x/2, y-1); } if(y % 2 == 0) { que.emplace(x-1, y/2); } } return false; } int main(void) { i64 a, b; scanf("%lld%lld", &a, &b); bool ok = f(a, b); puts(ok ? "Yes" : "No"); return 0; }