Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
k,s=map(int,input(),split())
#k=2
#s=2
result=0
for x in range(k+1):
    for y in range(k+1):
        z=s-x-y
        if 0<=z and z<=k:
            result+=1
            
print(result)

Fixed submission:
k,s=map(int,input().split())
#k=2
#s=2
result=0
for x in range(k+1):
    for y in range(k+1):
        z=s-x-y
        if 0<=z and z<=k:
            result+=1
            
print(result)

Buggy python submission (verdict: Runtime Error):
k,s=map(int,input(),split())
#k=2
#s=2
result=0
for x in range(k+1):
    for y in range(k+1):
        z=s-x-y
        if 0<=z and z<=k:
            result+=1
            
print(result)
            

Fixed submission:
k,s=map(int,input().split())
#k=2
#s=2
result=0
for x in range(k+1):
    for y in range(k+1):
        z=s-x-y
        if 0<=z and z<=k:
            result+=1
            
print(result)

Buggy python submission (verdict: Runtime Error):
k,s=map(int,input(),split())
#k=2
#s=2
result=0
for x in range(k+1):
    for y in range(k+1):
        z=s-x-y
        if 0<=z and z<=k:
            result+=1
            
print(result)
            
        




Fixed submission:
k,s=map(int,input().split())
#k=2
#s=2
result=0
for x in range(k+1):
    for y in range(k+1):
        z=s-x-y
        if 0<=z and z<=k:
            result+=1
            
print(result)

Buggy python submission (verdict: Runtime Error):
k,s=map(int,input(),split())

ans=0
for x in range(k):
    for y in range(k):
        z=S-x-y
        if 0<=s and z<=k:
            ans+=1
            
print(ans)
            
        




Fixed submission:
k,s=map(int,input().split())
#k=2
#s=2
result=0
for x in range(k+1):
    for y in range(k+1):
        z=s-x-y
        if 0<=z and z<=k:
            result+=1
            
print(result)

Buggy python submission (verdict: Runtime Error):
k,s=map(int,input(),split())

ans=0
for x in range(k+1):
    for y in range(k+1):
        z=S-x-y
        if 0<=s and z<=k:
            ans+=1
            
print(ans)
            
        




Fixed submission:
k,s=map(int,input().split())
#k=2
#s=2
result=0
for x in range(k+1):
    for y in range(k+1):
        z=s-x-y
        if 0<=z and z<=k:
            result+=1
            
print(result)
Buggy python submission (verdict: Runtime Error):
n = input()
if n[-1] == '2' or '4' or '5' or '7' or '9':
    print('hon')
elif n[-1] == '0' or '1' or '6' or '8':
    print('pon')
else print('bon'):
    print('bon')

Fixed submission:
n = input()
if n[-1] == '2' or n[-1] == '4' or n[-1] == '5' or n[-1] =='7' or n[-1] == '9':
    print('hon')
elif n[-1] == '0' or n[-1] == '1' or n[-1] == '6' or n[-1] == '8':
    print('pon')
else:
    print('bon')
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input.split())
a = list(map(int, input.split()))
sum = 0
for i in a:
    sum += i
if n >= sum:
    print(n - sum)
else:
    print(-1)

Fixed submission:
n, m = map(int, input().split())
a = list(map(int, input().split()))
sum = 0
for i in a:
    sum += i
if n >= sum:
    print(n - sum)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
sum = 0
for i in range(n+1):
    not (i % 3 == 0 and i % 5 ==0):
        sum += i
print(sum)

Fixed submission:
n = int(input())
sum = 0
for i in range(n+1):
    if not (i % 3 == 0 or i % 5 ==0):
        sum += i
print(sum)
Buggy python submission (verdict: Runtime Error):
S=input()
if S="ABC":
  print("ARC")
elif S="ARC":
  print("ABC")

Fixed submission:
S=input()
if S=="ABC":
  print("ARC")
elif S=="ARC":
  print("ABC")
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())#N人K種類
ls=[False for _ in range(N)]
for i in range(K):
  d=int(input())
  A=list(map(int,input().split()))
  for j in range(d):
    ls[A[j]-1]=True
S=0
for i in range(K):
  if ls[i]==False:
    S+=1
print(S)

Fixed submission:
N,K=map(int,input().split())#N人K種類
ls=[False for _ in range(N)]
for i in range(K):
  d=int(input())
  A=list(map(int,input().split()))
  for j in range(d):
    ls[A[j]-1]=True
S=0
for i in range(N):
  if ls[i]==False:
    S+=1
print(S)

Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
ls=[[] for _ in range(N)]
for i in range(K):
  d=int(input())
  A=list(map(int,input().split()))
  for j in range(d):
    ls[A[j]-1].append(i+1)
S=0
for i in range(K):
  if ls[i]==[]:
    S+=1
print(S)

Fixed submission:
N,K=map(int,input().split())#N人K種類
ls=[False for _ in range(N)]
for i in range(K):
  d=int(input())
  A=list(map(int,input().split()))
  for j in range(d):
    ls[A[j]-1]=True
S=0
for i in range(N):
  if ls[i]==False:
    S+=1
print(S)
Buggy python submission (verdict: Time Limit Exceeded):
K=int(input())
ans=0
import math
from functools import reduce

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

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
  
for a in range(K):
  for b in range(K):
    for c in range(K):
      ans+=gcd(a+1,b+1,c+1)
print(ans)
      

Fixed submission:
K=int(input())
ans=0
import math
from functools import reduce
 
def gcd(*numbers):
    return reduce(math.gcd, numbers)
 
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
  
for a in range(K):
  for b in range(K):
    for c in range(K):
      ans+=gcd(a+1,b+1,c+1)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
ls=[0 for _ in range(max(A))]
for i in range(N):
  ls[A[i]-1]+=1
lsk=ls
for k in range(N):
  lsk=ls
  lsk[A[k]-1]-=1
  s=0
  for j in range(len(ls)):
    m=lsk[j]*(lsk[j]-1)//2
    s+=m
  lsk[A[k]-1]+=1
  print(s)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
ls=[0 for _ in range(N)]
for i in range(N):
  ls[A[i]-1]+=1
s=0
for i in range(len(ls)):
    m=ls[i]*(ls[i]-1)//2
    s+=m
for j in range(N):
  print(s-(ls[A[j]-1]-1))
Buggy python submission (verdict: Runtime Error):
A,B,K=map(int,input().split())
if A>=K:
  print(str(A-k)+" "+str(B))
else:
  if A+B>=K:
    print("0 "+str(A+B-K))
  else:
    print("0 0")

Fixed submission:
A,B,K=map(int,input().split())
if A>=K:
  print(str(A-K)+" "+str(B))
else:
  if A+B>=K:
    print("0 "+str(A+B-K))
  else:
    print("0 0")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=input()
cnt=0
for i in range(1000):
  con=0
  if i<10:
    a="00"+str(i)
  elif i<100:
    a="0"+str(i)
  else:
    a=str(i)
  for j in range(N):
    if S[j]==a[con]:
      con+=1
      if con==3:
        cnt+=1
        break
print(cnt)

Fixed submission:
N=int(input())
S=input()
cnt=0
for i in range(1000):
  con=0
  if i<10:
    a="00"+str(i)
  elif i<100:
    a="0"+str(i)
  else:
    a=str(i)
  for j in range(N):
    if S[j]==a[con]:
      con+=1
      if con==3:
        cnt+=1
        break
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N=int(input())
S=input()
S1=[S[i] for i in range(N)]
se=set(list(itertools.combinations(S1,3)))
print(len(se))

Fixed submission:
N=int(input())
S=input()
cnt=0
for i in range(1000):
  con=0
  if i<10:
    a="00"+str(i)
  elif i<100:
    a="0"+str(i)
  else:
    a=str(i)
  for j in range(N):
    if S[j]==a[con]:
      con+=1
      if con==3:
        cnt+=1
        break
print(cnt)
Buggy python submission (verdict: Runtime Error):
if S=="SUN":
  print(7)
elif S=="MON":
  print(6)
elif S=="TUE":
  print(5)
elif S=="WED":
  print(4)
elif S=="THU":
  print(3)
elif S=="FRI":
  print(2)
elif S=="SAT":
  print(1)

Fixed submission:
S=input()
if S=="SUN":
  print(7)
elif S=="MON":
  print(6)
elif S=="TUE":
  print(5)
elif S=="WED":
  print(4)
elif S=="THU":
  print(3)
elif S=="FRI":
  print(2)
elif S=="SAT":
  print(1)
Buggy python submission (verdict: Runtime Error):
S=input()
N=len(S)
ren=[]
a=1
for i in range(N-1):
  if S[i]==S[i+1]:
    a+=1
  else:
    ren.append(a)
    a=1
  if i==N-2:
    ren.append(a)
      
M=len(ren)
ma=max(ren)
su=0
if S[0]=="<":
  if M%2==0:
    for k in range(M//2):
      if ren[2*k]<ren[2*k+1]:
        su=su+ren[2*k]*(ren[2*k]-1)//2+ren[2*k+1]*(ren[2*k+1]+1)//2
      else:
        su=su+ren[2*k]*(ren[2*k]+1)//2+ren[2*k+1]*(ren[2*k+1]-1)//2
  else:
    for k in range(M//2):
      if ren[2*k]<ren[2*k+1]:
        su=su+((ren[2*k]*(ren[2*k]-1))//2)+(ren[2*k+1]*(ren[2*k+1]+1)//2)
      else:
        su=su+ren[2*k]*(ren[2*k]+1)//2+ren[2*k+1]*(ren[2*k+1]-1)//2
    su+=ren[-1]*(ren[-1]+1)//2
if S[0]==">":
  su+=ren[0]*(ren[0]+1)//2  
  if (M-1)%2==0:
    for k in range((M-1)//2):
      if ren[1+2*k]<ren[1+2*k+1]:
        su=su+ren[1+2*k]*(ren[1+2*k]-1)//2+ren[1+2*k+1]*(ren[1+2*k+1]+1)//2
      else:
        su=su+ren[1+2*k]*(ren[1+2*k]+1)//2+ren[1+2*k+1]*(ren[1+2*k+1]-1)//2
  else:
    for k in range((M-1)//2):
      if ren[1+2*k]<ren[1+2*k+1]:
        su=su+ren[1+2*k]*(ren[1+2*k]-1)//2+ren[1+2*k+1]*(ren[1+2*k+1]+1)//2
      else:
        su=su+ren[1+2*k]*(ren[1+2*k]+1)//2+ren[1+2*k+1]*(ren[1+2*k+1]-1)//2
    su+=ren[-1]*(ren[-1]+1)//2
print(su)

Fixed submission:
S=input()
N=len(S)
ren=[]
a=1
if N==1:
  print(1)
  exit()
for i in range(N-1):
  if S[i]==S[i+1]:
    a+=1
  else:
    ren.append(a)
    a=1
  if i==N-2:
    ren.append(a)
      
M=len(ren)
ma=max(ren)
su=0
if S[0]=="<":
  if M%2==0:
    for k in range(M//2):
      if ren[2*k]<ren[2*k+1]:
        su=su+ren[2*k]*(ren[2*k]-1)//2+ren[2*k+1]*(ren[2*k+1]+1)//2
      else:
        su=su+ren[2*k]*(ren[2*k]+1)//2+ren[2*k+1]*(ren[2*k+1]-1)//2
  else:
    for k in range(M//2):
      if ren[2*k]<ren[2*k+1]:
        su=su+((ren[2*k]*(ren[2*k]-1))//2)+(ren[2*k+1]*(ren[2*k+1]+1)//2)
      else:
        su=su+ren[2*k]*(ren[2*k]+1)//2+ren[2*k+1]*(ren[2*k+1]-1)//2
    su+=ren[-1]*(ren[-1]+1)//2
if S[0]==">":
  su+=ren[0]*(ren[0]+1)//2  
  if (M-1)%2==0:
    for k in range((M-1)//2):
      if ren[1+2*k]<ren[1+2*k+1]:
        su=su+ren[1+2*k]*(ren[1+2*k]-1)//2+ren[1+2*k+1]*(ren[1+2*k+1]+1)//2
      else:
        su=su+ren[1+2*k]*(ren[1+2*k]+1)//2+ren[1+2*k+1]*(ren[1+2*k+1]-1)//2
  else:
    for k in range((M-1)//2):
      if ren[1+2*k]<ren[1+2*k+1]:
        su=su+ren[1+2*k]*(ren[1+2*k]-1)//2+ren[1+2*k+1]*(ren[1+2*k+1]+1)//2
      else:
        su=su+ren[1+2*k]*(ren[1+2*k]+1)//2+ren[1+2*k+1]*(ren[1+2*k+1]-1)//2
    su+=ren[-1]*(ren[-1]+1)//2
print(su)
Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q=map(int,input().split())
a = [int(input()) for i in range(Q)]
for i in range(N):
  if a.count(i+1)>=Q-K+1:
    print("Yes")
  else:
    print("No")


Fixed submission:
N,K,Q=map(int,input().split())
a = [int(input()) for i in range(Q)]
point=[0 for i in range(N)]
for i in range(Q):
  point[a[i]-1]=point[a[i]-1]+1
for j in range(N):
  if point[j]>=Q-K+1:
    print("Yes")
  else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q=map(int,input().split())
a = [int(input()) for i in range(Q)]
point=[K for i in range(N)]
for i in range(Q):
  for j in range(N):
    if not j==a[i]-1:
      point[j]=point[j]-1
re=[]
for j in range(N):
  if point[j]<=0:
    print("No")
  else:
    print("Yes")

Fixed submission:
N,K,Q=map(int,input().split())
a = [int(input()) for i in range(Q)]
point=[0 for i in range(N)]
for i in range(Q):
  point[a[i]-1]=point[a[i]-1]+1
for j in range(N):
  if point[j]>=Q-K+1:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
H = list(map(int, input().split()))
I=[H[i]-H[i+1] for i in range(N-1)]
K=[]
for j in range(N-1):
  if I[j]>=0:
    K.append("a")
  else:
    K.append("b")
S = ''.join(K)
i=0
while "a"*(i+1) in S:
  i+=1
print(i)

Fixed submission:
N=int(input())
H = list(map(int, input().split()))
I=[H[i]-H[i+1] for i in range(N-1)]
a=0
n=0
j=0
while j<N-1:
  if I[j]>=0:
    j+=1
    n+=1
  else:
    j+=1
    a=max(n,a)
    n=0
a=max(n,a)
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
H = list(map(int, input().split()))
I=[H[i]-H[i+1] for i in range(N-1)]
K=[]
for j in range(N-1):
  if I[j]>=0:
    K.append("a")
  else:
    K.append("b")
S = ''.join(K)
i=0
while "a"*(i+1) in S:
  i+=1
print(i)

Fixed submission:
N=int(input())
H = list(map(int, input().split()))
I=[H[i]-H[i+1] for i in range(N-1)]
a=0
n=0
j=0
while j<N-1:
  if I[j]>=0:
    j+=1
    n+=1
  else:
    j+=1
    a=max(n,a)
    n=0
a=max(n,a)
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
H = list(map(int, input().split()))
I=[H[i]-H[i+1] for i in range(N-1)]
K=[]
for j in range(N-1):
  if I[j]>=0:
    K.append(1)
  else:
    K.append(0)
a=map(str,K)
S = ''.join(a)
i=0
while "1"*(i+1) in S:
  i+=1
print(i)

Fixed submission:
N=int(input())
H = list(map(int, input().split()))
I=[H[i]-H[i+1] for i in range(N-1)]
a=0
n=0
j=0
while j<N-1:
  if I[j]>=0:
    j+=1
    n+=1
  else:
    j+=1
    a=max(n,a)
    n=0
a=max(n,a)
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=0
for i in range(N):
  S+=i
print(S)

Fixed submission:
N=int(input())
print(N*(N-1)//2)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input()) 
s = [input() for i in range(N)]
LIS=[]
for i in range(N):
  LIS.append(''.join(sorted(s[i])))
n=0
set1=set(LIS)
for str in set1:
  m=LIS.count(str)
  n+=m*(m-1)/2
print(int(n))

Fixed submission:
N = int(input()) 
s = [input() for i in range(N)]
LIS=[]
for i in range(N):
  LIS.append(''.join(sorted(s[i])))
LIS.sort()
n=0
prestr=LIS[0]
count=1
for st in LIS[1:]:
  if st==prestr:
    n+=count
    count+=1
  else:
    count=1
    prestr=st
print(int(n))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input()) 
s = [input() for i in range(N)]
LIS=[]
for i in range(N):
  LIS.append(sorted(s[i]))
n=0
for j in range(N):
  for h in range(j+1,N):
    if LIS[j]==LIS[h]:
      n+=1
    else:
      pass
print(n)

Fixed submission:
N = int(input()) 
s = [input() for i in range(N)]
LIS=[]
for i in range(N):
  LIS.append(''.join(sorted(s[i])))
LIS.sort()
n=0
prestr=LIS[0]
count=1
for st in LIS[1:]:
  if st==prestr:
    n+=count
    count+=1
  else:
    count=1
    prestr=st
print(int(n))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input()) 
s = [input() for i in range(N)]
alp=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t',
     'u','v','w','x','y','z']
LIS=[]
nu=0
for a in range(N):
  for b in range(a+1,N):
    c=0
    while c<26:
      if s[a].count(alp[c])==s[b].count(alp[c]):
        c+=1
      else:
        break
    if c==26:
      nu+=1
    else:
      pass
print(nu)

Fixed submission:
N = int(input()) 
s = [input() for i in range(N)]
LIS=[]
for i in range(N):
  LIS.append(''.join(sorted(s[i])))
LIS.sort()
n=0
prestr=LIS[0]
count=1
for st in LIS[1:]:
  if st==prestr:
    n+=count
    count+=1
  else:
    count=1
    prestr=st
print(int(n))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
ans = 0
for i in range(n):
    prize = input()
    if prize in s:
        continue
    else:
        s.append(prize)
        ans += 1
print(ans)

Fixed submission:
n = int(input())
s = set()
for i in range(n):
    s.add(input())
print(len(s))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
ans = 0
for i in range(n):
    prize = input()
    if prize in s:
        continue
    else:
        s.append(prize)
        ans += 1
print(len(s))

Fixed submission:
n = int(input())
s = set()
for i in range(n):
    s.add(input())
print(len(s))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for i in range(n):
    prize = input()
    if prize in s:
        continue
    else:
        s.append(prize)
print(len(s))

Fixed submission:
n = int(input())
s = set()
for i in range(n):
    s.add(input())
print(len(s))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for i in range(n):
    s.append(input())
prize_list = []
for prize in s:
    if prize in prize_list:
        continue
    else:
        prize_list.append(prize)
print(len(prize_list))

Fixed submission:
n = int(input())
s = set()
for i in range(n):
    s.add(input())
print(len(s))
Buggy python submission (verdict: Runtime Error):
n = int(input())
count_dict = {}
for _ in range(n):
    e = input()
    if e in count_dict.keys():
        count_dict[e] += 1
    else:
        count_dict[e] = 0

max_list = [e[0] for e in count_dict.items() if e[1] == max(count_dict.values())]
max_list.sort()
for i in max_list:
    print(i)

Fixed submission:
import sys
input_array = [str(e) for e in input().split()]
for i in set(input_array):
    if input_array.count(i) == 2:
        print('Yes')
        sys.exit()
    else:
        pass
print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
count_dict = {}
for _ in range(n):
    e = input()
    if e in count_dict.keys():
        count_dict[e] += 1
    else:
        count_dict[e] = 0

max_list = [e[0] for e in count_dict.items() if e[1] == max(count_dict.values())]
max_list.sort()
for i in max_list:
    print(i)

Fixed submission:
n = int(input())
count_dict = {}
for _ in range(n):
    e = input()
    if e in count_dict.keys():
        count_dict[e] += 1
    else:
        count_dict[e] = 1

m = max(count_dict.values())
for e in sorted(k for k in count_dict if count_dict[k] == m):
    print(e)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
input_array = []
for i in range(n):
    input_array.append(input())
counter = {}
max_count = 0
max_key_list = []
for i in set(input_array):
    if max_count < input_array.count(i):
        max_key_list = [i]
        max_count = input_array.count(i)
        continue
    elif input_array.count(i) == max_count:
        max_key_list.append(i)
max_key_list.sort()
for i in max_key_list:
    print(i)

Fixed submission:
n = int(input())
count_dict = {}
for _ in range(n):
    e = input()
    if e in count_dict.keys():
        count_dict[e] += 1
    else:
        count_dict[e] = 1

m = max(count_dict.values())
for e in sorted(k for k in count_dict if count_dict[k] == m):
    print(e)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
input_array = []
for i in range(n):
    input_array.append(input())
counter = {}
for i in set(input_array):
    counter[i] = input_array.count(i)
max_key_list = [kv[0] for kv in counter.items() if kv[1]==max(counter.values())]
max_key_list.sort()
for i in max_key_list:
    print(i)

Fixed submission:
n = int(input())
count_dict = {}
for _ in range(n):
    e = input()
    if e in count_dict.keys():
        count_dict[e] += 1
    else:
        count_dict[e] = 1

m = max(count_dict.values())
for e in sorted(k for k in count_dict if count_dict[k] == m):
    print(e)
Buggy python submission (verdict: Runtime Error):
def water(flowers, count):
    print(f'count : {count}')
    print(f'flowers : {flowers}')
    if len(flowers) is 0:
        return count
    count = count + min(flowers)
    flowers = [int(e-min(flowers)) for e in flowers]
    while 0 in flowers:
        count = water(flowers[:flowers.index(0)], count)
        flowers = flowers[flowers.index(0)+1: ]
    count = water(flowers, count)
    return count

n = int(input())
flowers = [int(e) for e in input().split()]

count = 0
print(f'Initialize : {flowers}')
water(flowers, count)
# while flowers.count(0) != 0:
#     print(f'{"="*20} iteration{i}')
#     flowers, count = make_zero(flowers, count)
#     print(f'flowers : {flowers}')
#     print(f'count : {count}')

Fixed submission:
def water(flowers, count):
    if len(flowers) is 0:
        return count
    count = count + min(flowers)
    flowers = [int(e-min(flowers)) for e in flowers]
    while 0 in flowers:
        count = water(flowers[:flowers.index(0)], count)
        flowers = flowers[flowers.index(0)+1: ]
    count = water(flowers, count)
    return count

n = int(input())
flowers = [int(e) for e in input().split()]

count = 0
count = water(flowers, count)
print(count)
Buggy python submission (verdict: Runtime Error):
CAKE = 4
DOUNAT = 7

def check_amount(i, j, n):
    return i*4 + j*7 == n

n = int(input())
count = 0
for i in range(int(n/CAKE+1)):
    for j in range(int(n/DOUNAT+1)):
        if check_amount(i, j, n):
            print('Yes')
            sys.exit()
print('No')

Fixed submission:
import sys


CAKE = 4
DOUNAT = 7


def check_amount(i, j, n):
    return i*4 + j*7 == n


n = int(input())
count = 0
for i in range(int(n/CAKE+1)):
    for j in range(int(n/DOUNAT+1)):
        if check_amount(i, j, n):
            print('Yes')
            sys.exit()
print('No')
Buggy python submission (verdict: Runtime Error):
import sys


def extract_digits(n):
    digits = []
    while n>0:
        digits.append(n%10)
        n = int(n/10)
    return digits


n = int(input())
digits = extract_digits(n)
for i in digits:
    if n % i == 0:
        print('Yes')
        sys.exit()
print('No')

Fixed submission:
import sys


def find_sum_of_digits(n):
    sum_of_digits = 0
    while n>0:
        sum_of_digits = sum_of_digits + n%10
        n = int(n/10)
    return sum_of_digits


n = int(input())
sum_of_digits = find_sum_of_digits(n)
if n % sum_of_digits == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
# Write and Erase
n = int(input())
a = []
count = 0
for _ in range(n):
    a.append(input())
for i in set(a):
    count += a.count(i)%2
print(count)

Fixed submission:
# Write and Erase
n = int(input())
a = {}
count = 0
for _ in range(n):
    elem = input()
    if elem not in a:
        a[elem] = 1
    else:
        a[elem] += 1
for i in a.values():
    count += i % 2
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
# Write and Erase
n = int(input())
a = []
for _ in range(n):
    elem = input()
    if elem in a:
        a.remove(elem)
    else:
        a.append(elem)
print(len(a))

Fixed submission:
# Write and Erase
n = int(input())
a = {}
count = 0
for _ in range(n):
    elem = input()
    if elem not in a:
        a[elem] = 1
    else:
        a[elem] += 1
for i in a.values():
    count += i % 2
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
iteration = int(input())
array = []
set_elem = set()
for i in range(iteration):
    e = input()
    array.append(e)
    set_elem.add(e)
ans = [e for e in set_elem if array.count(e) % 2 == 1]
print(len(ans))

Fixed submission:
# Write and Erase
n = int(input())
a = {}
count = 0
for _ in range(n):
    elem = input()
    if elem not in a:
        a[elem] = 1
    else:
        a[elem] += 1
for i in a.values():
    count += i % 2
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
iteration = int(input())
array = []
for i in range(iteration):
    e = input()
    array.append(e)
ans = [e for e in set(array) if array.count(e) % 2 == 1]
print(len(ans))

Fixed submission:
# Write and Erase
n = int(input())
a = {}
count = 0
for _ in range(n):
    elem = input()
    if elem not in a:
        a[elem] = 1
    else:
        a[elem] += 1
for i in a.values():
    count += i % 2
print(count)
Buggy python submission (verdict: Runtime Error):
import sys

n = input()
a = list(map(int, input().split()))
ans_dict = {}
if len(a)==1:
    print(a[0])
    sys.exit()
for X in range(min(a), max(a)):
    ans_dict[str(X)] = 0
    for j in a:
        if X == j or X == j-1 or X == j+1:
            ans_dict[str(X)] = ans_dict[str(X)]+1
print(max(ans_dict.values()))

Fixed submission:
n = input()
a = list(map(int, input().split()))
cnt=[0]*(10**5+2)
for i in a:
    cnt[i-1]+=1
    cnt[i]+=1
    cnt[i+1]+=1
print(max(cnt))

Buggy python submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
ans_dict = {}
for X in range(min(a), max(a)):
    ans_dict[str(X)] = 0
    for j in a:
        if X == j or X == j-1 or X == j+1:
            ans_dict[str(X)] = ans_dict[str(X)]+1
print(max(ans_dict.values()))

Fixed submission:
n = input()
a = list(map(int, input().split()))
cnt=[0]*(10**5+2)
for i in a:
    cnt[i-1]+=1
    cnt[i]+=1
    cnt[i+1]+=1
print(max(cnt))