結果

問題 No.208 王将
ユーザー lam6er
提出日時 2025-03-20 20:33:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 1,000 ms
コード長 268 bytes
コンパイル時間 249 ms
コンパイル使用メモリ 82,244 KB
実行使用メモリ 54,000 KB
最終ジャッジ日時 2025-03-20 20:33:47
合計ジャッジ時間 2,033 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

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

d = max(x, y)

on_path = (x2 <= x and y2 <= y) and (max(x2, y2) + max(x - x2, y - y2) == d)

if on_path:
    if x == y and x2 == y2:
        print(d + 1)
    else:
        print(d)
else:
    print(d)
0