Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
s,c=[],[]

for _ in range(m):
    a,b=map(int,input().split())
    a-=1
    s.append(a)
    c.append(b)
        
for ans in range(10**(n-1),10**n):
    st=str(ans)
    f=True    
    for i in range(m):
       if st[s[i]] != str(c[j]):
            f=False
          
    if f==True:
        print(ans)
        exit()

print(-1)

Fixed submission:
n=int(input())
print(-(-n//2))
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
p = list(map(int,input().split()))

ans = 0
for i in range(n-k+1):
    ans = max(ans,sum(p[i:i+k]))

print(0.5+(0.5*ans)+(k-1)*0.5)

Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))

wrk = sum(p[:k])
ans = wrk
for i in range(1,n-k+1):
    wrk-=p[i-1]
    wrk+=p[i+k-1]
    ans = max(ans,wrk)

print(0.5+(0.5*ans)+(k-1)*0.5)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
p = list(map(int,input().split()))

s = []
for i in range(1001):
    s.append(0.5+(0.5*i))

t = []
for i in p:
    t.append(s[i])

ans = 0
for i in range(n-k+1):
    ans = max(ans,sum(t[i:i+k]))

print(ans)

Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))

wrk = sum(p[:k])
ans = wrk
for i in range(1,n-k+1):
    wrk-=p[i-1]
    wrk+=p[i+k-1]
    ans = max(ans,wrk)

print(0.5+(0.5*ans)+(k-1)*0.5)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
p = list(map(int,input().split()))

s = []
s.append(0)
j=0
for i in range(1,1001):
    j+=i
    s.append(j/i)

t = []
for i in p:
    t.append(s[i])

ans = 0
for i in range(n-k+1):
    ans = max(ans,sum(t[i:i+k]))

print(ans)

Fixed submission:
n,k = map(int,input().split())
p = list(map(int,input().split()))

wrk = sum(p[:k])
ans = wrk
for i in range(1,n-k+1):
    wrk-=p[i-1]
    wrk+=p[i+k-1]
    ans = max(ans,wrk)

print(0.5+(0.5*ans)+(k-1)*0.5)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
h = list(map(int,input().split()))

h.sort(reverse=True)

for i in range(min(n,k)):
    h.pop(0)

print(sum(h))

Fixed submission:
n,k=map(int,input().split())
h = list(map(int,input().split()))

h.sort(reverse=True)

print(sum(h[min(n,k):]))
Buggy python submission (verdict: Runtime Error):
n,m = map(input().split())

if n == m:
    print('Yes')
else:
    print('No')

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

if n == m:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int,input().split()))

cnt = 1
for i in range(1,len(p)):
    if min(p[:i]) >= p[i]:
        cnt+=1
    
print(cnt)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))

cnt = 1
m = p[0]

for i in range(1,len(p)):
    if m >= p[i]:
        cnt+=1
    
    m = min(m,p[i])
    
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int,input().split()))

cnt = 1
for i in range(1,len(p)):
    if min(p[:i]) >= p[i]:
        cnt+=1
print(cnt)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))

cnt = 1
m = p[0]

for i in range(1,len(p)):
    if m >= p[i]:
        cnt+=1
    
    m = min(m,p[i])
    
print(cnt)
Buggy python submission (verdict: Runtime Error):
import fractions
a,b = map(int,input().split())
print(a * b // fractions.gcd(a,b))

Fixed submission:
a = int(input())
b = int(input())

myset = ([1,2,3]) 

myset.remove(a)
myset.remove(b)

l = list(myset)
print(l[0])

Buggy python submission (verdict: Runtime Error):
a,b  = map(int,input().split())

myset = ([1,2,3]) 

myset.remove(a)
myset.remove(b)

l = list(myset)
print(l[0])

Fixed submission:
a = int(input())
b = int(input())

myset = ([1,2,3]) 

myset.remove(a)
myset.remove(b)

l = list(myset)
print(l[0])
Buggy python submission (verdict: Runtime Error):
import math

a,b = map(int,input().split())
print(a * b // math.gcd(a,b))

Fixed submission:
import fractions

a,b = map(int,input().split())
print(a * b // fractions.gcd(a,b))
Buggy python submission (verdict: Runtime Error):
str = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 

a = int(input())
s = list(input())

ans = ''
for char in s:
    
    c = str.index(char) + a 

    if c > 27:
        c = c - 26
    ans = ans + str[c] #文字列は加算できる

print(ans)

Fixed submission:
str = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 

a = int(input())
s = list(input())

ans = ''
for char in s:
    
    c = str.index(char) + a 

    if c >= 26:
        c = c - 26
    ans = ans + str[c] #文字列は加算できる

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))

ans =[]
for i in range(1,n+1):
    ans.append(str(a.index(i)+1))
print(" ".join(ans))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))

b =[]
for i in range(0,len(a)):
    b.append([a[i],i+1])
b.sort()

for i in range(n):
    print(str(b[i][1])+' ',end='')
Buggy python submission (verdict: Time Limit Exceeded):
n,k,q=map(int,input().split())
a=[int(input()) for _ in range(q)]

for i in range(1,n+1):
    if(k-q+a.count(i) > 0):
        print('Yes')
    else:
        print('No')

Fixed submission:
n,k,q=map(int,input().split())
a=[int(input()) for _ in range(q)]

p=[0]*(n+1)
for i in a:
    p[i]+=1

for i in range(1,n+1):
    if(k-q+p[i] > 0):
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))

wk = 0
for i in range(n):
    wk += l[i]
    #print(i)
    #print(l[i])
    if(wk > x):
        print(i + 1)
        exit()
print(n + 1)

Fixed submission:
x,a=map(int,input().split())
if x<a:
    print(0)
else:
    print(10)
Buggy python submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))

wk = 0
for i in range(n):
    wk += l[i]
    #print(i)
    #print(l[i])
    if(wk > x):
        ans = i + 1
        break
print(ans)

Fixed submission:
n,x=map(int,input().split())
l=list(map(int,input().split()))

wk=0
cnt=1
for i in range(n):
    wk+=l[i]
    if wk <= x:
        cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input())
w = list(map(int, input().split()))

half = sum(w) / 2

wk = 0
for i in range(n):
    
    if( wk + w[i] >= half):
        wk += w[i]      
        break
    wk += w[i]  

zenhan = 0
for j in range(0,i + 1):

    zenhan += w[j]  

kouhan = 0
for j in range(i + 1, n):
    kouhan += w[j]  

print(abs(zenhan - kouhan))

Fixed submission:
p,q,r = map(int, input().split())

ans = p+q+r-max(p,q,r)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
t,a = map(int,input().split())
l = []
ans = []

l = list(map(int,input().split()))
    
for i in range(n):
    ans.append(a - t - (l[i] * 0.006))

print(ans.index(min(ans,key=abs))+1)

Fixed submission:
x,y = map(int,input().split())

print(x+ y // 2)
Buggy python submission (verdict: Runtime Error):
h,w = map(int,input().split())

a = []
for _ in range(h):
    wk = input()

    if '#' in wk:
        a.append(wk)

t = []
for j in zip(*a):
    if '#' in j:
        t.append(j)

for list in zip(*t):
    print("".join(list))

Fixed submission:
n,i = map(int, input().split())

print(n - i + 1)
Buggy python submission (verdict: Runtime Error):
s = list(input())

ans = 'AC'
if s[0] != 'A':
    ans = 'WA'  

if s[2:-1].count('C') != 1:
    ans = 'WA'

s.remove('A')
s.remove('C')
if "".join(s).isupper():
    ans = 'WA'

print(ans)

Fixed submission:
s = list(input())

ans = 'AC'
if s[0] != 'A':
    ans = 'WA'  

if s[2:-1].count('C') != 1:
    ans = 'WA'

cnt = 0
for i in s:
    
    if 'A' <= i <= 'Z':
        cnt += 1

if cnt != 2:
    ans = 'WA'

print(ans)
Buggy python submission (verdict: Runtime Error):
x = int(input())

s = set([1])
for i in range(2,501):
    for j in range(2,10):
        if (i**j) <= x:
            s.add(i**j)

print(max(list(s)))

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

if abs(a-c) <= d or max(abs(a-b), abs(b-c)) <= d:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
k = int(input())

m = max(a,b,c)
print(m * 2 * k + a + b + c - max(a,b,c))

Fixed submission:
a,b = map(int,input().split())

if a <= b:
    print(a)
else:
    print(a - 1)
Buggy python submission (verdict: Runtime Error):
n = input()

wrk = 0
for i in n:
    wrk += int(i)

if int(n) % wrk == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
n,a,b = map(int,input().split())

print(min(n*a,b))
Buggy python submission (verdict: Runtime Error):
n = int(input())
 
l = [2,1]
for i in range(2,n+1):
  l.append(l[i-1] + l[i-2])
 
print(l[i])

Fixed submission:
n = int(input())
 
l = [2,1]
for i in range(2,n+1):
  l.append(l[i-1] + l[i-2])
 
print(l[n])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

power = 1
for i in range(1,n+1):
    power *= i

print(power%(10**9+7))

Fixed submission:
import math
n = int(input())

power = math.factorial(n)
print(power%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

power = 1
for i in range(1,n+1):
    power *= i

print(power%(10**9+7))

Fixed submission:
import math
n = int(input())

power = math.factorial(n)
print(power%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int,input().split())

ans = 0
for h in range(k+1):
    for i in range(k+1):
        for j in range(k+1):
            if h+i+j==s:
                ans += 1
print(ans)

Fixed submission:
k,s = map(int,input().split())

ans = 0
for i in range(k+1):
    for j in range(k+1):
        if k >= s-i-j >= 0: 
            ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int,input().split())

ans = 0
for h in range(k+1):
    for i in range(k+1):
        for j in range(k+1):
            if h+i+j ==s:
                ans += 1
print(ans)

Fixed submission:
k,s = map(int,input().split())

ans = 0
for i in range(k+1):
    for j in range(k+1):
        if k >= s-i-j >= 0: 
            ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
d, t, s = map(int, input().split())
if d/s > t:
  pirnt("No")
else:
  print("Yes")

Fixed submission:
d, t, s = map(int, input().split())
if d/s > t:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
s = input()
if s = "RSR":
  print(1)
else:
  print(s.count("R"))

Fixed submission:
s = input()
if s == "RSR":
  print(1)
else:
  print(s.count("R"))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = 0
for i in range(1, N+1):
  n = N//i
  cnt = (n*(2*i + (n-1) *i))//2
  ans += cnt
print(ans)

Fixed submission:
N = int(input())
ans = 0
for i in range(1, N+1):
  n = N//i
  cnt = i*n*(n+1)//2
  ans += cnt
print(ans)
Buggy python submission (verdict: Runtime Error):
x = map(int, input().split())
for i in range(5):
  if x[i] == 0:
    print(i)

Fixed submission:
x = list(map(int, input().split()))
for i in range(5):
  if x[i] == 0:
    print(i+1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
ans = 1

for i in range(N):
  ans *= A[i]
  
if ans > 10**18:
  print("-1")
else:
  print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 1

if 0 in A:
  print(0)
  exit(0)

for i in range(N):
  ans *= A[i]
  if ans > 10**18:
    print("-1")
    exit(0)

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())

# 約数列挙
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

# 素因数分解
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table

def div_game(N, ans, LIST):
  if N == 1:
    print(ans)
    return ans
  
  num = make_divisors(N)
  for i in num:
    if i == 1:
      continue
    elif i in LIST:
      continue
    A = prime_decomposition(i)
    if len(set(A)) == 1:
      z = i
      LIST.append(z)
      break
    
  N = int(N/z)
  div_game(N, ans+1, LIST)

LIST = []
last = div_game(N, 0, LIST)

Fixed submission:
import collections
N = int(input())
  
# 素因数分解
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table

num1 = prime_decomposition(N)
num2 = collections.Counter(num1)

ans = 0

for j in set(num1):
  number = 0
  for k in range(50):
    number += k
    if number > num2[j]:
      ans += (k-1)
      break
        
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, d = map(int, input().split())

while True:
  c -= b
  if c <= 0:
    print("Yes")
  a -= d
  if a <= 0:
    print("No")

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

while True:
  c -= b
  if c <= 0:
    print("Yes")
    exit(0)
  a -= d
  if a <= 0:
    print("No")
    exit(0)
Buggy python submission (verdict: Time Limit Exceeded):
K = int(input())
ans = 0

def gcd(p, q):
  if p % q == 0: return q
  return gcd(q, p%q)

for i in range(1, K+1):
  for j in range(1, K+1):
    for k in range(1, K+1):
      ans += gcd(gcd(i, j), k)
      
print(ans)  

Fixed submission:
from math import gcd

K = int(input())
ans = 0

for i in range(1, K+1):
  for j in range(1, K+1):
    for k in range(1, K+1):
      ans += gcd(gcd(i, j), k)
      
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce
K = int(input())
ans = 0

def gcd(*numbers):
  return reduce(math.gcd, numbers)

for i in range(1, K+1):
  for j in range(1, K+1):
    for k in range(1, K+1):
      ans += gcd(i, j, k)
      
print(ans)  

Fixed submission:
from math import gcd

K = int(input())
ans = 0

for i in range(1, K+1):
  for j in range(1, K+1):
    for k in range(1, K+1):
      ans += gcd(gcd(i, j), k)
      
print(ans)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = map(int, input().split())
ans = 0

for i in range(n):
  if a[i] >= sum(a)*(1/(4*m)):
    ans += 1
    
if ans >= m:
  print("Yes")
else:
  print("No")

Fixed submission:
n, m = map(int, input().split())
a = list(map(int, input().split()))
ans = 0

for i in range(n):
  if a[i] >= sum(a)*(1/(4*m)):
    ans += 1
    
if ans >= m:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n, a, b = map(int, input().split())
blue = 0
total = 0

for i in range(10**100):
  blue += a
  total += a
  if total == n:
    print(blue)
    exit(0)
  elif total > n:
    print(blue - (total - n))
    exit(0)
    
  total += b
  if total >= n:
    print(blue)
    exit(0)

Fixed submission:
n, a, b = map(int, input().split())

num = n//(a+b)
if (a+b)*num == n:
  print(a*num)
elif (a+b)*num + a <= n:
  print(a*(num+1))
else:
  print(a*num + n - (a+b)*num)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = map(int, input().split())

if set(a) == len(a):
  print("NO")
else:
  print("YES")

Fixed submission:
n = int(input())
a = list(map(int, input().split()))

if len(set(a)) == n:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
a, b = int(input())
if a < 10 and b < 10:
  print(a＊b)
else:
  print(-1)

Fixed submission:
a, b = map(int, input().split())
if a < 10 and b < 10:
  print(a*b)
else:
  print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = n-1

for i in range(1, int(n*0.5)+1):
  if n%i == 0:
    num1 = i
    num2 = n/i
    ans = min(ans, num1+num2-2)
    
print(int(ans))

Fixed submission:
n = int(input())
ans = n-1

for i in range(1, int(n**0.5)+1):
  if n%i == 0:
    num1 = i
    num2 = n/i
    ans = min(ans, num1+num2-2)
    
print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = []

for i in range(1, n):
  if n%i == 0:
    num1 = i
    num2 = n/i
    ans.append(num1+num2-2)
    
print(int(min(ans)))

Fixed submission:
n = int(input())
ans = n-1

for i in range(1, int(n**0.5)+1):
  if n%i == 0:
    num1 = i
    num2 = n/i
    ans = min(ans, num1+num2-2)
    
print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = []

for i in range(1, n+1):
  ans.append(a.index(i)+1)

print(*ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = [0] * n

for i in range(n):
  b[a[i]-1] = i+1
print(*b)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = []

new_a = sorted(a)
for i in range(n):
  ans.append(a.index(new_a[i])+1)

print(*ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
b = [0] * n

for i in range(n):
  b[a[i]-1] = i+1
print(*b)
Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
a = [input() for i in range(q)]
point = []
one = []
ans = []

for j in range(n):
  point.append(k)
  one.append(1)
  
for x in range(q):
  point = [p-o for (p,o) in zip(point, one)] 
  point[int(a[x])-1] += 1
  
for y in range(n):
  if point[y] <= 0:
    ans.append('No')
  else:
    ans.append('Yes')
  print(ans[y])

Fixed submission:
n, k, q = map(int, input().split())
a = [input() for i in range(q)]
point = []
ans = []

for z in range(n):
  point.append(0)

for j in range(q):
  point[int(a[j])-1] += 1
  
for x in range(n):
  if point[x] > q-k:
    ans.append('Yes')
  else:
    ans.append('No')
  print(ans[x])
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
for i in range(30):
  if (a + (a-1) * i) >= b:
    break
print(i+1)

Fixed submission:
# coding:utf-8
a = list(input())
b = list(input())
count = 0

for i in range(3):
  if a[i] == b[i]:
    count += 1
    
print(count)
Buggy python submission (verdict: Runtime Error):
a = int(input())
if a = 1:
  print(1)
  exit(0)
else:
  ans = a*(a+1)/2 - a
  print(int(ans))

Fixed submission:
a = int(input())
ans = a*(a-1)//2
print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
num = 0
for i in range(1,a+1):
  num += i
ans = num - i
print(ans)

Fixed submission:
a = int(input())
ans = a*(a-1)//2
print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
num = []
for i in range(1,a+1):
  num.append(i)
ans = sum(num) - max(num)
print(ans)

Fixed submission:
a = int(input())
ans = a*(a-1)//2
print(int(ans))

Buggy python submission (verdict: Runtime Error):
a = list(input())
ans = sum(a) - max(a)
print(ans)

Fixed submission:
a = int(input())
ans = a*(a-1)//2
print(int(ans))
Buggy python submission (verdict: Time Limit Exceeded):
import heapq

n = int(input())
h = list(map(int, input().split()))

for i in range(1, n):
  h_minus = list(map(lambda x: x*(-1), h[:i]))
  heapq.heapify(h_minus)
  if h[i] < (h_minus[0])*(-1)-1:
    print("No")
    exit(0)
print("Yes")

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
   
h_max = h[0]
for i in range(1, n):
  if h[i-1] > h_max:
    h_max = h[i-1]
  if h[i] < h_max -1:
    print("No")
    exit(0)
print("Yes")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
h = list(map(int, input().split()))

for i in range(1, n):
  if h[i] < max(h[:i])-1:
    print("No")
    exit(0)
print("Yes")

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
   
h_max = h[0]
for i in range(1, n):
  if h[i-1] > h_max:
    h_max = h[i-1]
  if h[i] < h_max -1:
    print("No")
    exit(0)
print("Yes")
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
num = [list(map(int, input().split())) for _ in range(m)]
num1 = 1
num2 = n

for j in range(m):
  num1 = max(num[j][0], num1)
  num2 = min(num[j][1], num2)

ans = num2 - num1 + 1

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

Fixed submission:
n, m = map(int, input().split())
num = [list(map(int, input().split())) for _ in range(m)]
num1 = 1
num2 = n

for j in range(m):
  num1 = max(num[j][0], num1)
  num2 = min(num[j][1], num2)

ans = num2 - num1 + 1

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

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
num = [list(map(int, input().split())) for _ in range(m)]
count = 0

for i in range(1, n+1):
  ans = 0
  for j in range(m):
    if i >= num[j][0] and i <= num[j][1]:
      ans += 1
    else:
      break
  if ans == m:
    count += 1

print(count)

Fixed submission:
n, m = map(int, input().split())
num = [list(map(int, input().split())) for _ in range(m)]
num1 = 1
num2 = n

for j in range(m):
  num1 = max(num[j][0], num1)
  num2 = min(num[j][1], num2)

ans = num2 - num1 + 1

if ans > 0:
  print(ans)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
s = int(input())

if s[:1] <= 12 and s[2:] <= 12:
  print("AMBIGUOUS")
elif s[:1] <= 12:
  print("MMYY")
elif s[2:] <= 12:
  print("YYMM")
else:
  print("NA")

Fixed submission:
s = input()

if 0 < int(s[:2]) <= 12 and 0 < int(s[2:]) <= 12:
  print("AMBIGUOUS")
elif 0 < int(s[:2]) <= 12:
  print("MMYY")
elif 0 < int(s[2:]) <= 12:
  print("YYMM")
else:
  print("NA")
Buggy python submission (verdict: Runtime Error):
fractions import Fraction
a, b = map(int, input().split())
ans = 0

for i in range(1, a+1):
  for j in range(10**6):
    if i*2**j > b:
      ans += Fraction(1, a*2**j)
      break

print(float(ans))

Fixed submission:
a, b = map(int, input().split())
ans = 0

for i in range(1, a+1):
  tmp = 1
  while i*tmp < b:
    tmp *= 2
  ans += (1/a)*(1/tmp)

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n == 1:
  print('Hello World')
  exit(0)
else:
  a, b = map(int, input().split())
  print(a)
  print(b)

Fixed submission:
n = int(input())
if n == 1:
  print('Hello World')
  exit(0)
else:
  a = int(input())
  b = int(input())
  print(a+b)