結果
| 問題 | No.208 王将 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-25 17:19:57 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 452 bytes |
| 記録 | |
| コンパイル時間 | 322 ms |
| コンパイル使用メモリ | 82,588 KB |
| 実行使用メモリ | 54,264 KB |
| 最終ジャッジ日時 | 2025-11-25 17:20:00 |
| 合計ジャッジ時間 | 2,715 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 WA * 2 |
ソースコード
import sys
def input(): return sys.stdin.readline().rstrip('\n')
def sgn(x):
if x < 0:
return -1
if x == 0:
return 0
return 1
def main():
x, y = map(int, input().split())
x2, y2 = map(int, input().split())
if abs(x) == abs(y) and abs(x2) == abs(y2) and sgn(x) == sgn(x2) and sgn(y) == sgn(y2):
print(abs(x)+1)
else:
print(max(abs(x), abs(y)))
if __name__ == '__main__':
main()