結果

問題 No.240 ナイト散歩
ユーザー B9syDOfYhHFXecuB9syDOfYhHFXecu
提出日時 2018-11-03 22:40:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 344 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-30 21:35:38
合計ジャッジ時間 1,886 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
10,752 KB
testcase_01 AC 26 ms
10,752 KB
testcase_02 WA -
testcase_03 AC 28 ms
10,752 KB
testcase_04 AC 27 ms
10,752 KB
testcase_05 AC 26 ms
10,752 KB
testcase_06 AC 27 ms
10,880 KB
testcase_07 WA -
testcase_08 AC 26 ms
10,880 KB
testcase_09 AC 26 ms
10,752 KB
testcase_10 AC 25 ms
10,752 KB
testcase_11 AC 27 ms
10,752 KB
testcase_12 AC 28 ms
10,752 KB
testcase_13 AC 27 ms
10,752 KB
testcase_14 AC 29 ms
10,880 KB
testcase_15 AC 28 ms
10,752 KB
testcase_16 AC 28 ms
10,752 KB
testcase_17 AC 26 ms
10,752 KB
testcase_18 AC 27 ms
10,880 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 26 ms
10,752 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 25 ms
10,752 KB
testcase_28 AC 27 ms
10,752 KB
testcase_29 AC 26 ms
10,880 KB
testcase_30 AC 27 ms
10,752 KB
testcase_31 AC 26 ms
10,752 KB
testcase_32 AC 25 ms
10,752 KB
testcase_33 AC 25 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

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