結果

問題 No.208 王将
コンテスト
ユーザー roiti46
提出日時 2015-05-15 23:00:51
言語 PyPy2
(7.3.20)
コンパイル:
pypy2 -m py_compile _filename_
実行:
/usr/bin/pypy2 Main.pyc
結果
WA  
実行時間 -
コード長 362 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 68 ms
コンパイル使用メモリ 80,896 KB
実行使用メモリ 81,152 KB
最終ジャッジ日時 2026-07-17 14:46:40
合計ジャッジ時間 2,928 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 19 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def dist(a,b,c,d):
    return ((a - c) ** 2 + (b - d) ** 2) ** 0.5
    
x, y = map(int, raw_input().split())
x2, y2 = map(int, raw_input().split())

ans = max(abs(x), abs(y))
if x*x2 + y*y2 == 0:
    if abs(dist(0, 0, x2, y2) + dist(x2, y2, x, y) - dist(0, 0, x, y)) < 1e-7:
        if min(abs(x), abs(y)) == 0 or abs(x) == abs(y):
            ans += 1
print ans
0