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

Fixed submission:
N = int(input())
A = []
for _ in range(N):
    A.append(int(input()))

phai = 1
cnt = 0
loop_hantei = {1}

for _ in range(N):
    phai = A[phai-1]
    cnt += 1
    if phai in loop_hantei:
        print('-1')
        break
    else:
        loop_hantei.add(phai)
    if phai == 2:
        print(cnt)
        break

Buggy submission (verdict: Runtime Error):
phai = 1
cnt = 0
loop_hantei = {1}

for _ in range(N):
    phai = A[phai-1]
    cnt += 1
    if phai in loop_hantei:
        print('-1')
        break
    else:
        loop_hantei.add(phai)
    if phai == 2:
        print(cnt)
        break
Problem p02969 (python)

Fixed submission:
print(3*int(input())**2)

Buggy submission (verdict: Runtime Error):
r=input()
a= 3*r**2
print(a)
Problem p03997 (python)

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

area = (a+b)*h/2
print(int(area))

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
print((a+b)*c/2)

Buggy submission (verdict: Runtime Error):
data = int(input().split())

print((data[0]+data[1])*data[2]/2)

Buggy submission (verdict: Runtime Error):
from sys import stdin

input_data = int(stdin.readline().rstrip())

print((input[0]+input[1])*input[3]/2)
Problem p03998 (python)

Fixed submission:
a = input()
b = input()
c = input()
first_str = a[0]
a = a[1:]
while(1):
  if first_str == 'a':
    if len(a)==0:
      print('A')
      break
    first_str = a[0]
    a = a[1:]
    
  elif first_str == 'b':
    if len(b)==0:
      print('B')
      break
    first_str = b[0]
    b = b[1:]
    
  elif first_str == 'c':
    if len(c)==0:
      print('C')
      break
    first_str = c[0]
    c = c[1:]

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
c = input()
first_str = a[0]
a = a[1:]
while(1):
  if first_str == 'a':
    first_str = a[0]
    a = a[1:]
    if len(a)==0:
      print('A')
      break
  elif first_str == 'b':
    first_str = b[0]
    b = b[1:]
    if len(b)==0:
      print('B')
      break
  elif first_str == 'c':
    first_str = c[0]
    c = c[1:]
    if len(c)==0:
      print('C')
      break
Problem p04001 (python)

Fixed submission:
s = input()
n = len(s) - 1
answers = []
sl = [s[i] for i in range(len(s))]
for i in range(2 ** n):
    tmp = []
    for j in range(n):
        if ((i >> j) & 1):
            tmp.append(j)
    ll = ['*']*len(s)
    for k in tmp:
        ll[k] = '+'
    ans = []
    for k, _ in zip(sl, ll):
        ans.append(k)
        ans.append(_)
    ans = [_ for _ in ans if _ != '*']
    ans = ''.join(ans)
    ans = ans.split('+')
    ans = [int(_) for _ in ans if _ != '+']
    ans = sum(ans)
    answers.append(ans)
print(sum(answers))

Buggy submission (verdict: Runtime Error):
S = input()
n = len(S)
ans = 0
for bit in range(1 << (n-1)):
  f = S[0]
  for i in range(n-1):
    if bit & (1 << (n-1)):
      f += "+"
    f += S[i+1]
    ans += sum(map(int,f.split("+")
print(ans)

Buggy submission (verdict: Runtime Error):
a = input()
sum = int(a)
for i in range(len(a)-1):
  sum += int(a[i])
  
  sum += int(a[:i+1]) + int(a[i+1:])
sum += int(a[i+1]) 
print(sum)

Buggy submission (verdict: Runtime Error):
a = input()
sum = int(a)
for i in range(len(a)-1):
  sum += int(a[:i]) + int(a[i+1:])
print(int(sum))
Problem p02971 (python)

Fixed submission:
from copy import copy


def main():
    N = int(input())
    A_list = [int(input()) for _ in range(N)]
    tmp_list = copy(A_list)
    tmp_list.sort()
    max_num = tmp_list[-1]
    second_max_num = tmp_list[-2]
    max_index = A_list.index(max_num)
    for i in range(N):
        if i is max_index:
            print(second_max_num)
            continue
        print(max_num)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):


def main():
    N = int(input())
    A_list = [int(input()) for _ in range(N)]
    tmp_list = copy(A_list)
    tmp_list.sort()
    max_num = tmp_list[-1]
    second_max_num = tmp_list[-2]
    max_index = A_list.index(max_num)
    for i in range(N):
        if i is max_index:
            print(second_max_num)
            continue
        print(max_num)


if __name__ == '__main__':
    main()
Problem p03470 (python)

Fixed submission:
if __name__ == '__main__':
    N = int(input())
    l = [int(input()) for i in range(N)]
    # l = [10, 8, 8, 6]
    s = set(l)
    print(len(s))

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    N = int(input())
    l = [list(map(int, input())) for i in range(N)]
    # l = [10, 8, 8, 6]
    s = set(l)
    print(len(s))
Problem p02988 (python)

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

ans = 0
for i in range(1, n-1):
    if P[i-1] < P[i] < P[i+1] or P[i+1] < P[i] < P[i-1]:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
    n = int(input())
    P = list(map(int, input().split()))     
     
    ans = 0
    for i in range(1, n-1):
        if P[i-1] < P[i] < P[i+1] or P[i+1] < P[i] < P[i-1]:
            ans += 1
     
    print(ans)

Buggy submission (verdict: Runtime Error):
import sys
n = int(sys.stdin.readline())
p = list(int(sys.stdin.readline().rstrip().split()))
ans = 0

for i in range(1, n - 1):
    if (p[i-1] < p[i] < p[i+1]) or (p[i+1] < p[i] < p[i-1]):
        ans +=1
    
print(ans)
Problem p03106 (python)

Fixed submission:
A, B, K = map(int, input().split())
L = [1]

for i in range(2, 101):
    if A % i == 0 and B % i == 0:
        L.append(i)

print(L[-K])

Buggy submission (verdict: Runtime Error):
import math

A, B, K = map(int, input().split())
C = math.gcd(A, B)
L = [1]

for i in range(2, C+1):
    if A % i == 0 and B % i == 0:
        L.append(i)

print(L[-K])
Problem p02969 (python)

Fixed submission:
r = int(input())**2*3
print(r)

Buggy submission (verdict: Runtime Error):
r = int(input())
int(a) = 3*r*r
print(a)
Problem p02981 (python)

Fixed submission:
N,A,B = [int(zz) for zz in input().split()]
i = N*A
if i <= B:
    print(i)
elif i >= B:
    print(B)

Buggy submission (verdict: Runtime Error):
N,A,B = [ int(i)for i in input().split()]
c = N*A
if c >= B:
    print(B)
elif c <= B:
    print(C)

Buggy submission (verdict: Runtime Error):
N,A,B = [ int(i)for i in input().split()]
c = N*A
if c >= B:
    print(B)
elif c <= B:
    print(C)
Problem p02971 (python)

Fixed submission:
n = int(input())
ls = []
for i in range(n):
    ls.append(int(input()))
maxnum = max(ls)
ind = ls.index(maxnum)
ls.remove(maxnum)
secondnum = max(ls)
ls = ls[0:ind] + [maxnum] + ls[ind:]
#print(ls)
if maxnum == secondnum:
    for i in range(n):
        print(maxnum)
    quit()
for i in range(n):
    if ls[i] == maxnum:
        print(secondnum)
    else:
        print(maxnum)

Buggy submission (verdict: Runtime Error):
n = int(input())
ls = []
for i in range(n):
    ls.append(int(input()))
maxnum = max(ls)
for i in range(n):
    if max > ls[i]:
        print(maxnum)
    else:
        lstmp = ls[0:i] + ls[i+1:]
        print(max(lstmp))
Problem p02969 (python)

Fixed submission:
n=int(input())
print(3*n*n)

Buggy submission (verdict: Runtime Error):
r=input()
print(3*r*r)
Problem p03024 (python)

Fixed submission:
S=input()
if S.count("o")+15-len(S)>=8:
	print("YES")
else:
	print("NO")

Buggy submission (verdict: Runtime Error):
S=input()
if S.count"o"+15-len(S)>=8:
	print("YES")
else:
	print("NO")

Buggy submission (verdict: Runtime Error):
S=input()
if S.count"o"+15-len(S)>=8
	print("YES")
else:
	print("NO")
Problem p03029 (python)

Fixed submission:
A,P=[int(i) for i in input().split()]
print((A*3+P)//2)

Buggy submission (verdict: Runtime Error):
A,P=[int(i) for input().split()]
print((A//3+P)//2)
Problem p03030 (python)

Fixed submission:
N=int(input())
restaurants=[]
for i in range(N):
  S,P=input().split()
  restaurants.append([S,int(P),i+1])
restaurants=sorted(restaurants,key=lambda x:-x[1])
restaurants=sorted(restaurants,key=lambda x:x[0])
for i in restaurants:
	print(i[2])

Buggy submission (verdict: Runtime Error):
N=int(input())
restaurants={}
for i in range(N):
  S,P=input().split()
  restaurants[S]=[int(P),i+1]
restaurants=sorted(restaurants.items(),key=lambda x:x[1][0])
restaurants=sorted(restaurants.items(),key=lambda x:x[0])
for i in restaurants.values():
  print(i[1])
Problem p03043 (python)

Fixed submission:
import math
N,K=[int(i) for i in input().split()]
res=0
for i in range(1,N+1):
	if i<K:
		po=math.ceil(math.log2(K/i))
		j=math.pow(0.5,po)
	else:
		j=1
	res+=j
print(res/N)

Buggy submission (verdict: Runtime Error):
N,K=[int(i) for i in input().split()]
res=0
for i in range(1,N+1):
  res+=0.5**(math.ceil(math.log2(K/i)))
print(res/N)
Problem p03044 (python)

Fixed submission:
import math
import sys
sys.setrecursionlimit(30000)
N=int(input())
edges=[[] for i in range(N+1)]
d=[-1 for i in range(N+1)]
for i in range(1,N):
	u,v,w=[int(i) for i in input().split()]
	edges[u].append([v,w])
	edges[v].append([u,w])
def kyori(u):
	for v,w in edges[u]:
		if d[v]==-1:
			d[v]=d[u]+w
			kyori(v)
d[1]=0
kyori(1)
for i in d[1:]:
	if i%2==0:
		print(1)
	else:
		print(0)

Buggy submission (verdict: Runtime Error):
import math
import sys
sys.setrecursionlimit(30000)
N=int(input())
edges=[[] for i in range(N+1)]
d=[-1 for i in range(N+1)]
for i in range(1,N):
	u,v,w=[int(i) for i in input().split()]
	edges[u].append([v,w])
	edges[v].append([u,w])
def kyori(u):
	for v,w in edges[u]:
		if d[v]==-1:
			d[v]=d[u]+w
			kyori(v)
d[1]=0
kyori(1)
for i in d[1:]:
	if i%2==0:
		print(1)
	else:
		print(0)

Buggy submission (verdict: Runtime Error):
import math
import sys
sys.setrecursionlimit(20000)
N=int(input())
edges=[[] for i in range(N+1)]
d=[-1 for i in range(N+1)]
for i in range(1,N):
	u,v,w=[int(i) for i in input().split()]
	edges[u].append([v,w])
	edges[v].append([u,w])
def kyori(u):
	for v,w in edges[u]:
		if d[v]==-1:
			d[v]=d[u]+w
			kyori(v)
d[1]=0
kyori(1)
for i in d[1:]:
	if i%2==0:
		print(1)
	else:
		print(0)

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
edges=[[] for i in range(N+1)]
d=[-1 for i in range(N+1)]
for i in range(1,N):
	u,v,w=[int(i) for i in input().split()]
	edges[u].append([v,w])
	edges[v].append([u,w])
def kyori(u):
	for v,w in edges[u]:
		if d[v]==-1:
			d[v]=d[u]+w
			kyori(v)
d[1]=0
kyori(1)
for i in d[1:]:
	if i%2==0:
		print(1)
	else:
		print(0)

Buggy submission (verdict: Runtime Error):
import math
N=int(input())
edges=[[] for i in range(N+1)]
d=[-1 for i in range(N+1)]
for i in range(1,N):
	u,v,w=[int(i) for i in input().split()]
	edges[u].append([v,w])
	edges[v].append([u,w])
def kyori(u):
	for v,w in edges[u]:
		if d[v]==-1:
			d[v]=d[u]+w
			kyori(v)
d[1]=0
kyori(1)
for i in d[1:]:
	if i%2==0:
		print(1)
	else:
		print(0)
Problem p03060 (python)

Fixed submission:
N=int(input())
V=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
res=0
for vv,cc in zip(V,C):
  if vv-cc>0:
    res=res+vv-cc
print(res)

Buggy submission (verdict: Runtime Error):
N=int(input())
V=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
res=0
for vv cc in zip(V,C):
  if vv-cc>0:
    res=res+vv-cc
print(res)
Problem p03074 (python)

Fixed submission:
N,K=[int(i) for i in input().split()]
S=input()
cur=0
line=[]

for i in range(len(S)):
	if i==0:
		if S[0]=="0":
			line.append(0)
		line.append(1)
	else:
		if S[i-1]!=S[i]:
			line.append(1)
		else:
			line[-1]+=1
c=0
for i in range(len(line)):

	if i==0:
		if i+2*K+1<=len(line):
			s=sum(line[i:2*K+1])
			c=s
		else:
			s=sum(line[i:])
			c=s
	elif i%2==0:
		if i+2*K+1<=len(line):
			s=s-line[i-2]-line[i-1]+line[i+2*K-1]+line[i+2*K]
			c=max(c,s)
		else:
			c=max(c,sum(line[i:]))
			break
print(c)

Buggy submission (verdict: Runtime Error):
N,K=[int(i) for i in input().split()]
S=input()
cur=0
line=[]

for i in range(len(S)):
	if i==0:
		if S[0]=="0":
			line.append(0)
		line.append(1)
	else:
		if S[i-1]!=S[i]:
			line.append(1)
		else:
			line[-1]+=1
c=0
for i in range(len(line)):

	if i==0:
		if 2*K+1<=len(line):
			s=sum(line[i:2*K+1])
			c=s
		else:
			s=sum(line[i:])
			c=s
	elif i%2==0:
		if i+2*K<=len(line):
			s=s-line[i-2]-line[i-1]+line[i+2*K-1]+line[i+2*K]
			c=max(c,s)
		else:
			c=max(c,sum(line[i:]))
			break
print(c)

Buggy submission (verdict: Runtime Error):
N,K=[int(i) for i in input().split()]
S=input()
cur=0
line=[]

for i in range(len(S)):
	if i==0:
		if S[0]=="0":
			line.append(0)
		line.append(1)
	else:
		if S[i-1]!=S[i]:
			line.append(1)
		else:
			line[-1]+=1
c=0
for i in range(len(line)):

	if i==0:
		if 2*K+1<=len(line):
			s=sum(line[i:2*K+1])
			c=s
		else:
			s=sum(line[i:])
			c=S
	elif i%2==0:
		if i+2*K+1<=len(line):
			s=s-line[i-2]-line[i-1]+line[i+2*K-1]+line[i+2*K]
			c=max(c,s)
		else:
			c=max(c,sum(line[i:]))
			break
print(c)
Problem p03078 (python)

Fixed submission:
import heapq
X,Y,Z,K=[int(i) for i in input().split()]
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
A.sort(key=lambda x:-x)
B.sort(key=lambda y:-y)
C.sort(key=lambda z:-z)
pri=[]
def dp(x,y,z):
  return A[x]+B[y]+C[z]

def priq(a,b,c):
  d=-dp(a,b,c)
  if tuple([d,a,b,c]) not in pri:
    heapq.heappush(pri,(d,a,b,c))

heapq.heappush(pri,(-dp(0,0,0),0,0,0))

for i in range(K):
  d,x,y,z=heapq.heappop(pri)
  print(-d)
  if x<X-1:
    priq(x+1,y,z)
  if y<Y-1:
    priq(x,y+1,z)
  if z<Z-1:
    priq(x,y,z+1)

Buggy submission (verdict: Runtime Error):
from collections import deque
X,Y,Z,K=[int(i) for i in input().split()]
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
A.sort(key=lambda x:-x)
B.sort(key=lambda y:-y)
C.sort(key=lambda z:-z)
pri=deque()
def dp(l):
  return A[l[0]]+B[l[1]]+C[l[2]]

def priq(a,b,c):
  if [a,b,c] not in pri:
    for i in range(len(pri)):      
      if dp(pri[i])>dp([a,b,c]):
        pri.insert(i,[a,b,c])
        return
    pri.append([a,b,c])
pri.append([0,0,0])
for i in range(K):
  x,y,z=pri.pop()
  print(dp([x,y,z]))
  if x<X-1:
    priq(x+1,y,z)
  if y<Y-1:
    priq(x,y+1,z)
  if z<Z-1:
    priq(x,y,z+1)

Buggy submission (verdict: Runtime Error):
from collections import deque
X,Y,Z,K=[int(i) for i in input().split()]
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
A.sort(key=lambda x:-x)
B.sort(key=lambda y:-y)
C.sort(key=lambda z:-z)
pri=deque()
def dp(l):
  return A[l[0]]+B[l[1]]+C[l[2]]

def priq(a,b,c):
  if [a,b,c] not in pri:
    for i in range(len(pri)-1,-1,-1):
      
      if dp(pri[i])>dp([a,b,c]):
        pri.insert(i+1,[a,b,c])
        return
    pri.append([a,b,c])

pri.append([0,0,0])
for i in range(K):
  x,y,z=pri.popleft()
  print(dp([x,y,z]))
  if x<X-1:
    priq(x+1,y,z)
  if y<Y-1:
    priq(x,y+1,z)
  if z<Z-1:
    priq(x,y,z+1)
Problem p03106 (python)

Fixed submission:
A,B,K=[int(i) for i in input().split()]
a=[]
for i in range(1,max(A,B)+1):
  if A%i==0 and B%i==0:
    a.append(i)
print(a[-K])

Buggy submission (verdict: Runtime Error):
A,B,K=[int(i) for i in input().split()]
a=[]
for i in range(1,max(A,B)):
  if A%i==0 and B%i==0:
    a.append(i)
print(a[-k])
Problem p03126 (python)

Fixed submission:
N,M=[int(i) for i in input().split()]
buf=[0]*M
for i in range(N):
  a=[int(i) for i in input().split()]
  for j in a[1:]:
    buf[j-1]+=1
c=0
for i in buf:
  if i==N:
    c+=1
print(c)

Buggy submission (verdict: Runtime Error):
N,M=[int(i) for i in input().split()]
buf=[0]*M
for i in range(N):
  a=[int(i) for i in input().split()]
  for j in a[1:]:
    buf[j]+=1
c=0
for i in buf:
  if i==N:
    c+=1
print(c)
Problem p04012 (python)

Fixed submission:
w=input()
def solve():
  for j in [chr(i) for i in range(91,91+26)]:
    if w.count(j)%2!=0:
      print("No")
      return
  print("Yes")
  return

solve()

Buggy submission (verdict: Runtime Error):
w=input()
def solve():
  for j in [chr(i) for i in range(91,91+26)]
    if w.count(j)%2==0:
      print("No")
      return
  print("Yes")
  return

solve()
Problem p02969 (python)

Fixed submission:
a = int(input())
print(a*a*3)

Buggy submission (verdict: Runtime Error):
a = int(input())
print (ans = 3*a*a)
Problem p02995 (python)

Fixed submission:
A, B, C, D = map(int, input().split())
bc = B // C
bd = B // D
ac = (A - 1) // C
ad = (A - 1) // D
def gcd(C, D):
    while D:
        C, D = D, C % D
    return C
def lcm(C, D):
    return C * D // gcd(C, D)
bcd = B // lcm(C, D)
acd = (A - 1) // lcm(C, D)
a = bc - ac
b = bd - ad
c = bcd - acd
print((B + 1 - A) - (a + b - c))

Buggy submission (verdict: Runtime Error):
import math
A, B, C, D = map(int, input().split())
bc = B // C
bd = B // D
ac = (A - 1) // C
ad = (A - 1) // D
def lcm(C, D):
    return (C * D) // math.gcd(C, D)
bcd = B // lcm(C, D)
acd = (A - 1) // lcm(C, D)
a = bc - ac
b = bd - ad
c = bcd - acd
print((B + 1 - A) - (a + b - c))
Problem p03076 (python)

Fixed submission:
M = [int(input()) for _ in range(5)]
m = []
T = 0
for i in range(5):
    if M[i] % 10 == 0:
        T += M[i]
    else:
        T += M[i]
        T += 10 - M[i] % 10
        m.append(M[i] % 10)
print(T - (10 - (10 if not m else min(m))))

Buggy submission (verdict: Runtime Error):
# A = int(input())
# B = int(input())
# C = int(input())
# D = int(input())
# E = int(input())
M = [int(input()) for _ in range(5)]
m = []
T = 0
for i in range(5):
    if M[i] % 10 == 0:
        T += M[i]
    else:
        T += M[i]
        T += 10 - M[i] % 10
        m.append(M[i] % 10)
print(T - (10 - min(m)))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
M = [A, B, C, D, E]
n = []
T = 0
for i in range(5):
    if M[i] % 10 == 0:
        T += M[i]
    else:
        T += M[i]
        T += 10 - M[i] % 10
        n.append(M[i] % 10)
print(T - (10 - min(n)))

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
M = [A, B, C, D, E]
N = []
n = []
T = 0
for i in range(5):
    if M[i] % 10 == 0:
        T += M[i]
    else:
        T += M[i]
        T += 10 - M[i] % 10
        n.append(M[i] % 10)
print(T - (10 - min(n)))
Problem p03106 (python)

Fixed submission:
A,B,K = map(int,input().split())
S = []
for i in range(100):
    if A % (i + 1) == 0 and B % (i + 1) == 0:
        S.append(i + 1)
print(S[-K])

Buggy submission (verdict: Runtime Error):
A,B,K = map(int,input().split())
S = []
for i in range(50):
    if A % (i + 1) == 0 and B % (i + 1) == 0:
        S.append(i + 1)
print(S[-K])
Problem p02969 (python)

Fixed submission:
r = int(input())
result = 3*r*r
print(result)

Buggy submission (verdict: Runtime Error):
r = input()
result = 3*r*r
print(result)
Problem p03379 (python)

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

s = sorted(x)
u = s[int(n/2)]
t =s[int(n/2-1)]

for i in (x):
    if i < u:
        print(u)
    else:
        print(t)

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

for i,j in zip(x,range(n)):
    x.remove(i)
    t = sorted(x)
    print(t)
    print(t[int(n/2-1)])
    x.insert(j,i)
    print(x)
Problem p03408 (python)

Fixed submission:
n = int(input())
s = list()
counter = 0

for i in range(n):
    s.append(input())
    
m = int(input())
t = list()

for i in range(m):
    t.append(input())

for word in s:
    counter = max(counter,s.count(word) -t.count(word))
print(counter)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = [input() for i in range(N)]
M = int(input())
t = [input() for j in range(M)]

count = 0
for word in (s):
    counter = max(counter,s.count(word) - t.count(word))
print(counter)
Problem p03076 (python)

Fixed submission:
mod0 = []
lst = []
for i in range(5):
    inp = int(input())
    if inp % 10 == 0:
        mod0.append(inp)
    else:
        lst.append([inp, inp % 10])
ans = sum(mod0)
lst.sort(key= lambda x :x[1])

if len(lst) != 0:
    last = lst.pop(0)
    ans = sum(mod0)
    for i,imod in lst:
        ans += (i//10 +1)*10
    ans+=last[0]

print(ans)

Buggy submission (verdict: Runtime Error):
mod0 = []
lst = []
for i in range(5):
    inp = int(input())
    if inp % 10 == 0:
        mod0.append(inp)
    else:
        lst.append([inp, inp % 10])
ans = sum(mod0)
lst.sort(key= lambda x :x[1])
last = lst.pop(0)
ans = sum(mod0)
for i,imod in lst:
    ans += (i//10 +1)*10

ans+=last[0]
print(ans)

Buggy submission (verdict: Runtime Error):
 mod0 = []
lst = []
for i in range(5):
    inp = int(input())
    if inp % 10 == 0:
        mod0.append(inp)
    else:
        lst.append(inp)

ans = sum(mod0)
last = 0
for n, i in enumerate(lst):
    for nn, ii in enumerate(lst):
        if i % 10 < ii % 10:
            last = i
        else:
            last = ii

for i, ii in enumerate(lst):
    if ii == last:
        continue
    ans += (ii // 10 + 1) * 10

print(ans+last)
Problem p03079 (python)

Fixed submission:
a, b, c = (int(i) for i in input().split())

if a == b and a == c:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a, b, c = (int(i) for i in input().split())

if a = b and a = c :
    print('Yes')
else:
    print('No')
Problem p03085 (python)

Fixed submission:
dic = {"A":"T","C":"G","T":"A","G":"C"}
print(dic[input()])

Buggy submission (verdict: Runtime Error):
n,q = (int(i) for i in input().split())
s = input()

for i in range(q):
    l,r = (int(i) for i in input().split())
    cnt =  s.count('AC',l-1,r)
    print(cnt)
Problem p03106 (python)

Fixed submission:
a,b,th = (int(i) for i in input().split())
lst = []
c = max(a,b)
for i in range(c+1,0,-1):
    if a % i == 0 and b % i == 0:
        lst.append(i)
print(lst[th-1])

Buggy submission (verdict: Runtime Error):
a, b, k = (int(i) for i in input().split())
cdiv = []
ans = []
a,b = min(a,b),max(a,b)
for i in range(1, a + 1):
    if a % i == 0:
        cdiv.append(i)
for i in cdiv:
    if b % i != 0:
        ans.append(i)


print(ans[len(ans) - k])

Buggy submission (verdict: Runtime Error):
a,b,th = (int(i) for i in input().split())
lst = []
c = max(a,b)
for i in range(c+1,1,-1):
    if a % i == 0 and b % i == 0:
        lst.append(i)
print(lst[th-1])
Problem p03136 (python)

Fixed submission:
trash = input()
input_1 = list(map(int,input().split(' ')))
if max(input_1) < (sum(input_1) - max(input_1)):
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
trash = input()
input_1 = map(int,input().split(' '))
if max(input_1) < (sum(input_1) - max(input_1)):
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
trash = input()
input_1 = input().split(' ')
if max(input_1) < (sum(input_1) - max(input_1)):
	print('Yes')
else:
	print('No')
Problem p02969 (python)

Fixed submission:
r = int(input())

print(3*r*r)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
dp = {}

dp[(0, 0, 0)] = 1

def perm(i, j, k):
  if (i, j, k) in dp:
    return dp[(i, j, k)]
  
  if i < 0 or j < 0 or k < 0 or i < j:
    return 0
  
  dp[(i, j, k)] = ((j+j+1)*perm(i-1, j, k-2*j)\
                + (j+1)*(j+1)*perm(i-1, j+1, k-2*j)\
                +  1*perm(i-1, j-1, k-2*j))%int(10e9+7)
  return dp[(i, j, k)]

print(perm(n, 0, k))
Problem p02972 (python)

Fixed submission:
m = int(input())
s = list(map(int, input().split()))
bs = [0] * m

cnt = 0
for i in range(m, 0, -1):
  b = sum(list(map(lambda x: bs[x-1], list(range(i, m+1, i)))))
  if s[i-1] is 0:
    if  b%2 is 0:
      bs[i-1] = 0
    else:
      cnt += 1
      bs[i-1] = 1
  else:
    if  b%2 is 0:
      cnt += 1
      bs[i-1] = 1
    else:
      bs[i-1] = 0

print(cnt)
if cnt > 0:
  print(" ".join([str(i+1) for i, b in enumerate(bs) if b > 0]))

Buggy submission (verdict: Runtime Error):
m = int(input())
s = list(map(int, input()))
bs = [0] * m

cnt = 0
for i in range(m, 0, -1):
  b = sum(list(map(lambda x: bs[x-1], list(range(i, m+1, i)))))
  if s[i-1] is 0:
    if  b%2 is 0:
      bs[i-1] = 0
    else:
      cnt += 1
      bs[i-1] = 1
  else:
    if  b%2 is 0:
      cnt += 1
      bs[i-1] = 1
    else:
      bs[i-1] = 0

print(cnt)
print("".join(map(str, bs)))