結果

問題 No.799 赤黒かーどげぇむ
ユーザー melank
提出日時 2019-04-18 22:52:58
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 493 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-09-22 10:46:08
合計ジャッジ時間 1,652 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

# test = '1 1 1 1'
a, b, c, d = map(int, input().split())
# a, b, c, d = map(int, test.split())
x = b - a + 1
y = d - c + 1
dup = 0

if b < c:
    dup = 0
elif c < a:
    dup = 0
else:
    if a <= c and c < b:
        # print('a')
        dup = b - c + 1
    elif a <= c and b <= d:
        # print('b')
        dup = d - a + 1
    elif c <= b and b < d:
        # print('c')
        dup = b - c + 1
    elif c <= a and b <= d:
        # print('d')
        dup = d - c + 1

print(x * y - dup)
0