結果
| 問題 | No.683 Two Operations No.3 |
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-02-05 22:11:22 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 500 bytes |
| 記録 | |
| コンパイル時間 | 478 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 11,136 KB |
| 最終ジャッジ日時 | 2024-09-23 03:42:32 |
| 合計ジャッジ時間 | 1,751 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 11 RE * 5 |
ソースコード
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from functools import lru_cache
A, B = map(int, read().split())
@lru_cache(None)
def solve(A, B):
if A == B == 0:
return True
if A < 0 or B < 0:
return False
if A % 2 == 0 and solve(A // 2, B - 1):
return True
if B % 2 == 0 and solve(A - 1, B // 2):
return True
return False
answer = 'YES' if solve(A, B) else 'NO'
print(answer)
maspy