TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

s = rr()
print('YNeos'[s!=reversed(s)::2])










s=rr()
print('YNeos'[s[0]!=s[2]::2])

import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

s = rr()
print('YNEOS'[s!=reversed(s)::2])










import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

s = rr()
print('YNEOS'[s==reversed(s)::2])










s=input()
print('YNeos'[s[0]!=s[2]::2])


Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
n = str(input())

print('yes' if n[0] == n[2] else 'No')

n = str(input())

print('Yes' if n[0] == n[2] else 'No')

Verdicts: Wrong Answer

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
s - input()
if s[0] == s[-1]:
  print("Yes")
else:
  print("No")

s = input()
if s[0] == s[-1]:
  print("Yes")
else:
  print("No")


Verdicts: Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
n = list(input())

if n==n[::-1]:
    print("YES")
else:
    print("NO")


n = list(input())

if n==n[::-1]:
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
n = input()
if n[0]=n[2]:
  print('Yes')
else:
  print('No')


n = input()
if n[0]=n[2]:
  priint('Yes')
else:
  print('No')

n = input()
if n[0]==n[2]:
  print('Yes')
else:
  print('No')


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
n_str = input()
n_list = list(n_str)
if n_list == n_list.reverse():
    print("Yes")
else:
    print("No")

n_str = input()
n_list = list(n_str)
n_list_reverse = n_list.reverse()
if n_list == n_list_reverse:
    print("Yes")
else:
    print("No")

n_str = input()
n_list = list(n_str)
n_list_reverse = list(n_str)
n_list_reverse.reverse()
if n_list == n_list.reverse():
    print("Yes")
else:
    print("No")


n_str = input()
n_list = list(n_str)
n_list_reverse = list(n_str)
n_list_reverse.reverse()
if n_list == n_list_reverse():
    print("Yes")
else:
    print("No")

n_str = input()
n_list = list(n_str)
n_list_reverse = list(n_str)
n_list_reverse.reverse()
if n_list == n_list_reverse:
    print("Yes")
else:
    print("No")


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
a = input()
if a[1] == a[2]:
  print('Yes')
else:
  print('No')

a = int(input())
if a == a[::-1]:
  print('Yes')
else:
  print('No')

a = int(input())
if a == a[::-1]:
  print('Yes')
else:
  print('No')

a = input()
if a == a[::-1]:
  print('Yes')
else:
  print('No')

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
N=input()
if N==N[::-1]:
 print('yes')
else:
 print('no')

N=input()
if N==N[::-1]:
 print('Yes')
else:
 print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
a=input()
for i in range(len(a)):
  if not a[i]==a[len(a)-1-i]:
    ans=1
if ans==1:
  print("No")
else:
  print("Yes")

a=input()
ans=0
for i in range(len(a)):
  if not a[i]==a[len(a)-1-i]:
    ans=1
if ans==1:
  print("No")
else:
  print("Yes")

Verdicts: Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
n = int(input())
print("Yes") if n[0] == n[2] else print("No")

n = input()
print("Yes") if n[0] == n[2] else print("No")


Verdicts: Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
a = input().split()
ast = int(a[0])
aen = int(a[1])
bst = int(a[2])
ben = int(a[3])
if ast > ben or bst > aen:
    print("0")
elif ast < bst and aen < ben:
    print(aen - bst)
elif ast < bst and aen > ben:
    print(ben - bst)
elif bst < ast and ben < aen:
    print(ben -ast)
elif bst < ast and ben > aen:
    print(aen - ast)
elif ast == bst and aen < ben:
    print(aen - ast)
elif ast == bst and aen > ben:
    print(ben - ast)
elif ast < bst and aen == ben:
    print(ben - bst)
elif ast > bst and aen == ben:
    print(aen - ast)
elif ast == bst and aen == ben:
    print(aen - ast)
else:
    print("0")


a = input()
i = 0
n = 1
time = len(a)
ans = "Yes"
while i < time:
    if a[i] == a[-n]:
        pass
    else:
        ans = "No"
    i += 1
    n -= 1
print(ans)


a = input()
i = 0
n = 1
time = len(a)
ans = "Yes"
while i < time:
    if a[i] == a[-n]:
        pass
    else:
        ans = "No"
    i += 1
    n += 1
print(ans)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
print("Yes" if input()[0]==input()[1] else "No")

a,b,c = input()
print("Yes" if a=c else "No")

a,b,c = input()
print("Yes" if a==c else "No")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

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

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

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


# coding: utf-8

n = int(input()) 
t = sorted([int(input()) for i in range(n)])

def gcd(a, b):
  while b:
    a, b = b, a % b
  return a
	
def lcm(a, b):
  return a * b // gcd(a, b)
	
def nlcm(list):
  if len(list) > 2:
  	lcm_num = lcm(list[0], list[1])
    for i in range(2, len(list)):
      lcm_num = lcm(lcm_num, list[i])
    print(lcm_num)
  elif len(list) == 2:
    print(lcm(list[0], list[1]))
  else:
  	print(len[-1])


nlcm(t)


# coding: utf-8

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

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


# coding: utf-8

a = input()
if a[0] == a[-1]:
	print("Yes")
else:
	print("No")


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
n = str(input())
print("Yes" if n[0] == n[1] else "No")

n = str(input())
print("Yes" if n[0] == n[2] else "No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
moji = input()
if (moji[0]==moji[2]):
  print("Yes")
else: 
  print("No)

moji = input()
if (moji[0]==moji[1]):
  print("Yes")
else: 
  print("No)

moji = input()
if (moji[0]==moji[2]):
  print("Yes")
else: 
  print("No")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
def main():
    N = int(input().strip())
    res = int(input().strip())
    if N == 1:
        print(res)
        return
    for _ in range(1, N):
        t = int(input().strip())
        res = lcm(res, t)
    print(res)


def lcm(a, b):
    return (a * b) / gcd(a, b)


def gcd(a, b):
    if b == 0:
        return a
    if b == 1:
        return 1
    if b > a:
        return gcd(b, a)
    else:
        return gcd(b, a % b)

if __name__ == '__main__':
    main()


def main():
    N_str = input().strip()
    if N_str == N_str[::-1]:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()


Verdicts: Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
a = int(input())
if a[0]==a[3]:
  print("Yes")
else:
  print("No")

a = input()
if a[0]==a[3]:
  print("Yes")
else:
  print("No")


a = input()
if a[0]==a[2]:
  print("Yes")
else:
  print("No")


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
A = input()

B = A[::-1]
flag = True
for i in range(len(A)):
    if A[i] != B[i]:
        flag = False
        break

if flag: print('YES')
else: print('NO')

A = input()

B = A[::-1]
flag = True
for i in range(len(A)):
    if A[i] != B[i]:
        flag = False
        break

if flag: print('Yes')
else: print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

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())
x = max(A, C)
y = min(B, D)
if(y-x > 0):
  print(y - x)
else:
  print(0)


N = input()
ans = "No"
if(N == N[::-1]):
  ans = "Yes"
print(ans)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
N = input()
print('Yes' if reversed(N) == N else 'No')

N = input()
print('Yes' if ''.join(list(reversed(N))) == N else 'No')


Verdicts: Wrong Answer

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
#ABC070A
n = input().split()
print("Yes" if (a[-1] == a[0]) else "No")

#ABC070

n = input()
print("Yes" if n==n[::-1] else "No")

Verdicts: Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
def palindromic_number():
    n = input()
    n_reversed = ''.join(list(reversed(n)))
    print(n_reversed)
    if n == n_reversed:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    palindromic_number()


def palindromic_number():
    n = input()
    n_reversed = ''.join(list(reversed(n)))
    if n == n_reversed:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    palindromic_number()


Verdicts: Wrong Answer

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
# 2019/07/11

import sys
from heapq import heappop,heappush

input=sys.stdin.readline

n=int(input())
edge=[[] for _ in range(n)]
for _ in range(n-1):
    u,v,c=map(int,input().split())
    u-=1
    v-=1
    edge[u].append((c,v))
    edge[v].append((c,u))


def dijkstra(s):
    d=[float('inf')]*n
    visited=[False]*n
    d[s]=0
    visited[s]=True
    que=[]
    for e in edge[s]:
        heappush(que,e)
    while que:
        c,v=heappop(que)
        if visited[v]:continue
        d[v]=c
        visited[v]=True
        for cost,vtx in edge[v]:
            if visited[vtx]:continue
            hq=(cost+d[v],vtx)
            heappush(que,hq)

    return d

q,k=map(int,input().split())
k-=1

res=dijkstra(k)
for _ in range(q):
    x,y=map(int,input().split())
    x-=1
    y-=1
    print(res[x]+res[y])



n=input()
print('Yes' if n==n[::-1] else 'No')

Verdicts: Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
a,b,c=input()
if a==c, print('Yes')
else print('No')

a,b,c=input()
print('yes' if a==c,else 'no')

a,b,c=input()
print('yes' if a==c else 'no')

a,b,c=input()
print('Yes' if a==c,else 'No')

a,b,c=input()
print('Yes'  if a==c else  'No')

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
s=map(int, input().split())
print("Yes" if s[0]==s[-1] else "No")

s= input()
print("Yes" if s[0]==s[-1] else "No")

Verdicts: Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
print("YNeos"[if not int(input())%101 in range(0,100,10)::2])

print("YNeos"[not int(input())%101 in range(0,100,10)::2])

Verdicts: Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
n = input()
if n[0] == n[2]:
  print("YES")
else:
  print("NO")

n = input()
if n[0] == n[2]:
  print("Yes)
else:
  print("No")

n = input()
if n[0] == n[2]:
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
N = input()

if N[0] == N[2]:print("yes")
else:print("no")


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

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

N = input()

if N[0] == N[2]:print("Yes")
else:print("No")


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

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

n = input()
if n[0] == n[2]:
    print("Yes")
else:
    print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
a,b,c=input()
a=int(a)
b=int(b)
if a==c:
  print("Yes")
else:
  print("No")

a,b,c=int(input())
if a==b:
  print("Yes")
else:
  print("No")

a,b,c=int(input())
if a==c:
  print("Yes")
elif a!=c:
  print("No")

a,b,c=int(input())
if a==c:
  print("Yes")
else:
  print("No")

a,b,c=input()
a=int(a)
c=int(c)
if a==c:
  print("Yes")
else:
  print("No")

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
n = list(input())
if n(0) == n(2):
  print("Yes")
else:
  print("No")

a, b, c = input()

if a == c:
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
n = int(input())

if n[0] == n[2]:
  print("Yes")
else:
  print("No")

n = input()

if n[0] == n[2]:
  print("Yes")
else:
  print("No")

Verdicts: Runtime Error

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
n = input()
print("Yes" if n == reversed(n) else "No")

n = input()
print("Yes" if n == n[::-1] else "No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
N = list(input())
M = N.sort()
if N == M :
    print('Yes')
else :
    print('No')

N = list(input())
a = ''.join(N)
N.reverse()
b = ''.join(N)
if a == b :
    print('Yes')
else :
    print('No')

Verdicts: Wrong Answer

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
n=input()
print("YES" if n[0]==n[-1] else "NO")

N = input()
print("Yes" if N == N[::-1] else "No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
N = str(input())
if N == N[-1::]:
    print("Yes")
else:
    print("No")

N = str(input())

if N == N[::-1]:
    print("Yes")
else:
    print("No")

Verdicts: Wrong Answer

Accepted
Problem: You are given a three-digit positive integer N.   Determine whether N is a _palindromic number_.   Here, a palindromic number is an integer that reads the same backward as forward in decimal notation.

Submission attempts (in order):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll ;


int main() {
  string n_str = 0;
  cin >> n_str ;
  if ( n_str[0] == n_str[2] ) puts( "Yes" ) ;
  else                        puts( "No" ) ;

  return 0 ;
}



a, b, c = input()
print( "Yes" if a==c else "No" )


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 A<=C:
  if D<=B:
    t=B-C
  else:
    t=D-C
else:
  if D<=B:
    t=B-A
  else:
    t=D-A
  t=D-A
if t<=0:
  print(0)
else:
  print(t)

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

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):
import sys
a,b,c,d = map(int, sys.stdin.readline().split())

alice = set(range(a, b+1))
bob = set(range(c, d+1))

print(len(alice & bob))

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

alice = set(range(a, b+1))
bob = set(range(c, d+1))

ans = len(alice & bob)

print(max(ans - 1, 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 = input().split(' ')
A, B, C, D = int(A), int(B), int(C), int(D)
 
print(max(min(D, B) - max(C, A), 0)

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

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

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

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

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

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

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

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

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=map(int,input().split())
Alice=range(a,b+1)
Bob=range(c,d+1)
Alice_Bob=set(Alice)+set(Bob)
print(len(Alice_Bob))

a,b,c,d=map(int,input().split())
Alice=range(a,b+1)
Bob=range(c,d+1)
Alice_Bob=set(Alice)&set(Bob)
if len(Alice_Bob)!=0:
  print(len(Alice_Bob)-1)
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())
if C > A:
    C ,A = A ,C
    B ,D = D, B

if B <= C:
    print(0)
    quit()
if A<=C and C <=B:
    print(B-C)
    quit()
if A<=C and D <=B:
    print(D-C)
    quit()


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

if B <= C:
    print(0)
elif A<=C and C <=B and D<=B:
    print(D-C)
elif A<=C and C <=B and B <= D:
    print(B-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())
A=[0 for i in range(101)]
for i in range(a,b+1):
  A[i]+=1
for j in range(c,d+1):
  A[j]+=1
print(A.count(2))

a,b,c,d=map(int,input().split())
A=[0 for i in range(100)]
for i in range(a,b):
  A[i]+=1
for j in range(c,d):
  A[j]+=1
print(A.count(2))


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())

A_B = B-A
C_D = D-C

list_A_B =range(A_B)
list_C_D =range(C_D)

list_judge =[]

for i in list_A_B:
    for j in list_C_D:
        if i == j:
            list_judge.append(j)

print(len(list_judge))



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

list_A_B =range(A,B)
list_C_D =range(C,D)

list_judge =[]


# print(list_C_D)

for i in list_A_B:
    for j in list_C_D:
        if i == j:
            list_judge.append(i)
        else:
            pass

print(len(list_judge))



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=min(c,d)-max(a,b)
if ans<=0:
  print(0)
else:
  print(ans)

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

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)
else:
  print(min(d,b)-max(a-c))

a,b,c,d=map(int,input().split())
 
if b<=c or d<=a:
  print(0)
else:
  print(min(d,b)-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):
a,b,c,d = map(int, input().split())
if c >= b or a >= d:
    print(0)
else:
    if a <= c:
        print(min(b-c,d-c))
    else:
        print(min(d-a,b-a)
    

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

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())
s = A if A > B else B
e = C if C < D else D
if e < s:
    print(0)
else:
    print(e-s)

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

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)
elif a<=c and b<=d:
    print(b-c)
elif a<=c and d<=b:
    print(d-c)
elif c<=a and b<=d:
    print(b-a)
elif c<=a and d<=b:
    print(d-a)
elif d<=a
    print(0)

a,b,c,d = map(int,input().split())
if c<b:
    distance = min(b,d) - max(a,c)
    print(max(0,distance))
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())
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: 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())
end = min((a + b),(c + d))
start max(a,c)
r = max(0, end - start)
print(r)


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

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

r = max(0, end - start)
print(int(r))


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())
init = max(A, C)
end = min(B, D)
print(init-end if init < end else 0)

with open(0) as f:
    a, b, c, d = map(int, f.read().split())
f = lambda x: 0 if x < 0 else x
print(f(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(b-c)
elif b<=a<=d<=c:
  print(d-a)
elif a<=c<=d<=b:
  print(d-c)
elif c<=a<=b<=d:
  print(b-a)
elif b=c or a=d:
  print(1)
else:
  print(0)

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

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

print(max(0, t))

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 = [int(i) for i in input().split()]
if c >= b or d >= a:
  print(0)
else:
  if a <= c and b >= d:
    print(d-c)
  elif c < a and b < d:
    print(b-a)
  elif a <= c < b <= d:
    print(b-c)
  else:
    print(d-a)

a,b,c,d = [int(i) for i in input().split()]
if c >= b or d <= a:
  print(0)
else:
  if a <= c and b >= d:
    print(d-c)
  elif c < a and b < d:
    print(b-a)
  elif a <= c < b <= d:
    print(b-c)
  else:
    print(d-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):
import numpy as np

A, B, C, D = map(int, input().split())
x = zip(*sorted(zip([A, B, C, D], [1, -1, 1, -1])))
if x[1][1] == 1:
  print(x[2][0] - x[1][0])
else:
  print(0)


x = map(int, input().split())
x = sorted(zip(x, [1, -1, 1, -1]))
if x[1][1] == 1:
  print(x[2][0] - x[1][0])
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())
print(max(C-B, 0))

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: 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 = list(map(int, input()))
print(max(0, min(b, d) - max(a, c)))

a, b, c, d = list(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):
a=int(input())
b=int(input())
c=int(input())
d=int(input())

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

a=int(input())
b=int(input())
c=int(input())
d=int(input())

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

s = input().split()
a=int(s[0])
b=int(s[1])
c=int(s[2])
d=int(s[3])

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

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().split())
print(max(0,min(b,d)-max(a,c)))

a,b,c,d=map(int.input().split())
print(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

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,min(C,D))-max(A,B)))

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

s=min(B,D)-max(A,C)
print(max(0,s))

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=set([for i in range(A, B+1)])
print(sum([1 for i in range(C, D+1) if i in X]))

A, B, C, D=map(int, input().split())
X=set([i for i in range(A, B+1)])
print(sum([1 for i in range(C, D+1) if i in X]))


A, B, C, D=map(int, input().split())
X=set([i for i in range(A, B)])
print(sum([1 for i in range(C, D) if i in X]))

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())
ret = max(b,d) - min(a,c)
if ret > 0 :
    print(ret)
else:
    print("0")

def mi(x,y):
    if (x - y) > (y - x):
        return x - y
    else:
        return y - x

def ma(x,y):
    if (x - y) > (y - x):
        return y - x
    else:
        return x - y


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

print(ma(b,d) - mi(a,c))


def ko(x,y):
    if (x - y) > (y - x):
        return x - y
    else:
        return y - x

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

print(ko(b,d) - ko(a,c))

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

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())
ans = max(0, max(a, c) - min(b, d))
print(ans)


a, b, c, d = map(int, input().split())
ans = max(0, 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(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):
a,b,c,d = map(int,input().split())
e = max(a,c)
f = min(b,d)

print(min(0,f-e))

a,b,c,d = map(int,input().split())
e = max(a,c)
f = min(b,d)

print(max(0,f-e))



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())
S,F,countS,countF = 0,0,0,0
if a<=c:
  countS = c
  S = a
else:
  countS = a
  S = c
if b <= d:
  countF = b
  F = d
else:
  countF = d
  F = b
count=0
flagC = False
for i in range(S,F+1):
  if i == countS:
    flagC = True
  if flagC:
    count+=1
  if i == countF:
    break
print(count)


a,b,c,d=map(int,input().split())
S,F,countS,countF = 0,0,0,0
if a<=c:
  countS = c
  S = a
else:
  countS = a
  S = c
if b <= d:
  countF = b
  F = d
else:
  countF = d
  F = b
count=0
flagC = False
for i in range(S,F+1):
  if flagC:
    count+=1
  if i == countS:
    flagC = True
  if i == countF:
    break
print(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())

def judge(ans):
	if ans > 0:
		print(ans)
	else:
		print(0)

if A < C :
	if D < B: judge(D-C)
	else: judge(B-C)
else:
	if B > D:
		judge(C-D)
	else:
		judge(C-B)

print(0)


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

def judge(ans):
	if ans > 0:
		print(ans)
	else:
		print(0)

if A < C :
	if B < D: 
		judge(B-C)
	else: 
		judge(D-C)
else:
	if B > D:
		judge(D-A)
	else:
		judge(B-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):
0 33 66 99

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

Verdicts: Runtime Error

Accepted