結果

問題 No.208 王将
ユーザー PalearcticPalearctic
提出日時 2018-09-03 00:56:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 446 bytes
コンパイル時間 115 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-15 01:47:08
合計ジャッジ時間 1,931 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

def prt(x,y,x_2,y_2):
    if(x==0):
        print(abs(y))
    elif(y==0):
        print(abs(x))
    else:
        if(abs(x)==abs(y)):
            if(abs(x_2)==abs(y_2) and x*x_2>0 and y*y_2>0 and abs(x)>abs(x_2)):
                print(abs(x)+1)
            else:
                print(abs(x))
        else:
            print(abs(x)+abs(y)-1)
            
x,y=list(map(int,input().split()))
x_2,y_2=list(map(int,input().split()))
prt(x,y,x_2,y_2)
0