結果

問題 No.799 赤黒かーどげぇむ
ユーザー melankmelank
提出日時 2019-04-18 22:52:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 493 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 11,952 KB
実行使用メモリ 10,144 KB
最終ジャッジ日時 2023-10-23 16:26:05
合計ジャッジ時間 2,399 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,092 KB
testcase_01 AC 32 ms
10,092 KB
testcase_02 AC 28 ms
10,092 KB
testcase_03 AC 28 ms
10,092 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 28 ms
10,092 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 32 ms
10,092 KB
testcase_14 AC 28 ms
10,092 KB
testcase_15 AC 28 ms
10,092 KB
testcase_16 AC 29 ms
10,092 KB
testcase_17 AC 28 ms
10,092 KB
testcase_18 WA -
testcase_19 AC 28 ms
10,092 KB
権限があれば一括ダウンロードができます

ソースコード

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