結果

問題 No.1412 Super Ryuo
ユーザー zer0zer0
提出日時 2021-02-28 22:39:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 334 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-12 10:56:42
合計ジャッジ時間 1,294 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,752 KB
testcase_01 AC 29 ms
10,752 KB
testcase_02 AC 33 ms
10,752 KB
testcase_03 AC 29 ms
10,752 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 29 ms
10,880 KB
testcase_07 AC 30 ms
10,752 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 30 ms
10,752 KB
testcase_11 AC 30 ms
10,752 KB
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

r1, c1, r2, c2 = map(int, input().split())

r = r2 - r1
c = c2 - c1

if (r, c) == (0, 0):
    ans = 0
elif r == c or r == -c: 
    ans = 1
elif abs(r) + abs(c) <= 3:
    ans = 1
elif (r ^ c ^ 1) & 1:
    ans = 2
elif abs(r) + abs(c) <= 6:
    ans = 2
elif abs(r + c) <= 3 or abs(r - c) <= 3:
    ans = 2
else:
    ans = 3

print(ans)
0