Type: Default 1000ms 256MiB

区间香蕉

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题面描述

给定两个区间 [L1,R1][L_1,R_1][L2,R2][L_2,R_2],询问这两个区间相交部分的长度。

输入格式

一行四个整数,为 L1,R1,L2,R2L_1,R_1,L_2,R_2

输出格式

一行一个整数,表示答案。

样例

输入 1

0 3 1 5

输出 1

2

输入 2

0 1 4 5

输出 2

0

输入 3

0 3 3 7

输出 3

0

数据范围

  • 0L1<R11000 \leq L_1 < R_1 \leq 100
  • 0L2<R21000 \leq L_2 < R_2 \leq 100

测试比赛功能

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
8
Start at
2022-9-14 10:45
End at
2022-9-14 12:15
Duration
1.5 hour(s)
Host
Partic.
19