結果
問題 | No.2213 Neq Move |
ユーザー |
![]() |
提出日時 | 2023-02-10 23:11:50 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,546 bytes |
コンパイル時間 | 242 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 61,184 KB |
最終ジャッジ日時 | 2024-07-07 17:11:36 |
合計ジャッジ時間 | 967 ms |
ジャッジサーバーID (参考情報) |
judge3 / 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(0) continue 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()