結果
| 問題 |
No.2213 Neq Move
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-10-12 22:40:33 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 662 bytes |
| コンパイル時間 | 272 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 61,440 KB |
| 最終ジャッジ日時 | 2024-07-07 15:07:06 |
| 合計ジャッジ時間 | 1,153 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | AC * 1 WA * 4 |
ソースコード
import sys
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353
def solve():
a, b, c, d = mi()
ta = False
tb = False
if a > c:
ta = True
a = 0
if b > d:
tb = True
b = 0
#a <= c && b <= d
if a > b:
a, b = b, a
c, d = d, c
ta, tb = tb, ta
if c > d:
tb = True
ans = 0
if ta:
ans += 1 + c
else:
ans += c - a
if tb:
ans += 1 + d
else:
ans += d - b
print(ans)
for _ in range(ii()):
solve()