結果
| 問題 |
No.799 赤黒かーどげぇむ
|
| コンテスト | |
| ユーザー |
foumi
|
| 提出日時 | 2019-04-02 23:39:00 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 32 ms / 2,000 ms |
| コード長 | 344 bytes |
| コンパイル時間 | 106 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-12-14 13:56:56 |
| 合計ジャッジ時間 | 1,564 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
A, B, C, D = map(int, input().split())
ab = (B - A + 1)
cd = (D - C + 1)
ans = ab*cd
if A == B and B == C and C == D:
ans = 0
elif A <= C and B >= C and B <= D:
ans -= (B - C + 1)
elif A >= C and A <= D and B >= D:
ans -= (D - A + 1)
elif A < C and B > D:
ans -= cd
elif A > C and B < D:
ans -= ab
print(ans)
foumi