結果

問題 No.2213 Neq Move
ユーザー ニックネームニックネーム
提出日時 2023-02-10 23:09:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 263 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 10,736 KB
実行使用メモリ 7,988 KB
最終ジャッジ日時 2023-09-22 00:15:17
合計ジャッジ時間 782 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,840 KB
testcase_01 AC 22 ms
7,988 KB
testcase_02 AC 22 ms
7,884 KB
testcase_03 AC 22 ms
7,884 KB
testcase_04 AC 23 ms
7,856 KB
testcase_05 AC 22 ms
7,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    a,b,c,d = map(int,input().split())
    if a>b: a,b,c,d = b,a,d,c
    if c<a and d<b: print(1+c+1+d)
    elif d<c: print(c-a+1+d)
    elif a<=c and b<=d: print(c-a+d-b)
    elif b<=d: print(1+c+d-b)
    else: print((a==1)+1+c+1+d)
0