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

Fixed submission:
n, k = map(int,input().split())
p = list(map(int, input().split()))
p.sort()
print(sum(p[:k]))

Buggy submission (verdict: Runtime Error):
n,k = map(input().split())
p = list(int,map(input().split()))
p.sort()
print(sum(p[:k]))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
p = list(map(imt,input().split()))
p.sort()
print(sum(p[:k]))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
print(sum(p[:k])

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
p = list(int,input())
p.sort()
print(sum(p[:k])

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
p = list(int,input())
print(sum(p[:k])

Buggy submission (verdict: Runtime Error):
n,k = map(input().split())
p = map(input)
print(sum(p,:k)
Problem p02639 (python)

Fixed submission:
x = list(map(int,input().split()))
 
for i in range(len(x)):
  if x[i] == 0:
    print(i+1)
    break

Buggy submission (verdict: Runtime Error):
x = list(map(int,input().split()))
 
for i in range(len(x)):
	if x[i] == 0:
    	print(i+1)
    	break

Buggy submission (verdict: Runtime Error):
x = list(map(int,input().split()))
 
for i in range(len(x)):
	IF x[i] == 0:
    	print(i+1)
    	break

Buggy submission (verdict: Runtime Error):
x = list(map(int,input().split()))
 
for i in range(len(x)):
	IF x[i] == 0:
    	print(i+1)
    ELSE:
    	pass

Buggy submission (verdict: Runtime Error):
x = list(map(int,input().split()))

for i in x:
	IF x[i] == 0:
    	print(i+1)
    ELSE:
    	pass

Buggy submission (verdict: Runtime Error):
x = list(map(int,input().split()))

for i in x:
	IF x[i] == 0:
    	i
    ELSE:
    	pass
Problem p02936 (python)

Fixed submission:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

# 遅延評価で加えてあげるだけ

N,Q = map(int,input().split())
AB = [[int(x) for x in input().split()] for _ in range(N-1)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]

graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)

value = [0] * (N+1)
for p,x in PX:
    value[p] += x

def dfs(v,parent,add):
    value[v] += add
    for x in graph[v]:
        if x == parent:
            continue
        dfs(x,v,value[v])

dfs(1,0,0)

answer = ' '.join(map(str,value[1:]))
print(answer)

Buggy submission (verdict: Runtime Error):
N,Q = list(map(int,input().split()))
ab = [[int(i) for i in input().split()] for _ in range(N-1)]
px = [[int(i) for i in input().split()] for _ in range(Q)]

graph = [[] for _ in range(N+1)]
for a,b in ab:
  graph[a].append(b)
  graph[b].append(a)

value = [0]*(N+1)
for p,x in px:
  value[p] += x

def dfs(x,parent,add):
  value[x] += add
  for i in graph[x]:
    if i == parent:
      continue
    dfs(i,x,value[x])

dfs(1,0,0)
answer = ' '.join(map(str,value[1:]))
print(answer)
Problem p02983 (python)

Fixed submission:
L,R = list(map(int,input().split()))

if R - L >= 2018:
  print(0)
else:
  min_mod = 2019
  for i in range(L,R+1):
    for j in range(i+1,R+1):
      tmp = (i * j) % 2019
      if tmp < min_mod:
        min_mod = tmp
  print(min_mod)

Buggy submission (verdict: Runtime Error):
L,R = list(map(int,input().split()))

L_mod = L % 2019
mod_list = []

for i in range(L_mod,L_mod + (R-L) + 1):
  tmp = i % 2019
  if tmp == 0:
    mod_list.append(i % 2019)
    break
  else:
    mod_list.append(i % 2019)

mod_list.sort()
print((mod_list[0] * mod_list[1]) % 2019)
Problem p02641 (python)

Fixed submission:
X,N=map(int,input().split())
if N>0:
    p=list(map(int,input().split()))
else:
    print(X)
    exit()
if X not in p:
    print(X)
    exit()
Y=X
Z=X
s=0
t=0
while s==0:
    Y+=1
    if Y not in p:
        break
while t==0:
    Z-=1
    if Z not in p:
        break
if abs(X-Y)<abs(X-Z):
    print(Y)
elif abs(X-Y)>abs(X-Z):
    print(Z)    
else:
    print(Z)

Buggy submission (verdict: Runtime Error):
X,N=map(int,input().split())
if N>0:
    p=list(map(int,input().split()))
else:
    print(X)
    exit()
l=[]
for i in range(1,101):
    l.append(i)
for i in p:
    if i in l:
        l.pop(l.index(i))
L=list(map(lambda x:abs(X-x), l))
m=min(L)
if X-m in l:
    print(X-m)
else:
    print(X+m)
Problem p02660 (python)

Fixed submission:
import collections
N=int(input())
if N==1:
    print(0)
    exit()
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
c = collections.Counter(prime_factorize(N)) 
s=list(set(prime_factorize(N)))
ans=0
def a(n):
    return (1/2)*n*(n+1)
def f(n):
    ans=0
    x=1
    while n>=a(x):
        x+=1
        ans+=1
    return ans
for i in s:
    x=c[i]
    ans+=f(x)
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
N=int(input())
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
x=prime_factorize(N)
l=list(set(prime_factorize(N)))
s=[]
for i in range(len(l)):
    s.append([])
for i in l:
    a=l.index(i)
    b=i
    for j in range(x.count(i)):
        s[a].append(i)
        i*=b
t=list(itertools.chain.from_iterable(s))
ans=0
while len(t)>0:
    p=t.pop(t.index(min(t)))
    sp=s[l.index(p)]
    ssp=sp[len(sp)-1]
    sp.pop(sp.index(ssp))
    if len(sp)>1:
        t.pop(t.index(ssp))
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools
N=int(input())
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
x=prime_factorize(N)
l=list(set(prime_factorize(N)))
s=[]
for i in range(len(l)):
    s.append([])
for i in l:
    a=l.index(i)
    b=i
    for j in range(x.count(i)):
        s[a].append(i)
        i*=b
t=list(itertools.chain.from_iterable(s))
ans=0
while len(t)>0:
    p=t.pop(t.index(min(t)))
    sp=s[l.index(p)]
    ssp=sp[len(sp)-1]
    sp.pop(sp.index(ssp))
    t.pop(t.index(ssp))
    ans+=1
print(ans)
Problem p02684 (python)

Fixed submission:
N,K=map(int,input().split())
A=list(map(int,input().split()))
l=[1]
X=[True]*N
X[0]=False
num=1
for i in range(K):
    num=A[num-1]
    if X[num-1]:
        l.append(num)
        X[num-1]=False
    else:
        q=l.index(num)
        l=l[q:]
        print(l[(K-q)%len(l)])
        exit()
print(l[-1])

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
l=[1]
X=[True]*N
X[0]=False
num=1
for i in range(K):
    num=A[num-1]
    if X[num-1]:
        l.append(num)
        X[num-1]=False
    else:
        q=l.index(num)
        l=l[q:]
        break
print(l[(K-q)%len(l)])

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
X=[1]
for i in range(K):
    x=X[-1]
    if A[x-1] in X:
        q=X.index(A[x-1])
        p=i-q+1
        break
    else:
        X.append(A[x-1])
X=X[q:]
print(X[(K-q)%p])
Problem p02687 (python)

Fixed submission:
S=input()
if S=="ABC":
    print("ARC")
else:
    print("ABC")

Buggy submission (verdict: Runtime Error):
S=int(input())
if S="ABC":
    print("ARC")
else:
    print("ABC")
Problem p02714 (python)

Fixed submission:
N=int(input())
S=list(input())
S.insert(0,0)
R=S.count("R")
G=S.count("G")
B=S.count("B")
ans=R*G*B
for i in range(1,N-1):
    for j in range(i+1,N):
        k=2*j-i
        if k<N+1 and S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
            ans-=1
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
R=[]
G=[]
B=[]
ans=0
x=0
a=0
b=0
c=0
for i in S:
    if i=="R":
        R.append(x)
    if i=="G":
        G.append(x)
    if i=="B":
        B.append(x)
    x+=1
for j in R:
    for k in G:
        if 2*k-j in B:
            B.pop(B.index(2*k-j))
            a+=1
        if 2*j-k in B:
            B.pop(B.index(2*j-k))   
            b+=1
        if (j+k)/2 in B:
            B.pop(B.index((j+k)/2))
            c+=1
        count+=len(B)
        if a!=0:
            B.append(2*k-j)
            a=0
        if b!=0:
            B.append(2*j-k)
            b=0
        if c!=0:
            B.append((j+k)/2)
            c=0
print(ans)
Problem p02767 (python)

Fixed submission:
N=int(input())
X=list(map(int,input().split()))
def P(n):
    return sum([(X[i]-n)**2 for i in range(0,N)])
l=[P(i) for i in range(1,101)]
print(min(l))

Buggy submission (verdict: Runtime Error):
N=int,input()
X=list(map(int,input().split()))
def P(n):
    return sum([(X[i]-n)**2 for i in range(0,N)])
l=[P(i) for i in range(1,101)]
print(min(l))

Buggy submission (verdict: Runtime Error):
N=int,input()
X=list(map(int,input().split()))
def P(n):
    return sum([(X[i]-n)**2 for i in range(0,N)])
l=[P(i) for i in range(1,101)]
print(min(l))
Problem p02780 (python)

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
ex = [0 for _ in range(n)]
for i in range(n):
    ex[i] = (p[i]+1)/2

sumex = sum(ex[:k])
tmp = sum(ex[:k])
for i in range(n-k):
    tmp = tmp + (ex[i+k] - ex[i])
    sumex = max(sumex, tmp)
print(sumex)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
    p = list(map(int, input().split()))
    ex = [0 for _ in range(n)]
    for i in range(n):
        ex[i] = (p[i]+1)/2

    sumex = sum(ex[:k])
    tmp = sum(ex[:k])
    for i in range(n-k):
        tmp = tmp + (ex[i+k] - ex[i])
        sumex = max(sumex, tmp)
    print(sumex)
Problem p02784 (python)

Fixed submission:
H,N=map(int,input().split())
A=list(map(int,input().split()))
if H<=sum(A):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
H,N=map(int,input().split())
A=list(map(int,input().split()))
if H<=sum(A):
    print(Yes)
else:
    print(No)

Buggy submission (verdict: Runtime Error):
H,N=map(int,input().split())
A=list(map(int,inout().split()))
if H<=sum(A):
    print(Yes)
else:
    print(No)
Problem p02789 (python)

Fixed submission:
N,M=map(int,input().split())
if N==M:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
if N=M:
    print("Yes")
else:
    print("No")
Problem p02791 (python)

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

ans = 0
n_min = 0
for i in range(0,n):
    if i == 0:
        ans += 1
        n_min = p[i]
        continue
    if p[i] <= n_min:
        ans += 1
        n_min = p[i]
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
P=list(map(int,input().split()))
def m(n):
    return min(P[:n+1])
A=[]
if m(i)==P[i] for i in range(N):
    A.append(i)
else:
    pass
print(len(A))
Problem p02802 (python)

Fixed submission:
N,M=map(int,input().split())
ac=0
wa=0
a=[0]*N
w=[0]*N
for i in range(M):
    P,S=input().split()
    if S=="WA":
        w[int(P)-1]+=1
    else:
        if a[int(P)-1]==0:
            a[int(P)-1]+=1
            ac=ac+1
            wa+=w[int(P)-1]
        else:
            pass
print(ac,wa)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
ac=0
wa=0
mydict={}
already=[]
for i in range(M):
    P,S=input().split()
    if S=="WA":
        if already.count(P)==0:
            mydict[P]=1
        else:
            mydict[P]=mydict[P]+1
    else:
        if already.count(P)==0:
            ac=ac+1
            wa=wa+mydict[P]
        else:
            pass
print(wa,ac)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
wa=0
ac=0
already=[]
for i in range(M+1):
    P,S=map(input().split())
    if S=="WA" and already.count(P)==0:
        wa=wa+1
    if S=="AC" and already.count(P)==0:
        ac=ac+1
        already.append(P)
    else:
        pass
print(wa,ac)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
wa=0
ac=0
already=[]
for i in range(M):
    P,S=map(input().split())
    if S=="WA" and already.count(P)==0:
        wa=wa+1
    if S=="AC" and already.count(P)==0:
        ac=ac+1
        already.append(P)
    else:
        pass
print(wa,ac)
Problem p02608 (python)

Fixed submission:
n=int(input())

def f_xyz(x,y,z):
  return x**2+y**2+z**2+x*y+y*z+z*x 

li=[0]*(n+5)
for x in range(1,200):
  for y in range(1,200):
    for z in range(1,200):
      num=f_xyz(x,y,z)
      if num<=n:
        li[f_xyz(x,y,z)+1]+=1
      else:
        break
        
for i in li[2:n+2]:
  print(i)

Buggy submission (verdict: Runtime Error):
n=int(input())

def f_xyz(x,y,z):
  return x**2+y**2+z**2+x*y+y*z+z*x 

li=[0]*(n+1)
for x in range(1,200):
  for y in range(1,200):
    for z in range(1,200):
      num=f_xyz(x,y,z)
      if num<=n:
        li[f_xyz(x,y,z)+1]+=1
      else:
        break
        
for i in li[2:n+1]:
  print(i)
Problem p02630 (python)

Fixed submission:
N=int(input())
listA=list(map(int, input().split()))
Q=int(input())

listB=[] #appendのために宣言が必要
while True:
    try:
        listB.append(list(map(int,input().split())))

    except:
        break;
        
sum=sum(listA)
numlist=[0]*(10**5+1)
for i in listA:
  numlist[i]+=1
  
for i in range(Q):
  B=listB[i][0]
  C=listB[i][1]
  if numlist[B]!=0:
    sum=sum+(C-B)*numlist[B]
    # print(C)
    numlist[C]+=numlist[B]
    numlist[B]=0
    # print(numlist)
  print(sum)

Buggy submission (verdict: Runtime Error):
N=int(input())
listA=list(map(int, input().split()))
Q=int(input())

listB=[] #appendのために宣言が必要
while True:
    try:
        listB.append(list(map(int,input().split())))

    except:
        break;
        
sum=sum(listA)
numlist=[0]*(10*5+1)
for i in range(10*5+1):
  numlist[i]=listA.count(i)
  
for i in range(Q):
  B=listB[i][0]
  C=listB[i][1]
  sum=sum+(C-B)*numlist[B]
  numlist[C]+=numlist[B]
  numlist[B]=0
  # print(numlist)
  print(sum)

Buggy submission (verdict: Runtime Error):
N=int(input())
listA=list(map(int, input().split()))
Q=int(input())

listB=[] #appendのために宣言が必要
while True:
    try:
        listB.append(list(map(int,input().split())))

    except:
        break;
        
sum=sum(listA)
numlist=[0]*(4+1)
for i in range(4+1):
  numlist[i]=listA.count(i)
  
for i in range(Q):
  B=listB[i][0]
  C=listB[i][1]
  sum=sum+(C-B)*numlist[B]
  numlist[C]+=numlist[B]
  numlist[B]=0
  # print(numlist)
  print(sum)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
N=int(input())
while True:
    try:
        listA=list(map(int,input().split()))
        #listA<-[1,2,2,3,1]
        #ここに逐次処理を書けばいいと思う。
    except:
        break;

product=1
for i in listA:
  if product<10**18+1:
  	product=product*i
    
if listA.count(0)>0:
  print(0)
    
elif product<10**18+1:
  print(product)
  
elif product>=10**18+1:
  print(-1)
Problem p03471 (python)

Fixed submission:
import sys
N,Y = map(int,input().split())

for A in range(N+1):
  for B in range(N-A+1):
    C=N-A-B
    if (10000*A+5000*B+1000*C==Y):
      print(A,B,C)        
      sys.exit()
print(-1,-1,-1)

Buggy submission (verdict: Runtime Error):
    import sys
    N,Y = map(int,input().split())
     
    for A in range(N+1)[::-1]:
      for B in range(N-A+1)[::-1]:
        C=N-A-B
        if (10000*A+5000*B+1000*C==Y):
          print(A,B,C)        
          sys.exit()
    print(-1,-1,-1)
Problem p02612 (python)

Fixed submission:
N = int(input())
a = N % 1000
b = 1000 - a if a!=0 else 0
print(b)

Buggy submission (verdict: Runtime Error):
N = int
a = (N/1000-int(N/1000))*1000
print(a)
Problem p02613 (python)

Fixed submission:
N = int(input())
Ss = []
for i in range(N):
	Ss.append(input())
	
C0, C1, C2, C3 = 0, 0, 0, 0
for S in Ss:
	if S == 'AC':
		C0 += 1
	elif S == 'WA':
		C1 += 1
	elif S == 'TLE':
		C2 += 1
	else:
		C3 += 1
print("AC x {}".format(C0))
print("WA x {}".format(C1))
print("TLE x {}".format(C2))
print("RE x {}".format(C3))

Buggy submission (verdict: Runtime Error):
Ss = []
for i in range(N):
	Ss.append(input())
	
C0, C1, C2, C3 = 0, 0, 0, 0
for S in Ss:
	if S == 'AC':
		C0 += 1
	elif S == 'WA':
		C1 += 1
	elif S == 'TLE':
		C2 += 1
	else:
		C3 += 1
print("AC x {}".format(C0))
print("WA x {}".format(C1))
print("TLE x {}".format(C2))
print("RE x {}".format(C3))
Problem p02615 (python)

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

A.sort(reverse=True)
ans = 0

for i in range(N-1):
	ans += A[(i+1)//2]

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

A.sort(reverse=True)
ans = 0

if N%2 == 1:
	k = (N+1)/2
	for i in range(k):
		ans += A[i]*2
	ans -= A[0]
	ans -= A[k]
else:
	k = N/2
	for i in range(k):
		ans += A[i]*2
	ans -= A[0]

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

A.sort(reverse=True)
ans = 0

if N%2 == 1:
	k = (N+1)/2
	for i in range(k):
		ans += A[i]*2
	ans -= A[0]
	ans -= A[k]
	print(ans)
else:
	k = N/2
	for i in range(k):
		ans += A[i]*2
	ans -= A[0]
	print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

A.sort(reverse=True)
ans = 0

if N%2 == 1:
	for i in range((N+1)/2):
		ans += A[i]*2
	ans -= A[0]
	ans -= A[(N+1)/2]
	print(ans)
else:
	for i in range(N/2):
		ans += A[i]*2
	ans -= A[0]
	print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = []
for i in range(N):
	A.append(map(int, input().split()))

A.sort(reverse=True)
ans = 0

if N%2 == 1:
	for i in range((N+1)/2):
		ans += A[i]*2
	ans -= A[0]
	ans -= A[(N+1)/2]
	print(ans)
else:
	for i in range(N/2):
		ans += A[i]*2
	ans -= A[0]
	print(ans)
Problem p02621 (python)

Fixed submission:
a = int(input())
b = a + a*a + a*a*a
print(int(b))

Buggy submission (verdict: Runtime Error):
a = int(input)
b = a + a^2 * a^3
print(b)
Problem p02628 (python)

Fixed submission:
N, K = map(int, input().split())
P = list(map(int, input().split()))

P.sort()
s = 0
for i in range(K):
	s += P[i]

print(s)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
P = map(int, input().split())

P.sort()
s = 0
for i in range(K):
	s += P[i]

print(s)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
Pn = list(map(int, input().split()))

Pn.sort()
s = 0
for i in range(K):
	s += Pn[K]

print(s)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
Pn = list(map(int, input().split()))

Pn.sort()
sum = 0
for i in range(K):
	sum += Pn[K]

print(sum)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
Pn = []
for i in range(N):
	Pn.append(input())

Pn.sort()
sum = 0
for i in range(K):
	sum += Pn[K]

print(sum)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
Pn = []
for i in range(N):
	Pn.append(input())

Qn = sorted(Pn)
sum = 0
for i in range(K):
	sum += Qn[K]

print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
Pn = []
for i in range(N):
	Pn.append(input())

Qn = sorted(Pn)
sum = 0
for i in range(K):
	sum += Qn[K]

print(sum)
Problem p03377 (python)

Fixed submission:
A,B,X=map(int,input().split())
if A>X:
    print("NO")
elif A<=X<=A+B:
    print("YES")
else :
    print("NO")

Buggy submission (verdict: Runtime Error):
A,B,X=map(int,input().split())
if A>X:
    print("NO")
elif A<=X=<A+B:
    print("YES")
else :
    print("NO")
Problem p03447 (python)

Fixed submission:
X=int(input())
A=int(input())
B=int(input())
a=X-A
b=int(a/B)
print(a-b*B)

Buggy submission (verdict: Runtime Error):
    X=int(input())
    A=int(input())
    B=int(input())
    a=X-A
    b=int(a/B)
    print(a-b*B)
Problem p03759 (python)

Fixed submission:
a,b,c=map(int,input().split())
if b-a==c-b:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if b-a=c-b:
    print("YES")
else:
    print("NO")
Problem p03962 (python)

Fixed submission:
a,b,c=map(int,input().split())
if a==b==c :
    print(1)
elif a==b and not b==c:
    print(2)
elif b==c and not a==c :
    print(2)
elif c==a and not a==b :
    print(2)
else :
    print(3)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a=b=c :
    print(1)
elif a=b and not b=c:
    print(2)
elif b=c and not a=c :
    print(2)
elif c=a and not a=b :
    print(2)
else :
    print(3)
Problem p02658 (python)

Fixed submission:
n = int(input())
a = input().split(" ")
kotae=1
listaa = [int(n) for n in a]
lista = sorted(listaa)
if lista[0]==0:
  print(0)
  exit()
for i in range(n):
  kotae*=lista[i]
  if kotae>10**18:
    kotae=-1
    break
if kotae>10**18:
  kotae=-1
print(kotae)

Buggy submission (verdict: Runtime Error):
from decimal import*
n = int(input())
a = input().split(" ")
kotae=Decimal(1)
lista = [int(n) for n in a]
for i in range(n):
  kotae*=Decimal(lista[i])
if kotae>10**18:
  kotae=-1
print(int(kotae))

Buggy submission (verdict: Runtime Error):
from decimal import*
n = int(input())
a = input().split(" ")
kotae=Decimal(1)
lista = [int(n) for n in a]
for i in range(n):
  kotae*=Decimal(lista[i])
if kotae>10**18:
  kotae=-1
print(kotae)

Buggy submission (verdict: Runtime Error):
from decimal import
n = int(input())
a = input().split(" ")
kotae=Decimal(1)
lista = [int(n) for n in a]
for i in range(n):
  kotae*=Decimal(lista[i])
if kotae>10**18:
  kotae=-1
print(kotae)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split(" ")
lista = [int(n) for n in a]
if 0 in lista:
  print(0)
  exit(0)
else:
  kotae=1
  for i in range(n+1):
    kotae=kotae*lista[i]
    if kotae>10**18:
        print(-1)  
        exit(0)
  print(kotae)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split(" ")
lista = [int(n) for n in a]
if 0 in lista:
  print(0)
  exit()
kotae=1
while kotae<=10**18:
  for i in range(n+1):
    kotae=kotae*lista[i]
  print(kotae)
  break
print(-1)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split(" ")
lista = [int(n) for n in a]
if 0 in lista:
  print(0)
  exit()
else:
  kotae=1
  for i in range(n+1):
    kotae=kotae*lista[i]
    if kotae>10**18:
        print(-1)  
        exit()
  print(kotae)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input().split(" ")
lista = [int(n) for n in a]
if 0 in lista:
  print(0)
  exit()
kotae=1
for i in range(n+1):
  kotae=kotae*lista[i]
  if kotae>10**18:
    print(-1)
    exit()
print(kotae)
Problem p02730 (python)

Fixed submission:
s = input()
n = len(s)
a = s[:(n-1)//2]
b = s[(n+3)//2-1:]

t = s[::-1]
c = t[:(n-1)//2]
d = t[(n+3)//2-1:]
if (a==b) and (b==c) and (c==d) and (d==a):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
n = len(s)
a = s[:(n-1)//2-1]
b = s[-(n+3)//2:]

t = s[::-1]
c = t[:(n-1)//2-1]
d = t[-(n+3)//2:]
if (a==d) and (b==c) :
  if(a==b):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
n = len(s)
a = s[:(n-1)//2-1]
b = s[-(n+3)//2:]
e = s[
t = s[::-1]
c = t[:(n-1)//2-1]
d = t[-(n+3)//2:]
if (a==b) and (b==c) and (c==d):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
n = len(s)
a = s[:(n-1)/2-1]
b = s[-(n+3)/2:]
lang:reverse.py
t = s[::-1]
c = t[:(n-1)/2-1]
d = t[-(n+3)/2:]
if (a==b) and (b==c) and (c==d):
  print('Yes')
else:
  print('No')