Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
##!/usr/bin/env python3

def main():
    N,K,Q = map(int,input().split())
    a = [int(input()) for _ in range(Q)]
    L = [(K+a.count(i+1)-Q)>0 for i in range(N)] 
    for i in range(N):
        print("Yes" if L[i] else "No")

if __name__ == '__main__':
    main()

Fixed submission:
#!/usr/bin/env python3
from collections import Counter


def main():
    N,K,Q = map(int,input().split())
    a = [int(input()) for _ in range(Q)]
    d = Counter(a)
    L = [(K+d[i+1]-Q)>0 for i in range(N)] 
    for i in range(N):
        print("Yes" if L[i] else "No")

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def solve(n,k,q,a):
    l = [(k+a.count(i+1)-q)>0 for i in range(n)] 
    return l


def main():
    N,K,Q = map(int,input().split())
    a = [int(input()) for _ in range(Q)]
    L = solve(N,K,Q,a)
    for i in range(N):
        print("Yes" if L[i] else "No")

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
from collections import Counter


def main():
    N,K,Q = map(int,input().split())
    a = [int(input()) for _ in range(Q)]
    d = Counter(a)
    L = [(K+d[i+1]-Q)>0 for i in range(N)] 
    for i in range(N):
        print("Yes" if L[i] else "No")

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def solve(n,k,q,a):
    l = [(k+a.count(i+1)-q)>0 for i in range(n)] 
    return l


def main():
    N,K,Q = map(int,input().split())
    a = [int(input()) for _ in range(Q)]
    L = solve(N,K,Q,a)
    for i in range(N):
        print("Yes" if L[i] else "No")

if __name__ == '__main__':
    main()

Fixed submission:
#!/usr/bin/env python3
from collections import Counter


def main():
    N,K,Q = map(int,input().split())
    a = [int(input()) for _ in range(Q)]
    d = Counter(a)
    L = [(K+d[i+1]-Q)>0 for i in range(N)] 
    for i in range(N):
        print("Yes" if L[i] else "No")

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def solve(n,k,a):
    l = [k]*n
    for i in range(len(a)):
        l[a[i]-1] += 1
        l = list(map(lambda x: x-1, l))
    lst = list(map(lambda x : x > 0 ,l))
    return lst


def main():
    N,K,Q = map(int,input().split())
    a = [int(input()) for _ in range(Q)]
    L = solve(N,K,a)
    for i in range(N):
        print("Yes" if L[i] else "No")

if __name__ == '__main__':
    main()

Fixed submission:
#!/usr/bin/env python3
from collections import Counter


def main():
    N,K,Q = map(int,input().split())
    a = [int(input()) for _ in range(Q)]
    d = Counter(a)
    L = [(K+d[i+1]-Q)>0 for i in range(N)] 
    for i in range(N):
        print("Yes" if L[i] else "No")

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
N = int(input())
b = [10**9] + list(map(int,input().split())) + [10**9]
a = []
a[0] = b[1]
for i in range(1,N-1):
  a[i] == min(b[i-1],b[i])
  
a[N] = b[N-1]

Fixed submission:
N = int(input())
b = [10**9] + list(map(int,input().split())) + [10**9]
a = []

for i in range(N):
  a.append(min(b[i],b[i+1]))

print(sum(a))
Buggy python submission (verdict: Runtime Error):
def solve(a,b):
  def needTaps(a,b,holes=1,res=0):
    if holes >= b:
      return res
    elif:
      return needTaps(a,b,holes+a-1,res+1)
    
  return needTaps(a,b)

a,b=map(int,input().split())
print(solve(a,b))


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

i = 0
while True:
  if a + (i-1)*(a-1) >= b:
    ans = i
    break
  i += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import Counter

N = int(input())
a = [int(input()) for _ in range(N)]

def solve(n,a):
  d = Counter(a)
  d_lst = list(sorted(d.keys()))
  first = d_lst[-1]
  second = d_lst[-2]
  if d[first] != 1:
    return [first]*n
  else: # first は一つだけ
    return [second if a[i] == first else first for i in range(n)]

print(*solve(N,a),sep="\n")

Fixed submission:
N = int(input())
a = [int(input()) for _ in range(N)]
first = max(a)
f_id = a.index(max(a))
second = max(a[:f_id] + a[f_id+1:])

for i in range(N):
  if a[i] == first:
    print(second)
  else:
    print(first)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [int(input()) for _ in range(N)]
_a =[max(a[:i] + a[i+1:]) for i in range(N)]

for i in range(N):
  print(_a[i])
  

Fixed submission:
N = int(input())
a = [int(input()) for _ in range(N)]
first = max(a)
f_id = a.index(max(a))
second = max(a[:f_id] + a[f_id+1:])

for i in range(N):
  if a[i] == first:
    print(second)
  else:
    print(first)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [int(input()) for _ in range(N)]

for i in range(N):
  _a = a[:i] + a[i+1:]
  print(max(_a))
  

Fixed submission:
N = int(input())
a = [int(input()) for _ in range(N)]
first = max(a)
f_id = a.index(max(a))
second = max(a[:f_id] + a[f_id+1:])

for i in range(N):
  if a[i] == first:
    print(second)
  else:
    print(first)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [int(input()) for _ in range(N)]

for i in range(N):
  _a = a[:i] + a[i+1:]
  print(max(_a))
  

Fixed submission:
N = int(input())
a = [int(input()) for _ in range(N)]
first = max(a)
f_id = a.index(max(a))
second = max(a[:f_id] + a[f_id+1:])

for i in range(N):
  if a[i] == first:
    print(second)
  else:
    print(first)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10**7)

def judge(c,l,r,counter):
  if counter == 0:
    return c
  elif len(c) == 0:
    return c
  else:
    return judge(list(filter(lambda x: l[0]<=x<=r[0],c)),l[1:],r[1:],counter-1)

def solve(c,l,r,m):
  return len(judge(c,l,r,m))
  
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())
cards = range(1,N+1)
print(solve(cards,L,R,M))


Fixed submission:
def solve(l,r):
  l_max = max(l)
  r_min = min(r)
  return max(r_min - l_max + 1, 0)
  
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(solve(L,R))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10**7)

def judge(c,l,r,counter):
  if counter == 0:
    return c
  elif len(c) == 0:
    return c
  else:
    return judge(list(filter(lambda x: l[0]<=x<=r[0],c)),l[1:],r[1:],counter-1)

def solve(c,l,r,m):
  return len(judge(c,l,r,m))
  
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())
cards = range(1,N+1)
print(solve(cards,L,R,M))


Fixed submission:
def solve(l,r):
  l_max = max(l)
  r_min = min(r)
  return max(r_min - l_max + 1, 0)
  
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(solve(L,R))

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10*7)

def judge(c,l,r,counter):
  if counter == 0:
    return c
  elif len(c) == 0:
    return c
  else:
    return judge(list(filter(lambda x: l[0]<=x<=r[0],c)),l[1:],r[1:],counter-1)

def solve(c,l,r,m):
  return len(judge(c,l,r,m))
  
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())
cards = range(1,N+1)
print(solve(cards,L,R,M))


Fixed submission:
def solve(l,r):
  l_max = max(l)
  r_min = min(r)
  return max(r_min - l_max + 1, 0)
  
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(solve(L,R))

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10*7)

def judge(c,l,r,counter):
  if counter == 0:
    return c
  else:
    return judge(list(filter(lambda x: l[0]<=x<=r[0],c)),l[1:],r[1:],counter-1)

def solve(c,l,r,m):
  return len(judge(c,l,r,m))
  
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())
cards = range(1,N+1)
print(solve(cards,L,R,M))


Fixed submission:
def solve(l,r):
  l_max = max(l)
  r_min = min(r)
  return max(r_min - l_max + 1, 0)
  
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(solve(L,R))
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

import sys
sys.setrecursionlimit(10**8)

def operation(s,memo=-1,ans=0):
    if len(s) <= 0:
        return ans
    elif s[0] == memo == "0": #変えるパターン
        return operation(s[1:],"1",ans+1)
    elif s[0] == memo == "1": #変えるパターン
        return operation(s[1:],"0",ans+1)
    else:
        return operation(s[1:],s[0],ans)

def solve(s):
    return min(operation(s,"0"),operation(s,"1"))

def main():
    S = input()
    print(solve(S))


if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3

import sys
sys.setrecursionlimit(10**6)

def operation(s,f):
    c = 0
    for i in range(len(s)):
        if (s[i] == f and i % 2 == 1) or (s[i] != f and i % 2 == 0):
            c += 1
    return c

def solve(s):
    return min(operation(s,"0"),operation(s,"1"))

def main():
    S = input()
    print(solve(S))


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

import sys
sys.setrecursionlimit(10**10)

def operation(s,memo=-1,ans=0):
    if len(s) <= 0:
        return ans
    elif s[0] == memo == "0": #変えるパターン
        return operation(s[1:],"1",ans+1)
    elif s[0] == memo == "1": #変えるパターン
        return operation(s[1:],"0",ans+1)
    else:
        return operation(s[1:],s[0],ans)

def solve(s):
    return min(operation(s,"0"),operation(s,"1"))

def main():
    S = input()
    print(solve(S))


if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3

import sys
sys.setrecursionlimit(10**6)

def operation(s,f):
    c = 0
    for i in range(len(s)):
        if (s[i] == f and i % 2 == 1) or (s[i] != f and i % 2 == 0):
            c += 1
    return c

def solve(s):
    return min(operation(s,"0"),operation(s,"1"))

def main():
    S = input()
    print(solve(S))


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

import sys
sys.setrecursionlimit(10**6)

def operation(s,memo=-1,ans=0):
    if len(s) <= 0:
        return ans
    elif s[0] == memo == "0": #変えるパターン
        return operation(s[1:],"1",ans+1)
    elif s[0] == memo == "1": #変えるパターン
        return operation(s[1:],"0",ans+1)
    else:
        return operation(s[1:],s[0],ans)

def solve(s):
    return min(operation(s,"0"),operation(s,"1"))

def main():
    S = input()
    print(solve(S))


if __name__ == '__main__':
    main()

Fixed submission:
#!/usr/bin/env python3

import sys
sys.setrecursionlimit(10**6)

def operation(s,f):
    c = 0
    for i in range(len(s)):
        if (s[i] == f and i % 2 == 1) or (s[i] != f and i % 2 == 0):
            c += 1
    return c

def solve(s):
    return min(operation(s,"0"),operation(s,"1"))

def main():
    S = input()
    print(solve(S))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
S = input()
N = len(S)
l = []
for i in range(N):
  for j in range(i,N):
    s = S[i:j+1]
    if s.strip("A C G T") == "":
      l.append(s)

m = sorted(l, key=len)
print(len(m[-1]))


Fixed submission:
S = input()
N = len(S)
l = []
for i in range(N):
  for j in range(i,N):
    s = S[i:j+1]
    if s.strip("A C G T") == "":
      l.append(s)
if len(l) == 0:
  print(0)
  exit()
      
m = sorted(l, reverse=True, key=len)
print(len(m[0]))
Buggy python submission (verdict: Runtime Error):
N = int(Input())
x,u = [""]*N
for i in range(N):
  x[i],u[i] = input().split()

sum = 0
for i in range(N):
  sum += x[i] if u[i] == "JPY" else x[i]*380000.0
       
print(sum)

Fixed submission:
N = int(input())
x= [""]*(N+1)
u= [""]*(N+1)

for i in range(N):
  x[i],u[i] = input().split()

sum = 0
for i in range(N):
  sum += float(x[i]) if u[i] == "JPY" else float(x[i])*380000.0

  
print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

# from numba import njit

# input = stdin.readline

# @njit
def solve(n,a,b):
  delta = [b[i] - a[i] for i in range(n)]
  need = list(sorted(x for x in delta if x > 0))
  amari = list(sorted((abs(x) for x in delta if x < 0),reverse=True))
  if sum(need) > sum(amari):
    return -1
  k = 0
  s = 0
  while s < sum(need):
    s += amari[k]
    k += 1
  return k + len(need)
  


def main():
  N = int(input())
  # N,M = map(int,input().split())
  a = list(map(int,input().split()))
  b = list(map(int,input().split()))
  print(solve(N,a,b))
  return

if __name__ == '__main__':
  main()


Fixed submission:
#!/usr/bin/env python3

# from numba import njit

# input = stdin.readline

# @njit
def solve(n,a,b):
  delta = [b[i] - a[i] for i in range(n)]
  need = list(x for x in delta if x > 0)
  amari = list(sorted((abs(x) for x in delta if x < 0),reverse=True))
  needScore = sum(need)
  if needScore > sum(amari):
    return -1
  k = 0
  s = 0
  while s < needScore:
    s += amari[k]
    k += 1
  return k + len(need)
  


def main():
  N = int(input())
  # N,M = map(int,input().split())
  a = list(map(int,input().split()))
  b = list(map(int,input().split()))
  print(solve(N,a,b))
  return

if __name__ == '__main__':
  main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys

def main():
    D, N = map(int, input().split())
    l = []
    for i in range(1,10000*101):
        if i % (100**D) == 0 and i % (100**(D+1)) != 0:
            l.append(i)
    
    print(l[N-1])

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys

def main():
    D, N = map(int, input().split())
    if N != 100:
        print((100**D)*N)
    else:
        print((100**D)*101)
    return

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def judge(x,a,b,k):
    return x < a+k or b-k < x

def main():
    a,b,k = map(int,input().split())

    l = list(filter(lambda x: judge(x,a,b,k),range(a,b+1)))
    for s in l:
        print(s)


if __name__ == '__main__':
    main()

Fixed submission:
#!/usr/bin/env python3

def main():
    a,b,k = map(int,input().split())
    s = list(set(range(a,min(a+k,b+1))) | set(range(max(b-k+1,a),b+1)))
    s = sorted(s)

    for i in range(len(s)):
        print(s[i])


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
s = [input() for _ in range(int(input()))]
t = [input() for _ in range(int(input()))]

print(max(0,max(s.count(s[i]) - t.count(s[i]) for i in range(len(S)))))

Fixed submission:
s = [input() for _ in range(int(input()))]
t = [input() for _ in range(int(input()))]

print(max(0,max(s.count(s[i]) - t.count(s[i]) for i in range(len(s)))))

Buggy python submission (verdict: Runtime Error):
s = [input() for _ in range(int(input()))]
t = [input() for _ in range(int(Input()))]

print(max(0,max(s.count(s[i]) - t.count(s[i]) for i in range(len(S)))))

Fixed submission:
s = [input() for _ in range(int(input()))]
t = [input() for _ in range(int(input()))]

print(max(0,max(s.count(s[i]) - t.count(s[i]) for i in range(len(s)))))

Buggy python submission (verdict: Runtime Error):
s = [input() for _ in range(int(input()))]
t = [input() for _ in range(int(Input()))]

print(max([s.count(s[i]) - t.count(s[i]) for i in range(len(S))]))

Fixed submission:
s = [input() for _ in range(int(input()))]
t = [input() for _ in range(int(input()))]

print(max(0,max(s.count(s[i]) - t.count(s[i]) for i in range(len(s)))))

Buggy python submission (verdict: Runtime Error):
s = [int(input()) for _ in range(int(input()))]
t = [int(input()) for _ in range(int(Input()))]

print(max(
    [s.count(s[i]) - t.count(s[i]) for i in range(len(S))]))

Fixed submission:
s = [input() for _ in range(int(input()))]
t = [input() for _ in range(int(input()))]

print(max(0,max(s.count(s[i]) - t.count(s[i]) for i in range(len(s)))))
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())

ans = 0
for i in range(a+1):
  for j in range(b+1):
    for k In range(c+1):
      if 500*i+100*j+50*k == x:
        ans += 1
print(ans)

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

ans = 0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*i+100*j+50*k == x:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
d = (int(input()) for i in range(N))

print(len(d))




Fixed submission:
#!/usr/bin/env python3
import sys


def solve(N: int, d: "List[int]"):
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N = int(input())
    d = [int(input()) for i in range(N)]
    print(len(set(d)))
    return



if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
N,M = map(int.input().split())
ans = (1900*M + 100*(N-M))*(2**M)
print(ans)

Fixed submission:
N,M = map(int,input().split())
ans = (1900*M + 100*(N-M))*(2**M)
print(ans)
Buggy python submission (verdict: Runtime Error):
def isSquare(x):
  return x == round(x**(1/2))**2

N = int(input())
l = (x if isSquare(x) else -1 for x in range(1,N+1))
print(max(l))

Fixed submission:
S = "".join(reversed(input()))
T = "".join(input())

if S == T:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
def isSquare(x):
  return x == round(x**(1/2))**2

N = int(input())
l = (x if isSquare(x) else -1 for x in range(1,N+1))
print(max(l))

Fixed submission:
def isSquare(x):
  return x == round(x**(1/2))**2

N = int(input())
f = N
while True:
  if isSquare(f):
    print(f)
    exit()
  else:
    f -= 1

Buggy python submission (verdict: Time Limit Exceeded):
def isSquare(x):
  f = 1
  while f * f <= x:
    if f * f == x:
      return True
    else:
      f += 1
  return False

N = int(input())
f = N
while True:
  if isSquare(f):
    print(f)
    exit()
  f -= 1

Fixed submission:
def isSquare(x):
  return x == round(x**(1/2))**2

N = int(input())
f = N
while True:
  if isSquare(f):
    print(f)
    exit()
  else:
    f -= 1

Buggy python submission (verdict: Time Limit Exceeded):
def isSquare(x):
  f = 1
  while f * f <= x:
    if f * f == x:
      return True
    else:
      f += 1
  return False

N = int(input())
print(max(x if isSquare(x) else 0 for x in range(1,1+N)))

Fixed submission:
def isSquare(x):
  return x == round(x**(1/2))**2

N = int(input())
f = N
while True:
  if isSquare(f):
    print(f)
    exit()
  else:
    f -= 1
Buggy python submission (verdict: Runtime Error):
s = input()

char_number = len(s)

start = s[0]
end   = s[-0]

answer = start + str(char_number - 2)in + end
print(answer)

Fixed submission:
s = input()

char_number = len(s)

start = s[0]
end   = s[-1]

answer = start + str(char_number - 2) + end
print(answer)

Buggy python submission (verdict: Runtime Error):
s = input()

char_number = len(s)

start = s[0]
end   = s[-0]

answer = start + char_number + end
print(answer)

Fixed submission:
s = input()

char_number = len(s)

start = s[0]
end   = s[-1]

answer = start + str(char_number - 2) + end
print(answer)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())

if a[-1] == b[0] and b[-1] == c[0]:
  print("YES")
  return
else:
  print("NO")
  return

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

if a[-1] == b[0] and b[-1] == c[0]:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

# from numba import njit
from collections import Counter
# input = stdin.readline

# @njit
def solve(n,a):
  alphabetLst = {}
  for i in range(n):
... (17 lines) ...


def main():
  N = int(input())
  a = [input() for _ in range(N)]
  print(solve(N,a))
  return

if __name__ == '__main__':
  main()

Fixed submission:
#!/usr/bin/env python3

# from numba import njit
from collections import Counter
# input = stdin.readline

# @njit
def solve(n,a):
  alphabetLst = {}
  for i in range(n):
    # i番目の文字列の中の文字を数える
    d = Counter(a[i])
    for c in (chr(ord("a") + i) for i in range(26)):
      if not c in d.keys():
        alphabetLst[c] = 0
      elif not c in alphabetLst.keys():
        alphabetLst[c] = d[c]
      elif d[c] < alphabetLst[c]:
        alphabetLst[c] = d[c]


  res = []
  for k,v in alphabetLst.items():
    res += [k]*v

  return "".join(res)

def main():
  N = int(input())
  a = [input() for _ in range(N)]
  print(solve(N,a))
  return

if __name__ == '__main__':
  main()
Buggy python submission (verdict: Runtime Error):
def calcTime(x,n=0):
  if n*(n+1)//2 >= x:
    return n
  else:
    return calcTime(x,n+1)

x = int(input())
print(calcTime(x))

Fixed submission:
def calcTime(x):
  n = 0
  while True:
    if n*(n+1)//2 > x:
   	  return n
    elif n*(n+1)//2 == x:
      return n
    else:
      n += 1

x = int(input())
ans = calcTime(x)
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())

def judge(a,b):
  if a > b:
    return "Alice"
  elif a = b:
    return "Draw"
  else:
    return "Bob"
  
print(judge(A,B))

Fixed submission:
A,B=map(int,input().split())

def judge(a,b):
  if a > b > 1 or (a == 1 and b != 1):
    return "Alice"
  elif a == b:
    return "Draw"
  else:
    return "Bob"
  
print(judge(A,B))
Buggy python submission (verdict: Runtime Error):
MOD = 10**9+7
memo = [0]*10000

N = int(input())

def primeLst(k):
  acc = []
  if k == 1:
    return acc
  f = 2
  while f * f <= k:
    if k % f == 0:
      acc.append(f)
      k //= f
    else:
      f += 1
  if k != 1:
    acc.append(k)
  return acc

for i in range(N):
  l = primeLst(i+1)
  for x in l:
    memo[x] += 1

res = 1
for i in range(1,N):
  res *= memo[i+1] + 1
  res %= MOD

print(acc)

Fixed submission:
MOD = 10**9+7
memo = [0]*10000

N = int(input())

def primeLst(k):
  acc = []
  if k == 1:
    return acc
  f = 2
  while f * f <= k:
    if k % f == 0:
      acc.append(f)
      k //= f
    else:
      f += 1
  if k != 1:
    acc.append(k)
  return acc

for i in range(N):
  l = primeLst(i+1)
  for x in l:
    memo[x] += 1

res = 1
for i in range(1,N):
  res *= memo[i+1] + 1
  res %= MOD

print(res)
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

# from numba import njit

# input = stdin.readline

# @njit
def solve(k,s):
  res = 0
  for i in range(k+1):
    for j in range(k+1):
      for l in range(k+1):
        if i+j+l == s:
          res += 1

  return res



def main():
  K,S = map(int,input().split())
  # a = list(map(int,input().split()))
  print(solve(K,S))
  return

if __name__ == '__main__':
  main()


Fixed submission:
#!/usr/bin/env python3

# from numba import njit

# input = stdin.readline

# @njit
def solve(k,s):
  res = 0
  for i in range(k+1):
    for j in range(k+1):
      l = s - i - j
      if 0 <= l <= k:
        res += 1

  return res



def main():
  K,S = map(int,input().split())
  # a = list(map(int,input().split()))
  print(solve(K,S))
  return

if __name__ == '__main__':
  main()
Buggy python submission (verdict: Runtime Error):
s = input()
l = [chr(ord(a)+i) for i in range(5)]
print("vowel" if s in l else "consonant")

Fixed submission:
s = input()
l = ["a", "i", "u", "e", "o"]
print("vowel" if s in l else "consonant")