結果

問題 No.240 ナイト散歩
ユーザー B9syDOfYhHFXecu
提出日時 2018-11-03 22:40:23
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 344 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-20 19:38:08
合計ジャッジ時間 1,820 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 22 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

X, Y = [abs(int(x)) for x in input().split(' ')]

def cal(x, y):
    x = abs(x)
    y = abs(y)
    if y > x:
        x, y = y, x
    
    x -= 2
    y -= 1
    
    return x, y
    
if X == 0 and Y == 0:
    print('YES')

for _ in range(3):
    X, Y = cal(X,Y)
    if X == 0 and Y == 0:
        print('YES')
        break
else:
    print('NO')
0