Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02732 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
l=[0]*(n)
l1=[0]*(n)
for i in range(n):
    l[a[i]-1]+=1
    
for i in range(n):
    if l[i]>=2:
        l1[i]+=l[i]*(l[i]-1)//2

l1sum=sum(l1)
for i in range(n):
    if l[a[i]-1]-1>=2:print(l1sum-l1[a[i]-1]+ (l[a[i]-1]-1)*(l[a[i]-1]-2)//2)
    else:print(l1sum-l1[a[i]-1])

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
l=[0]*(n)
l1=[0]*(n)
for i in range(n):
    l[a[i]-1]+=1
    
def combinations_count(n,r):
    return math.factorial(n) // (math.factorial(n-r) * math.factorial(r))

for i in range(n):
    if l[i]>=2:
        l1[i]+=combinations_count(l[i],2)

l1sum=sum(l1)
for i in range(n):
    if l[a[i]-1]-1>=2:print(l1sum-l1[a[i]-1]+combinations_count(l[a[i]-1]-1,2))
    else:print(l1sum-l1[a[i]-1])
Problem p02761 (python)

Fixed submission:
n,m=map(int,input().split())
 
a=["0"]*n
 
for i in range(m):
    s,c=map(int,input().split())
    if a[s-1]=="0":
        a[s-1]=c
    elif a[s-1]!=c:
        print(-1)
        exit()

if n>1 and a[0]==0:
    print(-1)
    exit()

if n>1 and a[0]=="0":
    a[0]=1

print(*a,sep="")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
x=[list(map(int,input().split())) for _ in range(m)]
n1=[0]*n
nc=[0]*n
for i in range(n):
    if n1[x[i][0]-1]==0:
        n1[x[i][0]-1]+=x[i][1]
        nc[x[i][0]-1]+=1
    elif nc[x[i][0]-1]!=0 and n1[x[i][0]-1]!=x[i][1]:
        print(-1)
        exit()
while True:
    if n1[0]==0:n1.pop(0)
    if sum(n1)==0:
        print(0)
        exit()
    else:break
print(''.join(map(str,n1)))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
sc=[list(map(int,input().split())) for _ in range(m)]
n1=[0]*n
nc=[0]*n
for i in range(n):
    if n1[x[i][0]-1]==0:
        n1[x[i][0]-1]+=x[i][1]
        nc[x[i][0]-1]+=1
    elif nc[x[i][0]-1]!=0 and n1[x[i][0]-1]!=x[i][1]:
        print(-1)
        exit()
while True:
    if n1[0]==0:n1.pop(0)
    if sum(n1)==0:
        print(0)
        exit()
    else:break
print(''.join(map(str,n1)))
Problem p02802 (python)

Fixed submission:
import numpy as np
n,m=map(int,input().split())
p=[list(input().split()) for _ in range(m)]
a=[0]*(n+1)
w=[0]*(n+1)
for i in range(m):
    if a[int(p[i][0])]==0 and p[i][1]=='AC':
        a[int(p[i][0])]+=1
    if a[int(p[i][0])]==0 and p[i][1]=='WA':
        w[int(p[i][0])]+=1
a=np.array(a)
w=np.array(w)
aw=a*w
print(sum(a),sum(aw))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
p=[list(input().split()) for _ in range(m)]
a=[0]*(n+1)
w=[0]*(n+1)
for i in range(m):
    if a[int(p[i][0])]==0 and p[i][1]=='AC':
        a[int(p[i][0])]+=1
    if a[int(p[i][0])]==0 and p[i][1]=='WA':
        w[int(p[i][0])]+=1
a=np.array(a)
w=np.array(w)
aw=a*w
print(sum(a),sum(aw))
Problem p02817 (python)

Fixed submission:
s,t=input().split()
print(t+s)

Buggy submission (verdict: Runtime Error):
s,t=map(input().split())
print(s+t)

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
print(s+t)
Problem p02830 (python)

Fixed submission:
n=int(input())
s,t=input().split()
k=[]
for i in range(n):
    k.append(s[i])
    k.append(t[i])
print("".join(k))

Buggy submission (verdict: Runtime Error):
n=int(input())
s,t=map(input().split())
k=[]
for i in range(n):
    k.append(s[i])
    k.append(t[i])
print("".join(k))
Problem p02861 (python)

Fixed submission:
import math
n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]
l=[]
for i in range(n-1):
    for j in range(i+1,n):
        l.append(math.sqrt((xy[i][0]-xy[j][0])**2 + (xy[i][1]-xy[j][1])**2))
print(sum(l)*2/n)

Buggy submission (verdict: Runtime Error):
n=int(input())
xy=[list(map(int,input().split())) for _ in range(n)]
l=[]
for i in range(n-1):
    for j in range(i+1,n):
        l.append(math.sqrt((xy[i][0]-xy[j][0])**2 + (xy[i][1]-xy[j][1])**2))
print(sum(l)*2/n)

Buggy submission (verdict: Runtime Error):
n=int(input())
xy=[map(int,input().split()) for _ in range(n)]
l=[]
for i in range(n-1):
    for j in range(i+1,n):
        l.append(math.sqrt((xy[i][0]-xy[j][0])**2 + (xy[i][1]-xy[j][1])**2))
print(sum(l)*2/n)
Problem p02887 (python)

Fixed submission:
n=int(input())
s=input()
c=1
for i in range(1,n):
  if not(s[i]==s[i-1]):c+=1
print(c)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
c=1
for i in range(1,N):
  if not(S[i]==S[i-1]):c+=1
print(c)
Problem p02899 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=list(range(1,n+1))
ab=list(zip(a,b))
ab.sort()
l=(str(ab[i][1]) for i in range(n))
l=list(l)
print(' '.join(l))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=list(for _ in range(1,n+1))
ab=list(zip(a,b))
ab.sort()
l=(ab[i][1] for i in range(n))
print(list(l))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list([map(int,input().split()),_ for _ in range(1,n+1)])
a.sort()
l=(a[i][1] for i in range(n))
print(list(l))
Problem p02947 (python)

Fixed submission:
import collections
import math
n=int(input())
s=[]
for i in range(n):
    sl=list(input())
    sl.sort()
    s.append("".join(sl))

l=list(collections.Counter(s).values())
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

c=0
for i in range(len(l)):
    k=int(l[i])
    if k!=1:c+=combinations_count(k,2)
print(c)

Buggy submission (verdict: Runtime Error):
import collections
import math
n=int(input())
s=[''.join(list(input()).sort()) for _ in range(n)]
l=list(collections.Counter(s).values())
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

c=0
for i in range(len(l)):
    k=int(l[i])
    if k!=1:c+=combinations_count(k,2)
print(c)

Buggy submission (verdict: Runtime Error):
import collections
import math
n=int(input())
s=[]
for i in range(n):
    sl=list(input())
    sl.sort()
    s.append("".join(sl))

l=collections.Counter(s).values()
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

c=0
for i in range(len(l)):
    if l[i]!=1:c+=combinations_count(l[i],2)
print(c)

Buggy submission (verdict: Runtime Error):
import collections
import math
n=int(input())
s=[''.join(list(input()).sort()) for _ in range(n)]
l=collections.Counter(s).values()
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

c=0
for i in range(len(l)):
    if l[i]!=1:c+=combinations_count(l[i],2)
print(c)
Problem p02983 (python)

Fixed submission:
l,r=map(int,input().split())
a=range(l,r+1)[:673]
print(min(i*j % 2019 for i in a for j in a if i<j))

Buggy submission (verdict: Runtime Error):
l,r=map(int,input().split())
k=min(l%2019,(r+1)%2019)
m=max(l%2019,(r+1)%2019)
a=list(range(k,m))
a.sort()
print(min(i*j % 2019 for i in a for j in a if i<j))

Buggy submission (verdict: Runtime Error):
l,r=map(int,input().split())
k=min(l%2019,(r+1)%2019)
m=max(l%2019,(r+1)%2019)
a=list(range(k,m))
a.sort()
print(a[0]*a[1])
Problem p02995 (python)

Fixed submission:
import fractions
a,b,c,d=map(int,input().split())
cdgcd=(c*d)//fractions.gcd(c,d)
print(b-(a-1)-(b//c) +((a-1)//c) -(b//d) +((a-1)//d) +(b//cdgcd) -(a-1)//cdgcd)

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
cdgcd=(c*d)//fractions.gcd(c,d)
print(b-(a-1)-(b//c) +((a-1)//c) -(b//d) +((a-1)//d) +(b//cdgcd) -(a-1)//cdgcd)
Problem p03037 (python)

Fixed submission:
n,m=map(int,input().split())
ab=[list(map(int,input().split())) for _ in range(m)]
b=min(ab[i][1] for i in range(m))
a=max(ab[i][0] for i in range(m))
if b-a+1<0:print(0)
else:print(b-a+1)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
ab=[map(int,input().split()) for _ in range(m)]
b=min(ab[i][1] for i in range(m))
a=max(ab[i][0] for i in range(m))
print(b-a+1)
Problem p03043 (python)

Fixed submission:
import math
n,k=map(int,input().split())
s=0
for i in range(1,n+1):
    if i<k:
        s+=0.5**(-(-math.log(k/i,2)//1))
    else:
        s+=1
print(s/n)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
l=0
if n>=k:
    for i in range(1,k):
        if math.log2(k/i)==n:l+=(1-(0.5**n))/n
        else: l+= (1-(0.5**((math.log2(k/i)//1) +1)))/n
    print(1-l)
else:
    for i in range(1,n+1):
        if math.log2(k/i)==n:l+=(0.5**n)/n
        else: l+= (0.5**((math.log2(k/i)//1) +1))/n
    print(l)
Problem p03062 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
m=[]
p=[]
s=0
c=0
for i in range(n):
    s+=abs(a[i])
    if a[i]<0:
        c+=1
        c%=2
        m.append(a[i])
    else:p.append(a[i])
if c==0:print(s)
else:
    m.sort()
    if len(p)==0:
        print(s+2*m[-1])
        exit()
    p.sort()
    if abs(m[-1])>abs(p[0]):print(s+m[-1]-p[0]-m[-1]-p[0])
    else:print(s+m[-1]*2)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
m=[]
p=[]
s=0
c=0
for i in range(n):
    s+=abs(a[i])
    if a[i]<0:
        c+=1
        c%=2
        m.append(a[i])
    else:p.append(a[i])
if c==0:print(s)
else:
    m.sort()
    p.sort()
    if abs(m[-1])>abs(p[0]):print(s+m[-1]-p[0]-m[-1]-p[0])
    else:print(s)
Problem p03085 (python)

Fixed submission:
b=str(input())
print(b.translate(b.maketrans({'A':'T','C':'G','T':'A','G':'C'})))

Buggy submission (verdict: Runtime Error):
b=str(input())
print(b.translate(b.maketrans({'A':'x'},{'C':'y'},{'T':'A'},{'G':'C'},{'x':'C'},{'y':'G'})))

Buggy submission (verdict: Runtime Error):
b=input()
print(b.translate(b.maketrans({'A':'x'},{'C':'y'},{'T':'A'},{'G':'C'},{'x':'C'},{'y':'G'})))

Buggy submission (verdict: Runtime Error):
b=input()
print(b.translate(b.maketrans('A':'x','C':'y','T':'A','G':'C','x':'C','y':'G')))

Buggy submission (verdict: Runtime Error):
b=input()
print(b.translate(str.maketrans('A':'x','C':'y','T':'A','G':'C','x':'C','y':'G')))
Problem p03087 (python)

Fixed submission:
n,q=map(int,input().split())
s=input()
lr=[list(map(int,input().split())) for _ in range(q)]
l=[0]*(n+1)
for i in range(n):
    if s[i:i+2]=='AC':
        l[i+1]=l[i]+1
    else:l[i+1]=l[i]
for j in range(q):
    print( l[lr[j][1]-1] - l[lr[j][0]-1])

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=input()
lr=[list(map(int,input().split())) for _ in range(q)]
s1=len(list(s))
l=[0]*(s1-1)
for i in range(s1):
    if s[i]=='A' and s[i+1]=='C':
        l[i]+=1
for j in range(q):
    print( sum( l [lr[j][0]-1:lr[j][1]-1] ))

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
s=input()
lr=[list(map(int,input().split())) for _ in range(q)]
s1=len(list(s))
l=[0]*(s1-1)
for i in range(s1//2):
    if s[2*i]=='A' and s[2*i+1]=='C':
        l[2*i]+=1
    if s[2*i+1]=='A' and s[2*(i+1)]=='C':
        l[2*i+1]+=1
for j in range(q):
    print( sum( l [lr[j][0]-1:lr[j][1]-1] ))
Problem p03109 (python)

Fixed submission:
s=input().split('/')
if int(s[0])<2018:print('Heisei')
elif int(s[0])==2019 and int(s[1])<=4:print('Heisei')
else:print('TBD')

Buggy submission (verdict: Runtime Error):
s1,s2,s3=input().split('/')
if s1<2018:print('Heisei')
elif s1=='2019' and s2<='04':print('Heisei')
else:print('TBD')

Buggy submission (verdict: Runtime Error):
s1,s2,s3=input().split('/')
s=s1+s2+s3
if s<=20190430:print('Heisei')
else:print('TBD')

Buggy submission (verdict: Runtime Error):
s=str(input().replace('/','').strip())
if s<=20190430:print('Heisei')
else:print('TBD')

Buggy submission (verdict: Runtime Error):
s=input().replace('/','').strip()
if s<=20190430:print('Heisei')
else:print('TBD')
Problem p03147 (python)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
l=[0]
c='plus'
for i in range(n-1):
    if c=='minus' and h[i]<=h[i+1]:
        l.append(i)
    if h[i]<=h[i+1]:c='plus'
    else:c='minus'

w=0
m=0
for i in range(len(l)-1):
    w+=max(h[l[i]:l[i+1]+1])-m
    m=h[l[i+1]]
w+=max(h[l[-1]:n])-m
print(w)

Buggy submission (verdict: Runtime Error):
h=list(map(int,input().split()))
l=[0]
c='plus'
for i in range(n-1):
    if c=='minus' and h[i]<=h[i+1]:
        l.append(i)
    if h[i]<=h[i+1]:c='plus'
    else:c='minus'

w=0
m=0
for i in range(len(l)-1):
    w+=max(h[l[i]:l[i+1]+1])-m
    m=h[l[i+1]]
w+=max(h[l[-1]:n])-m
print(w)

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
l=[0]
c='plus'
for i in range(n-1):
    if c=='minus' and h[i]<=h[i+1]:
        l.append(i)
    if h[i]<=h[i+1]:c='plus'
    else:c='minus'

w=0
m=0
for i in range(len(l)-1):
    w+=max(h[l[i]:l[i+1]+1])-m
    m=h[l[i+1]]
w+=max(h[l[-1]:-1])-m
print(w)
Problem p03220 (python)

Fixed submission:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
t1=[]
for i in range(n):
    t1.append(abs(a-(t-h[i]*0.006)))
print(t1.index(min(t1))+1)

Buggy submission (verdict: Runtime Error):
n=int(input())
t,a=map(int,input().split())
h=map(int,input().split())
t1=[]
for i in range(n):
    t1.append(abs(a-(t-h[i]*0.006)))
print(t1.index(min(t1))+1)
Problem p03238 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
if n==1:print('Hello World')
a=int(input())
b=int(input())
else:print(a+b)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=int(input())
b=int(input())
if n==1:print('Hello World')
elif n==2:print(a+b)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=int(input())
b=int(input())
if n==1:print('Hello World')
else:print(a+b)
Problem p03261 (python)

Fixed submission:
n=int(input())
k=0
w=[input() for _ in range(n)]
if len(set(w))!=n:print('No')
else:
    for i in range(n-1):
        if w[i][-1]==w[i+1][0]:k+=1
    if k==n-1:print('Yes')
    else:print('No')

Buggy submission (verdict: Runtime Error):
n=int(input())
w=[input() for _ in range(n)]
if len(set(w))!=n:print('No')
else:
    for i in range(n-1):
        if w[i][-1]==w[i+1][0]:k+=1
    if k==n-1:print('Yes')
    else:print('No')
Problem p03262 (python)

Fixed submission:
import math
import numpy as np
import functools
import fractions
n,x=map(int,input().split())
p=list(map(int,input().split()))
p=np.array(p)
p=abs(p-x)
print(functools.reduce(fractions.gcd, p))

Buggy submission (verdict: Runtime Error):
import math
import numpy as np
from functools import reduce
n,x=map(int,input().split())
p=list(map(int,input().split()))
p=np.array(p)
p=p-x

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
print(gcd_list(p))

Buggy submission (verdict: Runtime Error):
import math
import numpy as np
from functools import reduce
n,x=map(int,input().split())
p=list(map(int,input().split()))
p=np.array(p)
p=p-x

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
print(gcd=list(p))
Problem p03289 (python)

Fixed submission:
from collections import Counter
l=input()
s=list(l)
k=0
if s[0]=='A':
    for i in range(2,len(s)-1):
        if s[i]=='C':
            k+=1
    if k==1:
        if l.replace('A', 'a').replace('C', 'c') == l.lower():print('AC')
        else:print('WA')
    else:print('WA')
else:print('WA')

Buggy submission (verdict: Runtime Error):
from collections import Counter
l=input()
s=list()
k=0
if s[0]=='A':
    for i in range(2,len(s)-1):
        if s[i]=='C':
            k+=1
    if k==1:
        if l.replace('A', 'a').replace('C', 'c') == l.lower():print('AC')
        else:print('WA')
    else:print('WA')
else:print('WA')

Buggy submission (verdict: Runtime Error):
from collections import Counter
s=list(input())
k=0
if s[0]=='A':
    for i in range(2,len(s)-1):
        if s[i]=='C':
            k+=1
    if k==1:
        if s.replace('A', 'a').replace('C', 'c') == s.lower():print('AC')
        else:print('WA')
    else:print('WA')
else:print('WA')
Problem p03292 (python)

Fixed submission:
k=list(map(int,input().split()))
k.sort() #デフォルトは昇順
print( abs(k[0]-k[1]) + abs(k[1]-k[2]))

Buggy submission (verdict: Runtime Error):
a1,a2,a3=map(int,input().split())
k=sorted[a1,a2,a3]
print( abs(k[2]-k[1]) + abs(k[1]-k[2]))

Buggy submission (verdict: Runtime Error):
a1,a2,a3=map(int,input().split())
k=[a1,a2,a3]
print( abs(max(k)-max(k)[1]) + abs(max(k)[1]-max(k)[2]))

Buggy submission (verdict: Runtime Error):
k=list(map(int,input().split()))
print( abs(max(k)-max(k)[1]) + abs(max(k)[1]-max(k)[2]))
Problem p03293 (python)

Fixed submission:
s=input()
t=input()
for i in range(len(s)):
    if s[i:len(s)]+s[:i]==t:
        print('Yes')
        exit()
print('No')

Buggy submission (verdict: Runtime Error):
s=list(input())
t=list(input())
k=0
for i in range(len(t)):
    if s[i]==t[i]:        
        print('Yes')
        exit()
    elif k=len(t):print('No')
    else:
      s.insert(0,s.pop(-1))
      k+=1
Problem p03294 (python)

Fixed submission:
from fractions import gcd
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
k=0
m=lcm_list(a)-1
for i in range(n):
    k+=m%a[i]
print(k)

Buggy submission (verdict: Runtime Error):
from fractions import gcd
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
k=0
m=lcm_list(a)-1
for i in range(n):
    k+=m%a[i]
print(k)

Buggy submission (verdict: Runtime Error):
from fractions import gcd
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
k=0
m=lcm_list(l)-1
for i in range(n):
    k+=m%l[i]
print(k)

Buggy submission (verdict: Runtime Error):
from fractions import gcd
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
k=0
m=lcm_list(l)-1
for i in range(n):
    k+=m%l[i]
print(k)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)
k=0
m=lcm_list(l)-1
for i in range(n):
    k+=m%l[i]
print(k)
Problem p03308 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
print(max(a)-min(a))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=map(int,input().split())
print(max(a)-min(a))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[map(int,input().split())]
print(max(a)-min(a))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[int(input()) for _ in range(n)]
print(max(a)-min(a))
Problem p03316 (python)

Fixed submission:
n=input()
n1=int(n)
n=list(n)
k=0
for i in range(len(n)):
    k+=int(n[i])
if n1%k==0:print('Yes')
else:print('No')

Buggy submission (verdict: Runtime Error):
n=input()
n1=int(n)
n=list(n)
k=0
for i in range(len(n)):
    k+=int(a[i])
if n1%k==0:print('Yes')
else:print('No')
Problem p03325 (python)

Fixed submission:
#import sys
#input()=sys.stdin.readline()
n=int(input())
a=list(map(int,input().split()))
k=0
for i in range(len(a)):
    while True:
        if a[i]%2==0:
            a[i]/=2
            k+=1
        else:break
print(k)

Buggy submission (verdict: Runtime Error):
import numpy as np
n=int(input())
a=list(map(int,input().split()))
a1=[i for i in a if i % 2 == 0]
a1=np.array(a1)
p=np.prod(a1, axis = 0)
k=0
while True:
    if p%2==0:k+=1
    else:break
print(k)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a1=[i for i in a if i % 2 == 0]
a1=np.array(a1)
p=np.prod(a1, axis = 0)
k=0
while True:
    if p%2==0:k+=1
    else:break
print(k)
Problem p03370 (python)

Fixed submission:
n,x=map(int,input().split())
m=[int(input()) for _ in range(n)]
s=x-sum(m)
print(s//min(m) + len(m))

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
m=[int(input()) for _ in range(n)]
s=x-sum(m)
print(m+s//min(m))
Problem p03386 (python)

Fixed submission:
a,b,k=map(int,input().split())
if k <= (b-a+1)//2:
  for i in range(a, a+k):
    print(i)
  for i in range(b-k+1,b+1):
    print(i)
else:
  for i in range(a,b+1):
    print(i)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
l=list(range(a,b+1))
l1=[]
for i in range(k):
    print(l[i])
    l1.append(l[i])
for j in range(b-k+1,b+1):
    if l[j] not in l1:print(l[j])
    else:pass
Problem p03408 (python)

Fixed submission:
from collections import Counter
n=int(input())
s = [input() for _ in range(n)]
m=int(input())
t = [input() for _ in range(m)]

def list_difference(s,t):
    l = s.copy()
    for value in t:
        if value in l:
            l.remove(value)
    return l
l=list_difference(s,t)
l1=Counter(l)
if len(l)>0:print(l1.most_common()[0][1])
else:print(0)

Buggy submission (verdict: Runtime Error):
from collections import Counter
n=int(input())
s = list(input() for _ in range(n))
m=int(input())
t = list(input() for _ in range(m))

def list_difference(s,t):
    l = s.copy()
    for value in t:
        if value in l:
            l.remove(value)

    return l
l=list_difference(s,t)
l1=Counter(l)
print(l1.most_common()[0][1])

Buggy submission (verdict: Runtime Error):
n=int(input())
s = list(input() for _ in range(n))
m=int(input())
t = list(input() for _ in range(m))

def list_difference(s,t):
    l = s.copy()
    for value in t:
        if value in l:
            l.remove(value)

    return l
l=list_difference(s,t)
l1=Counter(l)
print(l1.most_common()[0][1])

Buggy submission (verdict: Runtime Error):
n=int(input())
s = list(input() for _ in range(n))
m=int(input())
t = list(input() for _ in range(m))

def list_difference(s,t):
    l = s.copy()
    for value in t:
        if value in l:
            l.remove(value)

    return l
l=list_difference(s,t)
print(l.most_common()[0][1])

Buggy submission (verdict: Runtime Error):
n=int(input())
s = list(input() for _ in range(n))
m=int(input())
t = list(input() for _ in range(m))

def list_difference(s,t):
    l = s.copy()
    for value in t:
        if value in l:
            l.remove(value)

    return l
print(l.most_common()[0][1])
Problem p03416 (python)

Fixed submission:
a,b=map(int,input().split())
l=list(range(a,b+1))
s=[]
for i in range(len(l)):
    if str(l[i])[0]==str(l[i])[4] and str(l[i])[1]==str(l[i])[3]:s.append(l[i])
print(len(s))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input())
l=list(range(a,b+1))
s=[]
for i in range(len(l)):
    if str(l[i])[0]==str(l[i])[4] and str(l[i])[1]==str(l[i])[3]:s.append(l[i])
print(len(s))
Problem p03425 (python)

Fixed submission:
from itertools import combinations as c
n=int(input())
s=[input() for _ in range(n)]
march=[0]*5
for i in range(n):
    if s[i][0]=='M':march[0]+=1
    elif s[i][0]=='A':march[1]+=1
    elif s[i][0]=='R':march[2]+=1
    elif s[i][0]=='C':march[3]+=1
    elif s[i][0]=='H':march[4]+=1
print(sum(i*j*k for i, j, k in c(march, 3)))

Buggy submission (verdict: Runtime Error):
from itertools import combinations as c
n=int(input())
s=[input() for _ in range(n)]
m=[m1 for m1 in s if s.startswith('M')]
a=[a1 for a1 in s if s.startswith('A')]
r=[r1 for r1 in s if s.startswith('R')]
c=[c1 for c1 in s if s.startswith('C')]
h=[h1 for h1 in s if s.startswith('H')]
march=[len(m),len(a),len(r),len(c),len(h)]
print(sum(i*j*k for i, j, k in c(march, 3)))
Problem p03433 (python)

Fixed submission:
n=int(input())
a=int(input())
k = n%500
if k<=a:print('Yes')
else:print('No')

Buggy submission (verdict: Runtime Error):
n-int(input())
a=int(input())
k = n%500
if k<=a:print('Yes')
else:print('No')