ZhenlongDai/ACPR huggingface dataset:
Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())
L = [0] * M
R = [0] * M
for i in range(M):
  L[i], R[i] = map(int,input().split())
  
count = 0

for i in range(N):
  if max(L) <= i <= min(R):
    count += 1

print(count)

Failing test case input:
4 2
1 4
2 4

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
L = [0] * M
R = [0] * M

for i in range(M):
  L[i], R[i] = map(int,input().split())

print(max(0, min(R) - max(L) + 1))

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())
a = []
for i in range(M):
    a.append(list(map(int, input().split())))
L = []
R = []
for j in range(M):
    L.append(a[j][0])
    R.append(a[j][1])
print(min(R) - max(L) +1)

Failing test case input:
10 3
3 4
7 7
8 9

Expected output:
0


Actual output:
-3


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
a = []
for i in range(M):
    a.append(list(map(int, input().split())))
L = []
R = []
for j in range(M):
    L.append(a[j][0])
    R.append(a[j][1])
if max(L) <= min(R):
  print(min(R) - max(L) +1)
else:
  print(0)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
if __name__ == '__main__':
    s = input().rstrip().split(' ')
    N = int(s[0])
    M = int(s[1])
    L = []
    R = []
    for i in range(M):
        s = input().rstrip().split(' ')
        L.append(int(s[0]))
        R.append(int(s[1]))

    res = list(range(1,N+1))
    res_min = 1
    res_max = N

    for i in range(M):
        res_min = max(res_min,L[i])
        res_max = min(R[i],res_max)

    print(res_max-res_min+1)


Failing test case input:
14 3
3 2
4 7
8 14

Expected output:
0


Actual output:
-5


Fixed submission (verdict: Accepted):
if __name__ == '__main__':
    s = input().rstrip().split(' ')
    N = int(s[0])
    M = int(s[1])
    L = []
    R = []
    for i in range(M):
        s = input().rstrip().split(' ')
        L.append(int(s[0]))
        R.append(int(s[1]))

    res = list(range(1,N+1))
    res_min = 1
    res_max = N

    for i in range(M):
        res_min = max(res_min,L[i])
        res_max = min(R[i],res_max)

    print(max(res_max-res_min+1,0))

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())
L, R = 1, N
for i in range(M):
	L_i, R_i = map(int, input().split())
	L, R = max(L, L_i), min(R, R_i)

print(R-L+1)



Failing test case input:
4 2
1 0
2 4

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
L, R = 1, N
for i in range(M):
	L_i, R_i = map(int, input().split())
	L, R = max(L, L_i), min(R, R_i)

print(max(0, R-L+1))
Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())
l, r = map(int, input().split())
for _ in range(M-1):
    new_l, new_r = map(int, input().split())
    if l < new_l:
        l = new_l
    if new_r < r:
        r = new_r

score = r-l+1
if score:
    print(score)
else:
    print(0)


Failing test case input:
15 3
3 2
4 7
3 11

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
l, r = map(int, input().split())
for _ in range(M-1):
    new_l, new_r = map(int, input().split())
    if l < new_l:
        l = new_l
    if new_r < r:
        r = new_r

score = r-l+1
if score > 0:
    print(score)
else:
    print(0)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())

minimum = 0
maximum = 10**8
for _ in range(M):
    L, R = map(int, input().split())
    minimum = L if minimum < L else minimum
    maximum = R if R < maximum else maximum
maximum = N if N < maximum else maximum

print(min(maximum - minimum + 1, N))


Failing test case input:
17 3
3 2
3 7
6 9

Expected output:
0


Actual output:
-3


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())

minimum = 0
maximum = 10**8
for _ in range(M):
    L, R = map(int, input().split())
    minimum = L if minimum < L else minimum
    maximum = R if R < maximum else maximum
maximum = N if N < maximum else maximum

print(max(min(maximum - minimum + 1, N), 0))

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m=map(int,input().split())
L=[]
R=[]
for i in range(m):
    l,r=map(int,input().split())
    L.append(l)
    R.append(r)
if max(L)>min(R):
    print(0)
else:
    print(min(R)-min(L)+1)

Failing test case input:
10 3
3 6
5 7
6 9

Expected output:
1

Actual output:
4


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
L=[]
R=[]
for i in range(m):
    l,r=map(int,input().split())
    L.append(l)
    R.append(r)
if max(L)>min(R):
    print(0)
else:
    print(min(R)-max(L)+1)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())

l = []
r = []
for i in range(m):
    temp = input().split()
    l.append(int(temp[0]))
    r.append(int(temp[1]))

a = min(l)
b = max(r)

ans = b - a + 1
if ans <= 0:
    ans = 0
print(ans)

Failing test case input:
3 2
1 1
2 4

Expected output:
0


Actual output:
4


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())

l = []
r = []
for i in range(m):
    temp = input().split()
    l.append(int(temp[0]))
    r.append(int(temp[1]))

a = max(l)
b = min(r)

ans = b - a + 1
if ans <= 0:
    ans = 0
print(ans)
Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M = map(int, input().split())
L = ['']*M
R = ['']*M

for i in range(M):
    L[i],R[i] = map(int, input().split())

gate_l,gate_r = max(L),min(R)
width = gate_l - gate_r + 1 if max(L)>=min(R) else 0

print(width)


Failing test case input:
111100 1
3 100110

Expected output:
100108


Actual output:
0


Fixed submission (verdict: Accepted):
N,M = map(int, input().split())
L = ['']*M
R = ['']*M

for i in range(M):
    L[i],R[i] = map(int, input().split())

id_l,id_r = max(L),min(R)
width = id_r - id_l + 1 if max(L)<=min(R) else 0

print(width)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = [int(x) for x in input().split()]

min = 0
max = 100000

for x in range(m):
  tmp_min, tmp_max = [int(y) for y in input().split()]
  if min < tmp_min:
    min = tmp_min
  if max > tmp_max:
    max = tmp_max
    
print(max - min + 1)

Failing test case input:
10 3
0 2
4 7
9 14

Expected output:
0


Actual output:
-6


Fixed submission (verdict: Accepted):
n, m = [int(x) for x in input().split()]
min_num = 0
max_num = n

for x in range(m):
    tmp_min, tmp_max = map(int, input().split())
    min_num = max(min_num, tmp_min)
    max_num = min(max_num, tmp_max)

if max_num - min_num + 1 > 0:
    print(max_num - min_num + 1)
else:
    print(0)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M = list(map(int, input().split()))

LR = []
max_L = 0
min_R = N
for i in range(M):
    LR = list(map(int, input().split()))
    if max_L < LR[0]:
        max_L = LR[0]
    if min_R > LR[1]:
        min_R = LR[1]

print(min_R-max_L+1)

Failing test case input:
8 3
-1 1
7 7
1 11

Expected output:
0


Actual output:
-5


Fixed submission (verdict: Accepted):
N,M = list(map(int, input().split()))

LR = []
max_L = 0
min_R = N
for i in range(M):
    LR = list(map(int, input().split()))
    if max_L < LR[0]:
        max_L = LR[0]
    if min_R > LR[1]:
        min_R = LR[1]

if min_R-max_L >= 0:
    print(min_R-max_L+1)
else:
    print(0)

Problem: p03037
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, m = map(int,input().split())
lst = []
for i in range(m):
    lst.append(list(map(int,input().split())))

min = lst[0][0]
max = lst[0][1]
for v in lst:
    if v[0] > min:
        min = v[0]
    if v[1] < max:
        max = v[1]
print(max-min + 1)

Failing test case input:
10 3
3 4
7 7
6 9

Expected output:
0


Actual output:
-2


Fixed submission (verdict: Accepted):
n, m = map(int,input().split())
lst = []
for i in range(m):
    lst.append(list(map(int,input().split())))

min = lst[0][0]
max = lst[0][1]
for v in lst:
    if v[0] > min:
        min = v[0]
    if v[1] < max:
        max = v[1]
if min <= max:
    print(max-min + 1)
elif min > max:
    print(0)
Problem: p03037
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,M=map(int,input().split())
temp=0
TEMP=N-1
for i in range(M):
    a,b=map(int,input().split())
    if a-1>temp:
        temp=a-1
    if TEMP>b-1:
        TEMP=b-1
print(TEMP-temp+1)


Failing test case input:
17 3
3 2
7 7
6 9

Expected output:
0


Actual output:
-4


Fixed submission (verdict: Accepted):
N,M=map(int,input().split())
temp=0
TEMP=N-1
for i in range(M):
    a,b=map(int,input().split())
    if b-1<temp or TEMP<a-1:
        print(0)
        exit()
    if a-1>temp:
        temp=a-1
    if TEMP>b-1:
        TEMP=b-1
    
print(TEMP-temp+1)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M=map(int,input().split())
L=[0]*M
R=[0]*M
for i in range(M):
  L[i],R[i]=map(int,input().split())
if M==1:
  print(R[0]-L[0]+1)
else:
  for i in range(M-1):
    L[i+1]=max(L[i],L[i+1])
    R[i+1]=min(R[i],R[i+1])
  print(R[M-1]-L[M-1]+1)

Failing test case input:
20 3
0 2
4 7
9 14

Expected output:
0


Actual output:
-6


Fixed submission (verdict: Accepted):
N,M=map(int,input().split())
L=[0]*M
R=[0]*M
for i in range(M):
  L[i],R[i]=map(int,input().split())
if M==1:
  print(R[0]-L[0]+1)
else:
  for i in range(M-1):
    L[i+1]=max(L[i],L[i+1])
    R[i+1]=min(R[i],R[i+1])
  if R[M-1]>=L[M-1]:
    print(R[M-1]-L[M-1]+1)
  else:
    print(0)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M=map(int, input().split())
lst=[list(map(int, input().split())) for _ in range(M)]
maxL, minR=-1, N
for L, R in lst:
  L, R=L-1, R-1
  maxL=max(maxL, L)
  minR=min(minR, R)
print(minR-maxL+1)

Failing test case input:
10 3
3 6
5 7
10 8

Expected output:
0


Actual output:
-3


Fixed submission (verdict: Accepted):
N, M=map(int, input().split())
lst=[list(map(int, input().split())) for _ in range(M)]
maxL, minR=-1, N
for L, R in lst:
  L, R=L-1, R-1
  maxL=max(maxL, L)
  minR=min(minR, R)
if minR>=maxL:
  print(minR-maxL+1)
else:
  print(0)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = list(map(int, input().split()))

left = 1
right = n
for i in range(m):
    l, r = list(map(int, input().split()))
    left = max(l, left)
    right = min(r, right)

print(right - left + 1)


Failing test case input:
10 3
3 2
4 7
3 11

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n, m = list(map(int, input().split()))

left = 1
right = n
for i in range(m):
    l, r = list(map(int, input().split()))
    left = max(l, left)
    right = min(r, right)

if left > right:
    print(0)
else:
    print(right - left + 1)
Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from operator import itemgetter
              

N, M = map(int, input().split())






cng = []
L_max=0
R_min=1000000000000
for i in range(M):
    L, R = map(int, input().split())
    if(L_max<=L):
        L_max=L
    if(R_min>=R):
        R_min=R
        
print(R-L)

Failing test case input:
10 3
3 6
5 7
10 8

Expected output:
0


Actual output:
-2


Fixed submission (verdict: Accepted):
from operator import itemgetter
import sys

N, M = map(int, input().split())


cng = []
L_max=0
R_min=float('inf')
for i in range(M):
    L, R = map(int, input().split())
    if(L_max<=L):
        L_max=L
    if(R_min>=R):
        R_min=R
        

if(R_min-L_max<0):
    print(0)
else:
    print(R_min-L_max+1)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())

start, end = 1, n
for _ in range(m):
  l, r = map(int, input().split())
  if r < start or l > end:
    start, end = 1, 0
    break
  elif l <= start and start <= r <= end:
    end = r
  elif start <= l <= end and end <= r:
    start = l
  else:
    start, end = l, r

print(end - start + 1)

Failing test case input:
8 3
1 7
7 7
2 11

Expected output:
1


Actual output:
10


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())

start, end = 1, n
for _ in range(m):
  l, r = map(int, input().split())
  if r < start or l > end:
    start, end = 1, 0
    break
  elif l <= start and start <= r <= end:
    end = r
  elif start <= l <= end and end <= r:
    start = l
  elif l <= start and r >= end:
    pass
  else:
    start, end = l, r

print(end - start + 1)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m = map(int,input().split())
lmax = -1
rmin = 10**100
for i in range(m):
    l,r = map(int,input().split())
    lmax = max(l,lmax)
    rmin  = min(r,rmin)
print(rmin - lmax + 1)


Failing test case input:
6 3
3 0
7 7
1 1

Expected output:
0


Actual output:
-6


Fixed submission (verdict: Accepted):
n,m = map(int,input().split())
lmax = -1
rmin = 10**100
for i in range(m):
    l,r = map(int,input().split())
    lmax = max(l,lmax)
    rmin  = min(r,rmin)
print(max(rmin - lmax + 1,0))

Problem: p03037
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,M = map(int, input().split())
l=0
r=N
for _ in range(M):
  ll,rr=map(int,input().split())
  l = max(l,ll)
  r = min(r,rr)
print(rr-ll+1)

Failing test case input:
10 3
3 2
4 7
6 11

Expected output:
0


Actual output:
6


Fixed submission (verdict: Accepted):
N,M = map(int, input().split())
l=0
r=N
for _ in range(M):
  ll,rr=map(int,input().split())
  l = max(l,ll)
  r = min(r,rr)
ans = r - l + 1
print(ans if ans > 0 else 0)
Problem: p03037
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N, M = list(map(int,input().split()))

L_li = []
R_li = []

for i in range(M):
    Li, Ri = list(map(int,input().split()))
    L_li.append(Li)
    R_li.append(Ri)

count = 0

for i in range(N):
    if max(L_li) <= N <= min(R_li):
        count += 1

print(str(count))

Failing test case input:
4 2
1 6
2 4

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
N, M = list(map(int,input().split()))

L_li = []
R_li = []

for i in range(M):
    Li, Ri = list(map(int,input().split()))
    L_li.append(Li)
    R_li.append(Ri)


ans = min(R_li) - max(L_li) + 1
if ans < 0:
    ans = 0
    
    
print(str(int(ans)))

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())
left = 0
right = m+1
for i in range(m):
    l, r = map(int, input().split())
    left = max(left, l)
    right = min(right, r)
ans = 0
for i in range(left-1, right):
    ans += 1
print(ans)


Failing test case input:
101010 1
1 001110

Expected output:
1110


Actual output:
2


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
left = 0
right = n+1
for i in range(m):
    l, r = map(int, input().split())
    left = max(left, l)
    right = min(right, r)
ans = 0
for i in range(left-1, right):
    ans += 1
print(ans)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())
l, r = [],[]
i_max = n -1
i_min = 0
for x in range(m):
    l, r = map(int, input().split())
    i_max = min(r, i_max)
    i_min = max(l, i_min)
    if (i_max - i_min) < 0:
        print(0)
        exit()

print(i_max - i_min + 1)

Failing test case input:
4 2
1 6
2 4

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
i_max = n
i_min = 0
for x in range(m):
    l, r = map(int, input().split())
    i_max = min(r, i_max)
    i_min = max(l, i_min)

print(max(0,i_max - i_min + 1))

Problem: p03037
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,m=list(map(int, input().split()))
l = 0
r = float("inf")
for _ in range(m):
    a,b = list(map(int, input().split()))
    l = max(l,a)
    r = min(r,b)

print(min(n, r-l+1))

Failing test case input:
10 3
3 2
7 7
6 5

Expected output:
0


Actual output:
-4


Fixed submission (verdict: Accepted):
n,m=list(map(int, input().split()))
l = 0
r = float("inf")
for _ in range(m):
    a,b = list(map(int, input().split()))
    l = max(l,a)
    r = min(r,b)

ans = r-l+1
if r < l:
    print(0)
elif ans <= n:
    print(ans)
else:
    print(n)
Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())
start = 1
end = n
for i in range(m):
    l, r = map(int, input().split())
    if start < l:
        start = l
    if r < end:
        end = r
print(end - start + 1)

Failing test case input:
7 3
3 4
7 7
8 9

Expected output:
0


Actual output:
-3


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
start = 1
end = n
for i in range(m):
    l, r = map(int, input().split())
    if start < l:
        start = l
    if r < end:
        end = r
print(max(end - start + 1, 0))

Problem: p03037
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n ,m = map(int, input().split())
L = []
R = []
for i in range(m):
    l, r = input().split()
    L.append(int(l))
    R.append(int(r))
x = min(R) - max(L) + 1
print(x)

Failing test case input:
6 3
3 0
5 7
1 1

Expected output:
0


Actual output:
-4


Fixed submission (verdict: Accepted):
n ,m = map(int, input().split())
L = []
R = []
for i in range(m):
    l, r = input().split()
    L.append(int(l))
    R.append(int(r))
x = min(R) - max(L) + 1
print(x if x > 0 else "0")

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
n,m = map(int,input().split())
ls = [list(map(int,input().split())) for i in range(m)]
a = ls[0][0]
b = ls[0][1]
for j in range(1,m-1):
    a = max(a,ls[j+1][0])
    b = min(b,ls[j+1][1])
    if b-a<0:
        print(0)
        sys.exit()
print(b-a+1)

Failing test case input:
4 2
1 3
1 0

Expected output:
0


Actual output:
3


Fixed submission (verdict: Accepted):
import sys
n,m = map(int,input().split())
ls = [list(map(int,input().split())) for i in range(m)]
a = ls[0][0]
b = ls[0][1]
for j in range(1,m):
    a = max(a,ls[j][0])
    b = min(b,ls[j][1])
    if b-a<0:
        print(0)
        sys.exit()
print(b-a+1)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m = map(int,input().split())
ans = 0
for i in range(m):
  l,r = map(int,input().split())
  d = range(l,r+1)
  for j in range(n):
    if j+1 in d:
      ans += 1
print(ans)

Failing test case input:
10 3
3 4
7 7
8 9

Expected output:
0


Actual output:
5


Fixed submission (verdict: Accepted):
n,m = map(int,input().split())
l_max,r_min = 0,n
for i in range(m):
    l,r = map(int,input().split())
    l_max = max(l,l_max)
    r_min = min(r,r_min)
print(max(r_min - l_max +1 , 0))

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())
L = 0
R = N
for i in range(M):
    l, r = map(int, input().split())
    L = max(L, l)
    R = min(R, r)

print(L - R + 1)

Failing test case input:
14 3
3 6
7 7
6 9

Expected output:
0


Actual output:
2


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
L = 0
R = N
for i in range(M):
    l, r = map(int, input().split())
    L = max(L, l)
    R = min(R, r)

print(max(0, R - L + 1))
Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())

lr = [list(map(int, input().split())) for i in range(m)]
left = lr[0][0]
right = lr[0][1]

for i in range(1, m):
    left = max(lr[i][0], left)
    right = min(lr[i][1], right)

print(right - left + 1)


Failing test case input:
10 3
0 2
4 9
9 14

Expected output:
0


Actual output:
-6


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())

lr = [list(map(int, input().split())) for i in range(m)]
left = lr[0][0]
right = lr[0][1]

for i in range(1, m):
    left = max(lr[i][0], left)
    right = min(lr[i][1], right)

if right - left + 1 > 0:
    print(right - left + 1)
else:
    print(0)

Problem: p03037
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N, M = map(int, input().split())

min_, max_ = map(int, input().split())

for _ in range(M-1):
    LL, MM = map(int, input().split())
    min_ = max(min_, LL)
    max_ = min(max_, MM)

print(max_ - min_ + 1)


Failing test case input:
8 3
0 1
7 7
1 11

Expected output:
0


Actual output:
-5


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())

min_, max_ = map(int, input().split())

for _ in range(M-1):
    LL, MM = map(int, input().split())
    min_ = max(min_, LL)
    max_ = min(max_, MM)


if min_ <= max_:
    print(max_ - min_ + 1)
else:
    print(0)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import defaultdict
n, m = map(int, input().split())
left = []
right = []
for i in range(m):
    l, r = map(int, input().split())
    left.append(l)
    right.append(r)

if min(right) < max(left):
    print(min(right) - max(left) + 1)
else:
    print(0)


Failing test case input:
20 3
0 2
4 7
9 14

Expected output:
0


Actual output:
-6


Fixed submission (verdict: Accepted):
from collections import defaultdict
n, m = map(int, input().split())
left = []
right = []
for i in range(m):
    l, r = map(int, input().split())
    left.append(l)
    right.append(r)

if min(right) >= max(left):
    print(min(right) - max(left) + 1)
else:
    print(0)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m = map(int,input().split())
l = [0]*m
r = [0]*m
for i in range(m):
    l[i],r[i] = map(int,input().split())
print(min(r) -max(l) + 1)

Failing test case input:
6 3
3 0
5 7
1 1

Expected output:
0


Actual output:
-4


Fixed submission (verdict: Accepted):
n,m = map(int,input().split())
l = [0]*m
r = [0]*m
for i in range(m):
    l[i],r[i] = map(int,input().split())
print(max(min(r) -max(l) + 1,0))
Problem: p03037
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def main():
    n, m = map(int, input().split())

    a = [1, n]
    for i in range(m):
        l, r = map(int, input().split())
        res = [max(a[0], l), min(a[1], r)]
    print(max(0, a[1]-a[0]+1))

if __name__ == '__main__':
    main()


Failing test case input:
101001 1
1 100011

Expected output:
100011


Actual output:
101001


Fixed submission (verdict: Accepted):
def main():
    n, m = map(int, input().split())

    res = [1, n]
    for i in range(m):
        l, r = map(int, input().split())
        res = [max(res[0], l), min(res[1], r)]
    print(max(0, res[1]-res[0]+1))

if __name__ == '__main__':
    main()

Problem: p03037
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, m = map(int, input().split())
l = 0
r = n + 1
for i in range(m):
    l_new, r_new = map(int, input().split())
    l = max(l, l_new)
    r = min(r, r_new)
print(r - l + 1)

Failing test case input:
6 3
3 0
5 7
1 1

Expected output:
0


Actual output:
-4


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
l = 0
r = n + 1
for i in range(m):
    l_new, r_new = map(int, input().split())
    l = max(l, l_new)
    r = min(r, r_new)
print(max(r - l + 1, 0))

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m=map(int,input().split())
l=[0]*m
r=[0]*m
for i in range(m):
  l[i],r[i]=map(int,input().split())
print(max(0,min(r)-max(l)))

Failing test case input:
100000 1
1 100000

Expected output:
100000

Actual output:
99999


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
l=[0]*m
r=[0]*m
for i in range(m):
  l[i],r[i]=map(int,input().split())
print(max(0,min(r)-max(l)+1))

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


n, m = map(int, input().split())
ma = 1
mi = n
for i in range(m):
    l, r  = map(int, input().split())
    ma = max(ma, l)
    mi = min(mi, r)

ans = mi - ma + 1
print(ans)


Failing test case input:
14 3
3 2
7 7
6 9

Expected output:
0


Actual output:
-4


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
ma = 1
mi = n
for i in range(m):
    l, r  = map(int, input().split())
    ma = max(ma, l)
    mi = min(mi, r)

ans = mi - ma + 1
if ans < 0:
    ans = 0
print(ans)

Problem: p03037
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,M = map(int, input().split())

n = 0
m = 999999

for i in range(M):
  a,b = map(int, input().split())
  n = max(a, n)
  m = min(b , m)

print(m - n + 1)


Failing test case input:
10 3
3 6
5 7
10 8

Expected output:
0


Actual output:
-3


Fixed submission (verdict: Accepted):
N,M = map(int, input().split())

n = 0
m = 999999

for i in range(M):
  a,b = map(int, input().split())
  n = max(a, n)
  m = min(b , m)

print(m-n+1 if (m >= n) else 0)
Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
tmp = input().split()
N = int(tmp[0])
M = int(tmp[1])

max = N
min = 0
for i in range(M):
  inputcard = list(map(int, input().split()))
  if min < inputcard[0]:
    min = inputcard[0]
  
  if max > inputcard[1]:
    max = inputcard[1]
  
print(max - min + 1)

Failing test case input:
17 3
3 2
7 7
6 9

Expected output:
0


Actual output:
-4


Fixed submission (verdict: Accepted):
tmp = input().split()
N = int(tmp[0])
M = int(tmp[1])

max = N
min = 0
for i in range(M):
  inputcard = list(map(int, input().split()))
  if min < inputcard[0]:
    min = inputcard[0]
  
  if max > inputcard[1]:
    max = inputcard[1]
  
if (max - min + 1 < 0):
  print(0)
else:
  print(max - min + 1)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m=map(int,input().split())
count=0
listl=[]
listr=[]
for i in range(m):
  l,r=map(int,input().split())
  listl.append(l)
  listr.append(r)
maxl=max(listl)
minr=min(listr)
print(minr-maxl+1)


Failing test case input:
10 3
3 2
10 7
6 5

Expected output:
0


Actual output:
-7


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
listl=[]
listr=[]
for i in range(m):
  l,r=map(int,input().split())
  listl.append(l)
  listr.append(r)
maxl=max(listl)
minr=min(listr)
if minr-maxl+1>=1:
  print(minr-maxl+1)
else:
  print(0)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def add(n):
    return False

N,M = map(int, input().split())
LR = [list(map(int, input().split())) for _ in range(M)]
L1 = []
R1 = []
for i in range(M):
    L1.append(LR[i][0])
    R1.append(LR[i][1])
if max(R1)>=max(L1):
    print(min(R1)-max(L1)+1)
else:
    print(0)

Failing test case input:
8 3
6 6
7 3
1 11

Expected output:
0


Actual output:
-3


Fixed submission (verdict: Accepted):
N,M = map(int, input().split())
LR = [list(map(int, input().split())) for _ in range(M)]
L1 = []
R1 = []
for i in range(M):
    L1.append(LR[i][0])
    R1.append(LR[i][1])
if min(R1)>=max(L1):
    print(min(R1)-max(L1)+1)
else:
    print(0)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())
l = 1
r = n
for _ in range(m):
    a, b = map(int, input().split())
    l = max(a, l)
    r = min(b, r)
print(r - l + 1)

Failing test case input:
8 3
0 1
7 7
1 11

Expected output:
0


Actual output:
-5


Fixed submission (verdict: Accepted):

n, m = map(int, input().split())
l = 1
r = n
for _ in range(m):
    a, b = map(int, input().split())
    l = max(a, l)
    r = min(b, r)
print(max(0, r - l + 1))
Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())
cnt = 0
l_max= 0
r_min = float('inf')
for i in range(m):
    l, r = map(int, input().split())
    l_max = max(l_max, l)
    r_min = min(r_min, r)
print(r_min - l_max + 1)


Failing test case input:
8 3
0 1
7 7
1 11

Expected output:
0


Actual output:
-5


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
l_max = 0
r_min = float('inf')
for i in range(m):
    l, r = map(int, input().split())
    l_max = max(l_max, l)
    r_min = min(r_min, r)
if r_min >= l_max:
    print(r_min - l_max + 1)
else:
    print('0')

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())
L = [0] * M
R = [0] * M

for i in range(M):
    L[i], R[i] = map(int, input().split())
LL = max(L)
RR = min(R)
if LL <= M <= RR:
    print(RR - LL + 1)
else:
    print(0)

Failing test case input:
7 1
3 4
7 7
8 9

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
L = [0] * M
R = [0] * M

for i in range(M):
    L[i], R[i] = map(int, input().split())
LL = max(L)
RR = min(R)
ans = 0
for i in range(N):
    if LL <= i + 1 <= RR:
        ans += 1
    else:
        pass
print(ans)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m=map(int,input().split())
l,r=1,n
for i in range(m):
    a,b=map(int,input().split())
    l=max(l,a)
    r=min(r,b)
print(r-l+1 if r>l else 0)

Failing test case input:
10 3
3 6
5 7
6 9

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
l,r=1,n
for i in range(m):
    a,b=map(int,input().split())
    l=max(l,a)
    r=min(r,b)
print(r-l+1 if r>=l else 0)

Problem: p03037
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,m = (int(x) for x in input().split())
l,r = (int(x) for x in input().split())

for i in range(m - 1):
	a,b = (int (x) for x in input().split())
	if l > r:
		continue
	if l < a:
		l = a
	if r > b:
		r = b

print(r - l + 1 if r > l else 0)

Failing test case input:
8 3
1 7
7 7
2 11

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
n,m = (int(x) for x in input().split())
l,r = (int(x) for x in input().split())

for i in range(m - 1):
	a,b = (int (x) for x in input().split())
	if l > r:
		continue
	if l < a:
		l = a
	if r > b:
		r = b

print(r - l + 1 if r >= l else 0)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M=map(int,input().split())
L=0
R=N

for _ in range(M):
  l,r=map(int,input().split())
  L=max(l,L)
  R=min(r,R)

print(R-L+1)

Failing test case input:
8 3
1 1
7 7
1 11

Expected output:
0


Actual output:
-5


Fixed submission (verdict: Accepted):
N,M=map(int,input().split())
L=0
R=N

for _ in range(M):
  l,r=map(int,input().split())
  L=max(l,L)
  R=min(r,R)

print(max(R-L+1,0))
Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import heapq                        
hq_left = []
hq_right = []


listA=[] 
N,M= map(int,input().split())

for i in range(M):
    listA.append(list(map(int,input().split())))


candidate_list = [i for i in range(1,N+1)]

for i in range(M):
    hq_left.append(listA[i][0])
    hq_right.append(listA[i][1])
    
if max(hq_left)-min(hq_right) <0:
    print(0)
else:
    print(max(hq_left)-min(hq_right)+1)

Failing test case input:
4 2
1 0
2 6

Expected output:
0


Actual output:
3


Fixed submission (verdict: Accepted):
hq_left = []
hq_right = []


listA=[] 
N,M= map(int,input().split())

for i in range(M):
    listA.append(list(map(int,input().split())))


candidate_list = [i for i in range(1,N+1)]

for i in range(M):
    hq_left.append(listA[i][0])
    hq_right.append(listA[i][1])

if min(hq_right)-max(hq_left) <0:
    print(0)
else:
    print(len(candidate_list[max(hq_left):min(hq_right)])+1)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from operator import itemgetter

N,M = [int(x) for x in input().split()]
LR = [[int(x) for x in input().split()]for _ in range(M)]
max_l = max(LR,key = itemgetter(0))[0]
min_r = min(LR,key = itemgetter(0))[1]
print(max(min_r-max_l+1,0))


Failing test case input:
4 2
1 6
2 4

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):
from operator import itemgetter

N,M = [int(x) for x in input().split()]
LR = [[int(x) for x in input().split()]for _ in range(M)]
max_l = max(LR,key = itemgetter(0))[0]
min_r = min(LR,key = itemgetter(1))[1]
print(max(min_r-max_l+1,0))

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m = map(int, input().split())
a = [0] * m
b = [0] * m
for i in range(m):
   a[i],b[i] = map(int, input().split())
if n < min(b):
    print(n - max(a) + 1)
else:
    print(min(b)-max(a) + 1)
    

Failing test case input:
20 3
0 3
4 7
9 24

Expected output:
0


Actual output:
-5


Fixed submission (verdict: Accepted):
n,m = map(int, input().split())
a = [0] * m
b = [0] * m
for i in range(m):
   a[i],b[i] = map(int, input().split())
if n < min(b) and n >= max(a):
    print(n - max(a) + 1)
elif min(b) >= max(a):
    print(min(b)-max(a) + 1)
else:
  print(0)
Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n, m = map(int, input().split())
max_value, min_value = -1, -1
for i in range(m):
  tmp_min_value, tmp_max_value = map(int, input().split())
  min_value = max([min_value, tmp_min_value]) if min_value >= 0 else tmp_min_value
  max_value = min([max_value, tmp_max_value]) if max_value >= 0 else tmp_max_value

min_value = min_value if min_value <= n else n
max_value = max_value if max_value <= n else n

print(max_value - min_value + 1)


Failing test case input:
8 3
3 0
7 7
1 9

Expected output:
0


Actual output:
-6


Fixed submission (verdict: Accepted):

n, m = map(int, input().split())
max_value, min_value = -1, -1
for i in range(m):
  tmp_min_value, tmp_max_value = map(int, input().split())
  min_value = max([min_value, tmp_min_value]) if min_value >= 0 else tmp_min_value
  max_value = min([max_value, tmp_max_value]) if max_value >= 0 else tmp_max_value

min_value = min_value if min_value <= n else n
max_value = max_value if max_value <= n else n

ret = max_value - min_value + 1
if ret < 0:
  ret = 0
print(ret)

Problem: p03037
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m,= map(int,input().split())  

l = [0]*m
r = [0]*m

for i in range(m):
    l[i],r[i] = map(int,input().split())
    


lmax = max(l)
rmin = min(r)

LR = [i for i in range(lmax,rmin+1)]


if lmax + 1 > n :
    print(0)
else:
    print(rmin-lmax+1)
    

Failing test case input:
4 2
1 0
2 4

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n,m,= map(int,input().split())  

l = [0]*m
r = [0]*m

for i in range(m):
    l[i],r[i] = map(int,input().split())
    


lmax = max(l)
rmin = min(r)

if (lmax<=rmin):
    print(rmin-lmax+1)
else:
    print(0)
Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
b = input()
c = input()
print(a[0],b[1],c[2])

Failing test case input:
pu`
qae
erf

Expected output:
paf


Actual output:
p a f


Fixed submission (verdict: Accepted):
a = input()
b = input()
c = input()
print(a[0]+b[1]+c[2])

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
c = list() 
for i in range(3):
	c.append(input(i))

print(c[0][0]+c[1][1]+c[2][2])


Failing test case input:
bqt
qea
rhd

Expected output:
bed


Actual output:
012bed


Fixed submission (verdict: Accepted):
c = list() 
for i in range(3):
	c.append(input())

print(c[0][0]+c[1][1]+c[2][2])

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
b = input()
c = input()
print(a[0],b[1],c[2])

Failing test case input:
qv`
fsa
egr

Expected output:
qsr


Actual output:
q s r


Fixed submission (verdict: Accepted):
a = input()
b = input()
c = input()
print(a[0]+b[1]+c[2])

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A = list(input())
B = list(input())
C = list(input())

print(A[0],B[1],C[2])

Failing test case input:
dst
oeb
rgf

Expected output:
def


Actual output:
d e f


Fixed submission (verdict: Accepted):
A = list(input())
B = list(input())
C = list(input())

print(A[0]+B[1]+C[2])

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
for i in range(3):
  c = input()
  print(c[i])

Failing test case input:
up`
asf
rge

Expected output:
use


Actual output:
u
s
e


Fixed submission (verdict: Accepted):
ans = ""
for i in range(3):
  c = input()
  ans += c[i]
print(ans)

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

s=[input() for _ in range(3)]
print(s[0][0]+s[1][0]+s[2][0])

Failing test case input:
rtd
epb
gfr

Expected output:
rpr


Actual output:
reg


Fixed submission (verdict: Accepted):

s=[input() for _ in range(3)]
print(s[0][0]+s[1][1]+s[2][2])

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
print(input()[0],input()[1],input()[2])

Failing test case input:
bqt
qea
rhd

Expected output:
bed


Actual output:
b e d


Fixed submission (verdict: Accepted):
print(input()[0],input()[1],input()[2],sep="")

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
print(input()[0])
print(input()[1])
print(input()[2])

Failing test case input:
eub
uca
pll

Expected output:
ecl


Actual output:
e
c
l


Fixed submission (verdict: Accepted):
print(input()[0]+input()[1]+input()[2])

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
data = [[i for i in input().split()] for i in range(3)]
num = 0
for i in data:
	for j in i:
		print(j[num])
		num+=1

Failing test case input:
csf
cub
mkn

Expected output:
cun


Actual output:
c
u
n


Fixed submission (verdict: Accepted):
data = [[i for i in input().split()] for i in range(3)]
num = 0
answer = ""
for i in data:
	for j in i:
		answer+=j[num]
		num+=1

print(answer)
Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s1=input()
s2=input()
s3=input()

print(s1[0],s2[1],s3[2])

Failing test case input:
scu
peb
rge

Expected output:
see


Actual output:
s e e


Fixed submission (verdict: Accepted):
s1=input()
s2=input()
s3=input()

print(s1[0]+s2[1]+s3[2])

Problem: p03415
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
print(open(0).read()[0::4])

Failing test case input:
uo`
ape
efr

Expected output:
upr


Actual output:
uae


Fixed submission (verdict: Accepted):
print(open(0).read()[0::5])

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
c = input()
c2 = input()
c3 = input()
print(c[0]+c[1]+c[2])

Failing test case input:
uo`
ape
rfe

Expected output:
upe


Actual output:
uo`


Fixed submission (verdict: Accepted):
c = input()
c2 = input()
c3 = input()
print(c[0]+c2[1]+c3[2])

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = 0
for i in range(3):
    li = input()
    print(li[i])
    i += 1


Failing test case input:
bqu
qea
rdh

Expected output:
beh


Actual output:
b
e
h


Fixed submission (verdict: Accepted):
a = 0
ans = ""
for i in range(3):
    li = input()
    ans += li[i]
    i += 1

print(ans)

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
c = [input() for i in range(3)]
print([c[i][i] for i in range(3)])

Failing test case input:
etd
uca
llp

Expected output:
ecp


Actual output:
e, c, p

Fixed submission (verdict: Accepted):
c = [input() for i in range(3)]

print("".join([c[i][i] for i in range(3)]))

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=input()
b=input()
c=input()
print('a[0]'+'b[1]'+'c[2]')

Failing test case input:
`vq
fra
efr

Expected output:
`rr


Actual output:
a[0]b[1]c[2]


Fixed submission (verdict: Accepted):
a=input()
b=input()
c=input()
print(a[0]+b[1]+c[2])

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

S = str(input())
T = str(input())
U = str(input())
print("{}".format(S[0]+S[1]+S[2]))

Failing test case input:
pv`
`qf
eer

Expected output:
pqr


Actual output:
pv`


Fixed submission (verdict: Accepted):

S = str(input())
T = str(input())
U = str(input())
print("{}".format(S[0]+T[1]+U[2]))

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=input()
b=input()
c=input()
print(a[0])
print(b[1])
print(c[2])

Failing test case input:
edu
bau
ooi

Expected output:
eai


Actual output:
e
a
i


Fixed submission (verdict: Accepted):
a=input()
b=input()
c=input()
print(a[0]+b[1]+c[2])

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
for i in range(3):
  s=input()
  print(s[i])

Failing test case input:
scu
peb
rge

Expected output:
see


Actual output:
s
e
e


Fixed submission (verdict: Accepted):
s=''
for i in range(3):
  temp=input()
  s=s+temp[i]
print(s)

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
print([input()[0],input()[1],input()[2]],sep="")

Failing test case input:
dsf
cua
nmk

Expected output:
duk


Actual output:
d, u, k

Fixed submission (verdict: Accepted):
print("".join([input()[0],input()[1],input()[2]]))
Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=(input() for _ in range(3))
print('a[0]+b[1]+c[2]')


Failing test case input:
scu
peb
rge

Expected output:
see


Actual output:
a[0]+b[1]+c[2]


Fixed submission (verdict: Accepted):
a,b,c=(input() for _ in range(3))
print(a[0]+b[1]+c[2])

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
res=''
for i in range(3):
  s=input()
  res+=s[i-1]
print(res)

Failing test case input:
cdu
aau
kom

Expected output:
cam


Actual output:
uao


Fixed submission (verdict: Accepted):
res=''
for i in range(3):
  s=input()
  res+=s[i]
print(res)

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
nums1 = input()
nums2 = input()
nums3 = input()


print(nums1[0], nums2[1], nums3[2])


Failing test case input:
ddu
cat
ion

Expected output:
dan


Actual output:
d a n


Fixed submission (verdict: Accepted):
nums1 = input()
nums2 = input()
nums3 = input()


print(nums1[0]+nums2[1]+nums3[2])

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
b = input()
c = input()

A = [0]*3
ca = 0
cb = 0
cc = 0
for d in a:
    ca +=1
    if(ca == 1):
        A[0] = d

for e in b:
    cb +=1
    if(cb == 1):
        A[1] = e
for f in c:
    cc +=1
    if(cc == 1):
        A[2] = f 

print(A[0]+A[1]+A[2])

Failing test case input:
dst
oeb
rfg

Expected output:
deg


Actual output:
dor


Fixed submission (verdict: Accepted):
a = input()
b = input()
c = input()

A = [0]*3
ca = 0
cb = 0
cc = 0
for d in a:
    ca +=1
    if(ca == 1):
        A[0] = d

for e in b:
    cb +=1
    if(cb == 2):
        A[1] = e
for f in c:
    cc +=1
    if(cc == 3):
        A[2] = f 

print(A[0]+A[1]+A[2])

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
b = input()
c = input()
 
print(a[0])
print(b[1])
print(c[2] + "\n")


Failing test case input:
ceu
bau
oni

Expected output:
cai


Actual output:
c
a
i



Fixed submission (verdict: Accepted):
a = input()
b = input()
c = input()
 
print(a[0]+b[1]+c[2])

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=input()
b=input()
c=input()
print('a[0]'+'b[1]'+'c[2]')

Failing test case input:
udc
aau
kom

Expected output:
uam


Actual output:
a[0]b[1]c[2]


Fixed submission (verdict: Accepted):
a=input()[0]
b=input()[1]
c=input()[2]
print(a+b+c)

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=input()[0]
b=input()[1]
c=input()[2]
print('a'+'b'+'c')


Failing test case input:
dte
uca
pll

Expected output:
dcl


Actual output:
abc


Fixed submission (verdict: Accepted):
a=input()[0]
b=input()[1]
c=input()[2]
print(a+b+c)

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s1 = list( str( input() ) ) 
s2 = list( str( input() ) ) 
s3 = list( str( input() ) ) 
print( s1[0] + s1[1] + s1[2] )

Failing test case input:
cdu
aua
mok

Expected output:
cuk


Actual output:
cdu


Fixed submission (verdict: Accepted):
s1 = str( input() ) 
s2 = str( input() ) 
s3 = str( input() ) 
print( s1[0] + s2[1] + s3[2] )
Problem: p03415
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
i1=input()
i2=input()
i3=input()
print(i1[0],i2[1], i3[2])

Failing test case input:
up`
arf
rge

Expected output:
ure


Actual output:
u r e


Fixed submission (verdict: Accepted):
i1=input()
i2=input()
i3=input()
print(str(i1[0])+str(i2[1])+str(i3[2]))

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = list(input())
b = list(input())
c = list(input())
print(a[0] + b[0] + c[0])


Failing test case input:
uo`
aep
rfe

Expected output:
uee


Actual output:
uar


Fixed submission (verdict: Accepted):
a = list(input())
b = list(input())
c = list(input())
print(a[0] + b[1] + c[2])

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
c1 = input()
c2 = input()
c3 = input()

print(c1[0], c2[1], c3[2])

Failing test case input:
dsf
cua
nkm

Expected output:
dum


Actual output:
d u m


Fixed submission (verdict: Accepted):
c1 = input()
c2 = input()
c3 = input()

print(c1[0]+c2[1]+c3[2])

Problem: p03415
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):


import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))

def resolve():
    ans=""
    for i in range(3):
        ans+=input()[i]
    print(ans)

Failing test case input:
duc
aua
onj

Expected output:
duj


Actual output:

Fixed submission (verdict: Accepted):


import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))

def resolve():
    ans=""
    for i in range(3):
        ans+=input()[i]
    print(ans)

resolve()

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=input()
b=input()
c=input()
 
print(a[0])
print(b[1])
print(c[2])

Failing test case input:
teb
vba
plm

Expected output:
tbm


Actual output:
t
b
m


Fixed submission (verdict: Accepted):
a = input()
b = input()
c = input()
 
print(a[0]+b[1]+c[2])

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S1=str(input())
S2=str(input())
S3=str(input())
print(S1[0]+S1[1]+S3[2])


Failing test case input:
bqt
qea
hdr

Expected output:
ber


Actual output:
bqr


Fixed submission (verdict: Accepted):
S1=str(input())
S2=str(input())
S3=str(input())
print(S1[0]+S2[1]+S3[2])

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x=[]
for i in range(3):
	x.append(input())
print(x)
print(x[0][0]+x[1][1]+x[2][2])


Failing test case input:
ant
obe
rcf

Expected output:
abf


Actual output:
['ant', 'obe', 'rcf']
abf


Fixed submission (verdict: Accepted):
x=[]
for i in range(3):
	x.append(input())

print(x[0][0]+x[1][1]+x[2][2])

Problem: p03415
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
c=[input() for i in range(3)]
for i in range(3):
  print(c[i],end='')

Failing test case input:
`up
q`f
efr

Expected output:
``r


Actual output:
`upq`fefr

Fixed submission (verdict: Accepted):
c=[input() for i in range(3)]
for i in range(3):
  print(c[i][i],end='')