結果
| 問題 |
No.2213 Neq Move
|
| ユーザー |
tamato
|
| 提出日時 | 2023-02-10 23:06:27 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,474 bytes |
| コンパイル時間 | 131 ms |
| コンパイル使用メモリ | 82,320 KB |
| 実行使用メモリ | 62,664 KB |
| 最終ジャッジ日時 | 2024-07-07 17:07:46 |
| 合計ジャッジ時間 | 791 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 3 WA * 2 |
ソースコード
mod = 998244353
def main():
import sys
input = sys.stdin.readline
for _ in range(int(input())):
a, b, c, d = map(int, input().split())
if a > c and b > d:
print(c + d + 2)
elif a < c and b < d:
if (a - b) * (c - d) > 0:
print(c - a + d - b)
else:
if a < b:
print(c - a + d + 1)
else:
print(d - b + c + 1)
else:
if (a - b) * (c - d) > 0:
if a < b:
if d >= b:
print(1 + d - b + c)
else:
if a == 1:
print(3 + c + d)
else:
print(2 + c + d)
else:
if c >= a:
print(1 + c - a + d)
else:
if b == 1:
print(3 + c + d)
else:
print(2 + c + d)
else:
if a > b:
if d >= b:
print(1 + d - b + c)
else:
print(2 + c + d)
else:
if c >= a:
print(1 + c - a + d)
else:
print(2 + c + d)
if __name__ == '__main__':
main()
tamato