TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d = map(int,input().split())
s = range(a,b+1)
m = range(c,d+1)
Ans = list(set(s)|set(m))
print(len(Ans))

a,b,c,d = map(int,input().split())
ans = min(b,d)-max(a,c)
if ans >=0:
  print(ans)
else:
  print(0)

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d = map(int,input().split())
ans = 0
if c < b:
    if c < a and c > d:
        ans = b-c
    elif c > a and c > d:
        ans = d-c
    elif c < a and d > a:
        ans = d-a
print(ans)


a,b,c,d = map(int,input().split())
ans = 0
if c < b:
    if c > d:
        ans = b-c
    else:
        ans = d-c
print(ans)


a,b,c,d = map(int,input().split())
ans = 0
if c <= b and d >= a:
    if c <= a and c >= d:
        ans = b-c
    elif c >= a and c >= d:
        ans = d-c
    elif c <= a and d >= a:
        ans = d-a
print(ans)


a,b,c,d = map(int,input().split())
ans = 0
if c < b:
    if c < a and c > d:
        ans = b-c
    elif c > a and c > d:
        ans = d-c
    else:
        ans = d-a
print(ans)


a,b,c,d = map(int,input().split())
ans = 0
if c < b and d > a:
    if c < a and c > d:
        ans = b-c
    elif c > a and c > d:
        ans = d-c
    elif c < a and d > a:
        ans = d-a
print(ans)


a,b,c,d = map(int,input().split())
ans = 0
if c <= b and d >= a:
    if c <= a and c >= d:
        ans = b-c
    elif c >= a and b >= d:
        ans = d-c
    elif c <= a and d >= a:
        ans = d-a
print(ans)


A,B,C,D = map(int, input().split())

if A < C < B < D:
    print(B-C)
if A < C < D < B:
    print(D-C)
if C < A < D < B:
    print(D-A)
if C < A < B < D:
    print(B-A)
else:
    print(0)


A,B,C,D = map(int, input().split())

if A <= C <= B <= D:
    print(B-C)
elif A <= C <= D <= B:
    print(D-C)
elif C <= A <= D <= B:
    print(D-A)
elif C <= A <= B <= D:
    print(B-A)
else:
    print(0)


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a b c d = map(int, input().split())


if b<=c:
    print ('0')
    exit()
elif:
    if b>=d:
        print(d-c)
        exit()
    elif b<d:
        print(b-c)
        exit()

a, b, c, d = map(int, input().split())


if b<=c:
    print ('0')
else:
    if b>=d:
        print(str(d-c))
    elif b<d:
        print(str(b-c+1))

a, b, c, d = map(int, input().split())

print(max(0, min(d,b)-max(c,a)))

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
A, B, C, D = map(int, input().split())
 
ans = 0
 
for i in range(max(A, B, C, D)+1):
  if (A <= i and i <= B) and (C <= i and i <= D):
    ans += 1

if ans <= 1:
  print(ans)
elif A == C and B == D:
  print(B - A)
else:
  print(ans)

A, B, C, D = map(int, input().split())
 
ans = 0
 
for i in range(max(A, B, C, D)+1):
  if (A <= i and i <= B) and (C <= i and i <= D):
    ans += 1
  print(i)
 
if ans <= 1:
  print(0)
elif A == C and B == D:
  print(ans)
else:
  print(ans-1)

A, B, C, D = map(int, input().split())
 
ans = 0
 
for i in range(max(A, B, C, D)+1):
  if (A <= i and i <= B) and (C <= i and i <= D):
    ans += 1
 
if ans <= 1:
  print(0)
elif A == C and B == D:
  print(B - A)
else:
  print(ans)

A, B, C, D = map(int, input().split())
 
ans = 0
 
for i in range(max(A, B, C, D)+1):
  if (A <= i and i <= B) and (C <= i and i <= D):
    ans += 1
 
if ans <= 1:
  print(0)
elif A == C and B == D:
  print(ans - 1)
else:
  print(ans-1)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a, b, c, d = map(int, input().split())
print(min(b, d)-min(a, c))


a, b, c, d = map(int, input().split())
if b < c:
    print(min(b, d)-max(a, c))
else:
    print(0)

a, b, c, d = map(int, input().split())
ans = min(b, d)-max(a, c)
if ans < 0:
    print(0)
else:
    print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d = map(int,input())
print(min(b,d)-max(a,c))

a,b,c,d = map(int,input().split())
cou = 0
for i in range(101):
  if a <= i and i <= b and c <= i and i <= d:
    cou += 1
print(cou)

a,b,c,d = map(int,input().split())
lisa = []
lisb = []
for n in range((b-a)+1):
  lisa.append(n + a)
for m in range((d-c)+1):
  lisb.append(m + c)
ans = 0
for i in range(101):
  if i in lisa and i in lisb:
    ans += 1
if ans > 0:
  print(ans-1)
else:
  print(ans)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
def abc070_b():
    a, b, c, d = map(int, input().split())

    if c < b or d < a:
        return 0

    if c < a < b < d:
        return b - a

    if a < c < b < d:
        return b - c

    if a < c < d < b:
        return d - c


if __name__ == '__main__':
    print(abc070_b())

def abc070_b():
    a, b, c, d = map(int, input().split())
    
    if c > b:
        return 0
    
    if c < a < b < d:
        return b - a
    
    if a < c < b < d:
        return b - c
    
    if a < c < d < b:
        return d - c
    
    
if __name__ == '__main__':
    print(abc048_b())

def abc070_b():
    a, b, c, d = map(int, input().split())

    if c < b or c < d < a < b:
        return 0

    if c < a < b < d:
        return b - a

    if a < c < b < d:
        return b - c

    if a < c < d < b:
        return d - c


if __name__ == '__main__':
    print(abc070_b())


def abc070_b():
    a, b, c, d = map(int, input().split())

    if c <= a < b <= d:
        return b - a

    if a <= c < d <= b:
        return d - c

    if a <= c < b <= d:
        return b - c

    if c <= a < d <= b:
        return d - a

    if b <= c or d <= a:
        return 0


if __name__ == '__main__':
    print(abc070_b())


Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
A,B,C,D=list(map(int, input().split()))
ma=max(A,B)
mi=min(C,D)
print(mi-ma)

A,B,C,D=list(map(int, input().split()))
ma=min(B,D)
mi=max(A,C)
c=ma-mi
if c<0:
  c=0
print(c)

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d=list(map(int,input().split()))
print(max(max(b,d)-min(a,c),0))

a,b,c,d=list(map(int,input().split()))
print(max(min(b,d)-max(a,c),0))

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d =map(int,input().split())

answer = min(b,c) - max(a,c)
print(max(0,answer))


a,b,c,d =map(int,input().split())

answer = min(b,d) - max(a,c)
print(max(0,answer))


Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d=map(int,input().split())
e=max(a,b)
f=min(c,d)
if e<f:
  print(f-e)
else:
  print(0)

a,b,c,d=map(int,input().split())
e=max(a,c)
f=min(b,d)
if e<f:
  print(f-e)
else:
  print(0)

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
A, B, C, D = map(int, input().split())
print(max(min(C, D)-max(A, B), 0))

A, B, C, D = map(int, input().split())
print(max(min(B, D)-max(A, C), 0))


Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d=map((int,input().split()))
start=min(a,b)
end=min(c,d)
print(end-start if end-start > 0 else 0)

a,b,c,d=map(int,input().split())
start=min(a,c)
end=min(b,d)
print(end-start if end-start > 0 else 0)

a,b,c,d=map(int,input().split())
start=max(a,c)
end=min(b,d)
print(end-start if end-start > 0 else 0)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a, b, c, d = map(int, input().split())

alice = []
bob = []
for i in range(a, b+1):
    alice.append(i)
for j in range(c, d+1):
    bob.append(j)

count = 0
for k in range(1001):
    if k in alice and k in bob:
        print(k)
        count += 1
    else:
        continue
        
if count > 0:
    print(count-1) 
else: 
    print(0)

a, b, c, d = map(int, input().split())

alice = []
bob = []
for i in range(a, b+1):
    alice.append(i)
for j in range(c, d+1):
    bob.append(j)

count = 0
for k in range(1001):
    if k in alice and k in bob:
        count += 1
        print(k)
    else:
        continue
        
print(count-1)

a, b, c, d = map(int, input().split())
 
cnt = [0]*101
for i in range(a, b+1):
    cnt[i] += 1
for j in range(c, d+1):
    cnt[j] += 1
 
ans = cnt.count(2) - 1
if ans == -1:
    print(0)
else:
    print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
n = list(map(int, input().split()))
a = list(range(n[0], n[1]+1))
b = list(range(n[2], n[3]+1))
print(len(set(a) & set(b)))

n = list(map(int, input().split()))
a = list(range(n[0], n[1]+1))
b = list(range(n[2], n[3]+1))
print(max(0, len(set(a) & set(b))-1))

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d = (int(i) for i in input().split())
print(max(max(a,c)-min(b,d),0))

a,b,c,d = (int(i) for i in input().split())
print(max(min(b,d)-max(a,c),0))

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
A, B, C, D = map(int, input().split())
if C < B:
  A, B, C, D = C, D, A, B
if B <= C:
  print(0)
else:
  print(min(B, D) - C)
  

A, B, C, D = map(int, input().split())
if A > C:
  A, B, C, D = C, D, A, B
if B <= C:
  print(0)
else:
  print(min(B, D) - C)
  

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
A, B, C, D = list(map(lambda t: int(t), input().split(" ")))

if B - A + D - C <= max([D - A, B - C]):
  print(0)
else:
  print(max([A, C]) - min([B, D]))

A, B, C, D = list(map(lambda t: int(t), input().split(" ")))
 
if B - A + D - C <= max([D - A, B - C]):
  print(0)
else:
  print(min([B, D]) - max([A, C]))

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d=map(int,input().split())
if a < c < b < d:
    print(d-c)
elif c < a < b < d:
    print(b-a)
elif a < c < d < b:
    print(d-c)
elif c < a < d < b:
    print(d-a)
else:
    print(0)

a,b,c,d=map(int,input().split())
if a <= c <= b <= d:
    print(b-c)
elif c <= a <= b <= d:
    print(b-a)
elif a <= c <= d <= b:
    print(d-c)
elif c <= a <= d <= b:
    print(d-a)
else:
    print(0)

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
def solve():
    a, b, c, d = read()
    result = think(a, b, c, d)
    write(result)


def read():
    return read_int(4)


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def think(a, b, c, d):
    if b <= c or d <= a:
        return 0
    elif a <= c and d <= b:
        return d - c
    elif c <= a and b <= d:
        return b - a
    else:
        if a == c:
            return min(b, d) - a
        elif a < c:
            return abs(c - b)
        else:  # a > c
            return abs(d - a)


def write(result):
    print(result)


if __name__ == '__main__':
    solve()

def solve():
    a, b, c, d = read()
    result = think(a, b, c, d)
    write(result)


def read():
    return read_int(4)


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a, b, c, d):
    if b <= c or d <= a:
        return 0
    elif a <= c and d <= b:
        return d - c
    elif c <= a and b <= d:
        return b - a
    else:
        if a == c:
            return min(b, d) - a
        elif a < c:
            return abs(c - b)
        else:  # a > c
            return abs(d - a)


def write(result):
    print(result)


if __name__ == '__main__':
    solve()

Verdicts: Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a, b, c, d = map(int, input().split())
print(max(0,max(a,c)-min(b,d)))

a, b, c, d = map(int, input().split())
print(max(0,min(b,d)-max(a,c)))

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
 a, b, c, d = map(int, input().split())
print(max(min(b, d) - max(a, c), 0))

a, b, c, d = map(int, input().split())
print(max(min(b, d) - max(a, c), 0))

Verdicts: Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d = map(int,input().split())

if b <= c:
  print(0)
  exit()
  
if b <= d:
  print(d-c)
else:
  print(b-c)

a, b, c, d = map(int, input().split())
ans = 0
for i in range(0, 101):
    if a < i <= b and c < i <= d:
        ans += 1

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d = map(int, input(),split())

if b < c or d < a:
  print("0")
elif a <= c:
  if b <= d:
    print(b-c)
  else:
    print(d-c)
else:
  if c <= a:
    print(d-a)
  else:
    print(d-c)

a,b,c,d = map(int, input().split())
 
print(max(min(b,d) - max(a,c),0))

Verdicts: Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
A, B, C, D = map(int, input().split())
result = min(C, D)-max(A, B)
if result < 0:
    print(0)
else:
    print(result)

A, B, C, D = map(int, input().split())
result = min(B, D)-max(A, C)
if result < 0:
    print(0)
else:
    print(result)


Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
A,B,C,D=(int(i) for i in input().split())
C-=B
if C<0:
  print(0)
else:
  print(C)

# your code goes here
A,B,C,D=(int(i) for i in input().split())
if A<C:
    A=C
if B>D:
    B=D
B-=A
if B<0:
  print(0)
else:
  print(B)

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a, b, c, d = map(int, input().split())
print(max(max(b, d) - min(a, c), 0))

a, b, c, d = map(int, input().split())
print(max(min(b, d) - max(a, c), 0))

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):

a,b,c,d = map(float, input().split())

a,b = max(a,c), min(b,d)

a = max(0.0, b-a)

print(a)



a,b,c,d = map(int, input().split())

a,b = max(a,c), min(b,d)

a = max(0, b-a)

print(a)


Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d=map(int,input().split());print(max(0,min(c,d)-max(a,b))

a,b,c,d=map(int,input().split());print(max(0,min(c,d)-max(a,b)))

a,b,c,d=map(int,input().split());print(max(0,min(b,d)-max(a,c)))

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d = map(int, input().split())
if a > c:
    a,b,c,d = c,d,a,b
if b < c:print(0)
elif b => c and b < d:print(b-c)
else : print(d-c)

a,b,c,d = map(int, input().split())
if a > c:
    a,b,c,d = c,d,a,b
if b < c:print(0)
elif b => c and b < d:print(b-c)
else : print(d-c)

a,b,c,d = map(int, input().split())
if a > c:
    a,b,c,d = c,d,a,b
print(a,b,c,d)
if b < c:print(0)
elif b > c and b < d:print(b-c)
else : print(d-c)

a,b,c,d = map(int, input().split())
if a > c:
    a,b,c,d=c,d,a,b
if b < c:print(0)
elif b >= c and b < d:print(b-c)
else : print(d-c)

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
A,B,C,D = list(map(int,input().split()))


if A < C:
  a = C
else:
  a = A

if B < D:
  b = B
else:
  b = D
  
if B =< C or D =< A:
  res = 0
else:
  res = (b-a)
  
print(res)



A,B,C,D = (map(int,input().split()))
 
if B<C or A<D:
    res = 0
else:
    res = min(B,D) - max(A,C)
print(res)

A,B,C,D = (map(int,input.split()))

if B<C:
    res = 0
else:
    res = min(B,D) - max(A<C)
print(res)

A,B,C,D = (map(int,input().split()))
 

res = min(B,D) - max(A,C)
if res <0:
	print(0)
else:
	print(res)

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a = list(input().split())

if max(a[0],a[2]) < min(a[1],a[3]):
    print(int(min(a[1],a[3])-int(max(a[0],a[2])))
              
              
              
else if max(a[0],a[2]) >= min(a[1],a[3]):
    print(0)       


a = list(input().split())
if a[0] >= a[3] or a[2] >= a[1]:
    print(0)

elif a[0] <= a[2] < a[3] <= a[1]:
    print(int(a[3])-int(a[2]))
elif a[0] <= a[2] <= a[1] <= a[3]:
    print(int(a[1])-int(a[2]))
elif a[2] <= a[0] < a[1] <= a[3]:
    print(int(a[1])-int(a[0]))
elif a[2] <= a[0] <= a[3] <= a[1]:
    print(int(a[3])-int(a[0]))

a = list(input().split())

b = int(a[0])
c = int(a[1])
d = int(a[2])
e = int(a[3])

if max(b,d) < min(c,e):
    print(min(c,e)-max(b,d))       

elif max(b,d)>=min(c,e):
        print(0)
          

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
ABCD = list(map(int,input().split()))
if ABCD[1]<=ABCD[]2 or ABCD[3]<=ABCD[0]:
  print(0)
else:
  ABCD.sort()
  print(ABCD[2]- ABCD[1])

ABCD = list(map(int,input().split()))
if ABCD[1]<=ABCD[2] or ABCD[3]<=ABCD[0]:
  print(0)
else:
  ABCD.sort()
  print(ABCD[2]- ABCD[1])


Verdicts: Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a, b, c, d = map(int, input().split())

print(max(min(b, d) - max(a, c)), 0)


a, b, c, d = map(int, input().split())

print(max(min(b, d) - max(a, c), 0))


Verdicts: Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
import sys
a,b,c,d=map(int,input().split())
if c>=b :
	print(c-b)
else :
	print("0")

import sys
a,b,c,d=map(int,input().split())

if a >= d or c >= b:
	print (0)
else:
	print (min(b,d)-max(a,c))

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d=map(int,input().split())
print(max(0,min(b,d)-max(a,c))

a,b,c,d=map(int,input().split())
print(max(0,min(b,d)-max(a,c)))

Verdicts: Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
s = input().split()
A = int(s[0])
B = int(s[1])
C = int(s[2])
D = int(s[3])

a_c = max(A, C)
b_d = min(B, D)

if a_c - b_d:
  print(a_c - b_d)
else:
  print("0")

s = map(int, input().split())

A, B, C, D = [for i in s]

if D <= A or C >= B:
  print("0")
elif C <= A and D >= B:
  print(B - A)
elif C >= A and D >= B:
  print(B - C)
elif D <= B and C <= A:
  print(D - A)

s = input().split()
A = int(s[0])
B = int(s[1])
C = int(s[2])
D = int(s[3])
 
a_c = max(A, C)
b_d = min(B, D)
 
if b_d - a_c > 0:
  print(b_d - a_c)
else:
  print("0")

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
A, B, C, D = map(int, input().split())
print(len(set(range(A, B+1)) & set(range(A, B+1))))


A, B, C, D = map(int, input().split())
print(len(set(range(A, B+1)) & set(range(C, D+1))))


A, B, C, D = map(int, input().split())
res = list(set(range(A, B+1)) & set(range(C, D+1)))
try:
    print(res[-1] - res[0])
except:
    print(0)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d = map(int, input())
if b < c or d < a:
    ans = 0
else:
    ans = min(abs(c-b), abs(d-a))
print(ans)


a,b,c,d = map(int, input().split())
if b < c or d < a:
    ans = 0
else:
    ans = min(abs(c-b), abs(d-a), abs(b-a), abs(d-c))
print(ans)


Verdicts: Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
l = list(map(int.input().split()))

l.sort()

print(l[2]-l[1])

l = list(map(int,input().split()))

if l[1] < l[2]:
    print(0)
elif l[0] > l[4]:
    print(0)
else:
    print(l[2]-l[1])

l = list(map(int,input().split()))

if l[1] < l[2]:
    print(0)
elif l[0] > l[4]:
    print(0)
else:
    l.sort()
    print(l[2]-l[1])

l = list(map(int,input().split()))

if l[1] < l[2]:
    print(0)
elif l[0] > l[3]:
    print(0)
else:
    l.sort()
    print(l[2]-l[1])

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
A,B,C,D = map(int,input().split())
count = 0
for i in range(101):
	if (A<=i<=B and C<=i<=D):
		count += 1
print(count)

A,B,C,D = map(int,input().split())
count = 0
for i in range(101):
	if (A<=i<=B and C<=i<=D and A!=D and B!=C):
		count += 1
if (count>0):
	count -= 1
print(int(count))

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a, b, c, d = map(int, input().split())
print(min(c, d) - max(a, b))

a, b, c, d = map(int, input().split())
if a >= d or c >= b:
  print(0)
else:
  print(min(b, d) - max(a, c))


Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d = map(int, (input().split))
if a < c and b < d:
    print(b-c)
elif c < a and b < d:
    print(b-a)
elif a < c and d < b:
    print(d-c)
elif c < a and d < b:
    print(d-a)
else:
    print(0)

a,b,c,d = map(int, input().split)
if a < c and b < d:
    print(b-c)
elif c < a and b < d:
    print(b-a)
elif a < c and d < b:
    print(d-c)
elif c < a and d < b:
    print(d-a)
else:
    print(0)

a,b,c,d = map(int, (input().split()))


if a <= c and b <= d and c <= b:
    print(b-c)
elif c <= a and b <= d:
    print(b-a)
elif a <= c and d <= b:
    print(d-c)
elif c <= a and d <= b and a <= d:
    print(d-a)
else:
    print(0)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
A, B, C, D = map(int, input())
s = max(A, C)
e = min(B, D)
span = max(0, e - s)
print(span)

A, B, C, D = map(int, input().split())
s = max(A, C)
e = min(B, D)
span = max(0, e - s)
print(span)

Verdicts: Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a, b, c, d = map(int, input().split())
ans = max(0, min(b, d)) - max(a, c))
print(ans)

a, b, c, d = map(int, input().split())
ans = max(0, min(b, d) - max(a, c))
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a, b, c, d = map(int, input().split())
if min(b, d) - max(a, c) < 0:
    print(0)
else:
    min(b, d) - max(a, c)

a, b, c, d = map(int, input().split())
if min(b, d) - max(a, c) < 0:
    print(0)
else:
    print(min(b, d) - max(a, c))

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d=map(int,input().split())
print(max(0,max(a,c)-min(b,d)))

a,b,c,d=map(int,input().split())
print(max(0,min(b,d)-max(a,c)))

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d=map(int(),input().split())
print(max(0,min(a,c)-max(b,d))

a,b,c,d=map(int,input().split())
print(max(0,min(b,d)-max(a,c)))

Verdicts: Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
# coding: utf-8

a, b, c, d = map(int, input().split())

if c <= b:
	if c <= d:
	  print(b - c)
	 else:
	 	print(d - c)
else:
	print(0)


# coding: utf-8

a, b, c, d = map(int, input().split())

alice_time = range(a, b+1)
bob_time = range(c, d+1)
pushed_time = set(alice_time) & set(bob_time)

print(alice_time)
print(bob_time)

if not pushed_time:
	print (pushed_time[0] - pushed_time[-1])

# coding: utf-8

a, b, c, d = map(int, input().split())
alice_time = [x for x in range(a, b+1)]
bob_time = [x for x in range(c, d+1)]
pushed_time = set(alice_time) & set(bob_time)

if len(pushed_time) == 0:
  print(0)
else:
  print(pushed_time - 1)

# coding: utf-8

a, b, c, d = map(int, input().split())
alice_time = [x for x in range(a, b+1)]
bob_time = [x for x in range(c, d+1)]
pushed_time = set(alice_time) & set(bob_time)

if len(pushed_time) == 0:
	print(0)
else:
	print(pushed_time - 1)

# coding: utf-8

a, b, c, d = map(int, input().split())

alice_time = range(a, b+1)
bob_time = range(c, d+1)
pushed_time = set(alice_time) & set(bob_time)

print(alice_time)
print(bob_time)

if not pushed_time:
  print (pushed_time[0] - pushed_time[-1])

# coding: utf-8

a, b, c, d = map(int, input().split())
alice_time = [x for x in range(a, b+1)]
bob_time = [x for x in range(c, d+1)]
pushed_time = set(alice_time) & set(bob_time)

if len(pushed_time) == 0:
  print(0)
else:
  print(len(pushed_time) - 1)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a, b, c, d = map(int, input().split())
a_b = [i for i in range(a, b+1)]
c_d = [i for i in range(c, d+1)]
counter = 0

for i in range(len(a_b)):
  for j in range(len(c_d)):
    if a_b[i] == c_d[j]:
      counter += 1

print(counter)

a, b, c, d = map(int, input().split())
a_b = [i for i in range(a, b+1)]
c_d = [i for i in range(c, d+1)]
counter = -1
flg = "False"

for i in range(len(a_b)):
  for j in range(len(c_d)):
    if a_b[i] == c_d[j]:
      counter += 1
      flg = "True"

if flg == "True":
  print(counter)
else:
  print(0)

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
if b<=c:
    print(0)
elif d<=a:
    print(0)
elif c>=a and d<=b:
    print(d-c)
elif c>=a and c<=b and d>=b:
    print(b-c)
elif a>=c and a<=d and d<=b:
    print(d-a)
elif a>=c and b<=d:
    print(b-a)
else:
    print(err)

a,b,c,d=map(int,input().split())

if min(b,d)-max(a,c)>=0:
    print(min(b,d)-max(a,c))
else:
    print(0)


Verdicts: Runtime Error

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
A, B, C, D = map(int,input().split())
x = max(A, B)
y = min(C, D)
if(y-x > 0):
  print(y - x)
else:
  print(0)


a, b, c, d = map(int,input().split())
ans = 0
if(min(b, d)-max(a, c) > 0):
  ans = min(b, d)-max(a, c)
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a,b,c,d=map(int,input().split())
print(max(min(c,d)-max(a,b),0))

a,b,c,d=map(int,input().split())
print(max(min(b,d)-max(a,c),0))

Verdicts: Wrong Answer

Accepted
Problem: Alice and Bob are controlling a robot. They each have one switch that controls the robot.   Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.   Bob started holding down his button C second after the start-up, and released his button D second after the start-up.   For how many seconds both Alice and Bob were holding down their buttons?

Submission attempts (in order):
a, b , c ,d = map(int, input().split())


if b < c:
    print("0")
    exit()

if c<b and b<d:
    print((d-c)-(d-b))
elif a<c adn d<b:
    print(d-c)
else:
    print("0")



a, b , c ,d = map(int, input().split())



if b<c:
    print("0")
elif a<c and (c<b and b<d):
    print(b-c)
elif (a<c and a<d) and (c<b and d<b):
    print(d-c)
elif (c<a and a<d) and (c<b and b<d):
    print(b-a)
elif (c<a and a<d) and (c<b and d<b):
    print(d-a)
elif d<a:
    print("0")

print("0")




if b <= c:
    print("0")
elif c <= a:
    print("0")



if a<c and (c<b and b<d):
    print(b-c)
elif (a<c and a<d) and (c<b and d<b):
    print(d-c)
elif (c<a and a<d) and (c<b and b<d):
    print(b-a)
elif (c<a and a<d) and (c<b and d<b):
    print(d-a)
else:
    print("0")


a, b , c ,d = map(int, input().split())



mi = min(b,d )
ma = max(a,c)

print(max(0,mi - ma))

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted