結果

問題 No.208 王将
コンテスト
ユーザー roiti46
提出日時 2015-05-15 23:37:43
言語 PyPy2
(7.3.20)
結果
WA  
実行時間 -
コード長 395 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 146 ms
コンパイル使用メモリ 77,464 KB
最終ジャッジ日時 2025-12-03 15:08:25
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 21 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

x, y = map(int, raw_input().split())
x2, y2 = map(int, raw_input().split())

ans = max(abs(x), abs(y))
if abs(x) == abs(y) and abs(x2) == abs(y2):
    if (0 < x2 < x or x < x2 < 0) and (0 < y2 < y or y < y2 < 0):
        ans += 1
else:
    if   x == 0 and x2 == 0 and 0 < y2 < y or y < y2 < 0:
        ans += 1
    elif y == 0 and y2 == 0 and 0 < x2 < x or x < x2 < 0:
        ans += 1
print ans
0