結果
問題 |
No.683 Two Operations No.3
|
ユーザー |
![]() |
提出日時 | 2025-01-12 21:11:43 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 550 bytes |
コンパイル時間 | 409 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 473,876 KB |
最終ジャッジ日時 | 2025-01-12 21:12:08 |
合計ジャッジ時間 | 24,341 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 TLE * 7 |
ソースコード
A, B = map(int, input().split()) if A > B: A, B = B, A Q = {(A, B)} Q2 = {(A, B)} while Q: a, b = Q.pop() if a == 0 and b == 0: print("Yes") exit() if a % 2 == 0: c = a // 2 d = b - 1 if c > d: c, d = d, c if (c, d) not in Q2: Q.add((c, d)) Q2.add((c, d)) if b % 2 == 0: c = b // 2 d = a - 1 if c > d: c, d = d, c if (c, d) not in Q2: Q.add((c, d)) Q2.add((c, d)) print("No")