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

Fixed submission:
from collections import deque

s = input()
q = int(input())
query = [input() for _ in range(q)]

s = deque(s)

inv = 0
for q in query :
    if q[0] == '1':
        inv += 1
    else:
        _,f,c = q.split()
        if f == '1':
            if inv % 2 == 0:
                s.appendleft(c)
            else:
                s.append(c)
        else:
            if inv % 2 ==0:
                s.append(c)
            else:
                s.appendleft(c)
s = ''.join(s)
print(s if inv % 2 == 0 else s[::-1])

Buggy submission (verdict: Runtime Error):
from collections import deque

s = input()
q = int(input())
query = [input() for _ in range(q)]

#s = deque(s)

inv = 0
for q in query :
    if q[0] == '1':
        inv += 1
    else:
        _,f,c = q.split()
        if f == '1':
            if inv % 2 == 0:
                s.appendleft(c)
            else:
                s.append(c)
        else:
            if inv % 2 ==0:
                s.append(c)
            else:
                s.appendleft(c)
s = ''.join(s)
print(s if inv % 2 == 0 else s[::-1])

Buggy submission (verdict: Runtime Error):
from collections import deque

s = input()
q = int(input())
query = [input() for _ in range(q)]

#s = deque(s)

inv = 0
for q in query :
    if q[0] == '1':
        inv += 1
    else:
        _,f,c = q.split()
        if f == '1':
            if inv % 2 == 0:
                s.append(c)
            else:
                s.appendleft(c)
s = ''.join(s)
print(s if inv % 2 == 0 else s[::-1])
Problem p02767 (python)

Fixed submission:
n = int(input())
x = list(map(int,input().split()))
s = [0] * (max(x) - min(x) + 1)
ans = 0
#
for p in range(min(x),max(x)+1):
    for j in range(n):
        s[p - x[0]] += (x[j] - p)**2
#
ans = min(s)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
s = [0] * (int(x[n-1] - x[0]) + 1)
ans = 0
#
for p in range(x[0],x[n-1]+1):
    for j in range(n):
        s[p - x[0]] += (x[j] - p)**2
#
ans = min(s)
print(ans)
Problem p02717 (python)

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

print(c,a,b)

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

aaa.sort(reverse=True)
result = [0]*b
for i in range(b):
    h = aaa[i]
    j = sum(aaa) / (4*b)

    if h >= j:
        result[i] = 1
    else:
        result[i] = 0

if result.count(1) >= b:
    ans = "Yes"
else:
    ans = "No"

print(ans)

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

result = [0]*a
for i in range(a):
    h = aaa[i]
    j = int(sum(aaa) / (4*b))

    if h > j:
        result[i] = 1
    else:
        result[i] = 0

if result.count(1) >= b:
    ans = "yes"
else:
    ans = "no"

print(ans)
Problem p03076 (python)

Fixed submission:
aaa = [int(input()) for i in range(5)]

i = list()
b = 0
for a in aaa:
  n = 0
  n = 10 - int(str(a)[-1])
  if n % 10 != 0:i.append(n)
    
if len(i) == 0:
  h = 0
else:
  h = max(i)
print(sum(aaa) + sum(i) - h)

Buggy submission (verdict: Runtime Error):
aaa = [int(input()) for i in range(5)]

i = list()
b = 0
for a in aaa:
  n = 0
  n = 10 - int(str(a)[-1])
  if n % 10 != 0:i.append(n)
print(sum(aaa) + sum(i) - max(i))

Buggy submission (verdict: Runtime Error):
aaa = [int(input()) for i in range(5)]

i = list()
b = 0
for a in aaa:
  n = 0
  n = 10 - int(str(a)[-1])
  if n % 10 != 0:i.append(n)
print(i)
print(sum(aaa) + sum(i) - max(i))
Problem p02677 (python)

Fixed submission:
import math

a,b,h,m = map(int,input().split())

rad_a = (h/12+ (1/12) * (m/60))*360
rad_b = (m/60)*360

if rad_a == rad_b:
    print(abs(b-a))
elif abs(rad_a - rad_b) == 180:
    print(b+a)
else:
    print(math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(abs(rad_a-rad_b)))))

Buggy submission (verdict: Runtime Error):
rad_a = (h/12+ (1/12) * (m/60))*360
rad_b = (m/60)*360

if rad_a == rad_b:
    print(abs(b-a))
elif abs(rad_a - rad_b) == 180:
    print(b+a)
else:
    print(math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(abs(rad_a-rad_b)))))
Problem p02717 (python)

Fixed submission:
import sys
import os
import bisect, collections, copy, itertools, math, string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int, input().split()))
def LS(): return list(input().split())

def solve():
	ABC = LI()

	def swap(i, j):
		tmp = ABC[i]
		ABC[i] = ABC[j]
		ABC[j] = tmp

	swap(0, 1)
	swap(0, 2)

	print(ABC[0], ABC[1], ABC[2])
	
if __name__ == '__main__':
	solve()

Buggy submission (verdict: Runtime Error):
import sys
import os
import bisect, collections, copy, itertools, math, string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int, input().split()))
def LS(): return list(input().split())



def solve():
	ABC = LI()
    
    def swap(i, j):
      tmp = ABC[i]
      ABC[i] = ABC[j]
      ABC[j] = tmp
      
    swap(0, 1)
    swap(0, 2)
    print(ABC[0], ABC[1], ABC[2])
    
    
	
if __name__ == '__main__':
	solve()
Problem p02706 (python)

Fixed submission:
n , m = list(map(int,input().split()))
A = list(map(int,input().split()))
S=sum(A)

if n-S >=0:
  print(n-S)
if n-S<0:
  print(-1)

Buggy submission (verdict: Runtime Error):
import math

r = int(input())
x = math.pi

print(2*r*x)
Problem p02765 (python)

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

if n>=10:
    print(r)
if n<10:
    print(r+100*(10-n))

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

while True:
    n =n//k
    A+=1
    if n//k==0:
        break
print(A)
Problem p02783 (python)

Fixed submission:
h, a = list(map(int,input().split()))
t = h//a
u = h%a
if h%a==0:
    print(t)
if h%a!=0:
    print(t+1)

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

t = h//a
print(t+1)
Problem p02789 (python)

Fixed submission:
n,m = list(map(int,input().split()))
if n ==m:
    print("Yes")
if n!=m:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
P = list(map(int,input().split()))
ans=0

for i in range(1,n-1):
  Q = (P[:i+1])
  if max(Q)!=P[i]:
        ans+=1
  if max(Q)==P[i]:
        ans+=0

print(ans+1)

Buggy submission (verdict: Runtime Error):
n = int(input())
P = list(map(int,input().split()))
ans=0

for i in range(1,n-1):
  Q = (P[:i+1])
  if max(Q)!=P[i]:
        ans+=1
  if max(Q)==P[i]:
        ans+=0

print(ans+1)
Problem p02713 (python)

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


K = int(input())

sum_gcd = 0
for i in range(1, K + 1):
    for j in range(1, K + 1):
        g = gcd(i, j)
        for k in range(1, K + 1):
            sum_gcd += gcd(g, k)
print(sum_gcd)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


K = int(input())

sum_gcd = 0
cand = itertools.combinations(K, 3))
for i in range(1, K + 1):
    for j in range(1, K + 1):
        g=gcd(i, j)
        for k in range(1, K + 1):
            sum_gcd += gcd(g, k)
print(sum_gcd)
Problem p02714 (python)

Fixed submission:
N = int(input())
S = input()
count = S.count("R") * S.count("G") * S.count("B")


for j in range(N):
    for i in range(j):
        k = 2 * j - i
        if k >= N:
            continue
        if (S[i] != S[j]) and (S[i] != S[k]) and (S[j] != S[k]):
            count -= 1
print(count)

Buggy submission (verdict: Runtime Error):
import itertools
N = int(input())
S = input()
C = np.array(list(itertools.combinations_with_replacement(range(1, N + 1), 3)))
count = 0
for i, j, k in C:
    if (i != 2 * j - k) and (S[i - 1] != S[j - 1] and S[i - 1] != S[k - 1] and S[j - 1] != S[k - 1]):
        count += 1
print(count)
Problem p02720 (python)

Fixed submission:
import numpy as np
K = int(input())
lunlun_number = [[1, 2, 3, 4, 5, 6, 7, 8, 9]]
for _ in range(9):
    tmp = []
    for n in lunlun_number[-1]:
        if n % 10 != 0:  # 末尾が0の場合は-1した数がルンルン数にならないのでそれ以外を採用
            tmp.append(n * 10 + (n % 10 - 1))
        tmp.append(n * 10 + (n % 10))
        if n % 10 != 9:  # 末尾が9のときは+1した数がルンルン数にならないのでそれ以外を採用
            tmp.append(n * 10 + (n % 10 + 1))
    lunlun_number.append(tmp)
lunlun_number = [flatten for inner in lunlun_number for flatten in inner]
print(lunlun_number[K - 1])

Buggy submission (verdict: Runtime Error):
import numpy as np
K = input()
lunlun_number = [[1, 2, 3, 4, 5, 6, 7, 8, 9]]
for _ in range(9):
    tmp = []
    for n in lunlun_number[-1]:
        if n % 10 != 0:  # 末尾が0の場合は-1した数がルンルン数にならないのでそれ以外を採用
            tmp.append(n * 10 + (n % 10 - 1))
        tmp.append(n * 10 + (n % 10))
        if n % 10 != 9:  # 末尾が9のときは+1した数がルンルン数にならないのでそれ以外を採用
            tmp.append(n * 10 + (n % 10 + 1))
    lunlun_number.append(tmp)
lunlun_number = np.array(lunlun_number).flatten()
print(lunlun_number[K - 1])
Problem p02721 (python)

Fixed submission:
n, k, c = map(int, input().split())
s = input()
l = [-1] * k
r = [-1] * k
nowl = 0
indl = 0
while nowl < n and indl < k:
    for i in range(nowl, n):
        if s[i] == "o":
            l[indl] = i
            nowl = i + c + 1
            indl += 1
            break
nowr = n - 1
indr = k - 1
while nowr >= 0 and indr >= 0:
    for i in range(nowr, -1, -1):
        if s[i] == "o":
            r[indr] = i
            nowr = i - c - 1
            indr -= 1
            break
for i in range(k):
    if l[i] == r[i]:
        print(l[i] + 1)

Buggy submission (verdict: Runtime Error):
N, K, C = map(int, input().split())
S = input()
L = []
R = []
L_index = 0
L_count = 0
R_index = N - 1
R_count = K - 1

while L_index < N and L_count < K:
    if S[L_index] == "o":
        L.append(L_index)
        L_index += (C + 1)
        L_count += 1
    else:
        L_index += 1
while R_index >= 0 and R_count >= 0:
    if S[R_index] == "o":
        R.append(R_index)
        R_index -= (C - 1)
        R_count -= 1
    else:
        R_index -= 1

work_day = set(L) & set(R)
for w_day in work_day:
    print(w_day + 1)
Problem p02995 (python)

Fixed submission:
from fractions import gcd
A, B, C, D = map(int, input().split())
A-=1
lcm=C*D//gcd(C,D)
#B以下の個数
b = B-(B//C)-(B//D)+B//lcm
#A以下の個数
a = A-(A//C)-(A//D)+A//lcm
print(b-a)

Buggy submission (verdict: Runtime Error):
from math import gcd
A, B, C, D = map(int, input().split())
A-=1
lcm=C*D//gcd(C,D)
#B以下の個数
b = B-(B//C)-(B//D)+B//lcm
#A以下の個数
a = A-(A//C)-(A//D)+A//lcm
print(b-a)

Buggy submission (verdict: Runtime Error):
from math import gcd
A, B, C, D = map(int, input().split())
A-=1
lcm=C*D//gcd(C,D)
#B以下の個数
b = B-(B//C)-(B//D)-B//lcm
#A以下の個数
a = A-(A//C)-(A//D)-A//lcm
print(b-a)
Problem p02684 (python)

Fixed submission:
N, K = map(int, input().split())
A_list = list(map(int, input().split()))
dic_A = {0:1}
direction = 0
flag = True
for i in range(K):
    direction = A_list[direction]-1
    if direction in dic_A:
        dic_A[direction] += 1
        if dic_A[direction] >= 3:
            flag = False
            break
    else:
        dic_A[direction] = 1
if flag:
    print(direction+1)
    exit()
cnt = 0
dic_ans = {}
for k, v in dic_A.items():
    if v >= 2:
        cnt += 1
        dic_ans[k] = 1
ans = K - (len(dic_A) - cnt)
ans %= cnt
for k, v in dic_ans.items():
    if ans == 0:
        true = k
        break
    ans -= 1
print(true+1)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A_list = list(map(int, input().split()))
dic_A = {0:1}
direction = 0
for i in range(K):
    direction = A_list[direction]-1
    if direction in dic_A:
        dic_A[direction] += 1
        if dic_A[direction] >= 3:
            break
    else:
        dic_A[direction] = 1
cnt = 0
dic_ans = {}
for k, v in dic_A.items():
    if v >= 2:
        cnt += 1
        dic_ans[k] = 1
ans = K - (len(dic_A) - cnt)
ans %= cnt
for k, v in dic_ans.items():
    if ans == 0:
        true = k
        break
    ans -= 1
print(true+1)
Problem p02742 (python)

Fixed submission:
H, W = map(int, input().split())
if H==1 or W==1:
    print(1)
else:
    print((H*W)//2) if (H*W)%2==0 else print((H*W)//2+1)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
if H==1 or W==1
    print(1)
else:
    print((H*W)//2) if (H*W)%2==0 else print((H*W)//2+1)
Problem p02756 (python)

Fixed submission:
from collections import deque
S = deque(input())
Q = int(input())
flag = True
for i in range(Q):
    A = list(map(str, input().split()))
    if len(A)==1:
        flag = not flag
    else:
        if flag:
            if A[1]=="1":
                S.appendleft(A[2])
            else:
                S.append(A[2])
        else:
            if A[1]=="1":
                S.append(A[2])
            else:
                S.appendleft(A[2])
S = "".join(S)
if flag:
    print(S)
else:
    print(S[::-1])

Buggy submission (verdict: Runtime Error):
S = list(input())
Q = int(input())
l_list = []
r_list = []
flag = True
for i in range(Q):
    A = list(map(str, input().split()))
    if len(A)==1:
        flag = not flag
    else:
        if flag:
            if A[1]=="1":
                l_list.appendleft(A[2])
            else:
                r_list.append(A[2])
        else:
            if A[1]=="1":
                r_list.append(A[2])
            else:
                l_list.appendleft(A[2])
if flag:
    print("".join(l_list)+"".join(S)+"".join(r_list))
else:
    print("".join(r_list[::-1])+"".join(S[::-1])+"".join(l_list[::-1]))

Buggy submission (verdict: Runtime Error):
S = list(input())
Q = int(input())
l_list = []
r_list = []
flag = True
for i in range(Q):
    A = list(map(str, input().split()))
    if len(A)==1:
        flag = not flag
    else:
        if flag1:
            if A[1]=="1":
                l_list.appendleft(A[2])
            else:
                r_list.append(A[2])
        else:
            if A[1]=="1":
                r_list.append(A[2])
            else:
                l_list.appendleft(A[2])
if flag:
    print("".join(l_list)+"".join(S)+"".join(r_list))
else:
    print("".join(r_list[::-1])+"".join(S[::-1])+"".join(l_list[::-1]))

Buggy submission (verdict: Runtime Error):
S = list(input())
Q = int(input())
l_list = []
r_list = []
for i in range(Q):
    A = list(map(str, input().split()))
    if len(A)==1:
        flag = not flag
    else:
        if flag:
            if A[1]=="1":
                l_list.insert(0, A[2])
            else:
                r_list.append(A[2])
        else:
            if A[1]=="1":
                r_list.insert(0, A[2])
            else:
                l_list.append(A[2])
if flag:
    print("".join(l_list)+"".join(S)+"".join(r_list))
else:
    print("".join(r_list[::-1])+"".join(S[::-1])+"".join(l_list[::-1]))

Buggy submission (verdict: Runtime Error):
S = list(input())
Q = int(input())
l_list = []
r_list = []
for i in range(Q):
    A = list(map(str, input().split()))
    if len(A)==1:
        flag = not flag
    else:
        if flag:
            if A[1]=="1":
                l_list.insert(0, A[2])
            else:
                r_list.append(A[2])
        else:
            if A[1]=="1":
                r_list.insert(0, A[2])
            else:
                l_list.append(A[2])
if flag:
    print("".join(l_list)+"".join(S)+"".join(r_list))
else:
    print("".join(r_list[::-1])+"".join(S[::-1])+"".join(l_list[::-1]))
Problem p02761 (python)

Fixed submission:
N, M = map(int, input().split())
sc_list = []
for i in range(M):
    sc = list(map(int, input().split()))
    sc_list.append(sc)
ans = -1
for i in range(10**N):
    tmp = str(i)
    if len(tmp)==N:
        flag = True
        for j in sc_list:
            if int(tmp[j[0]-1])!=j[1]:
                flag = False
        if flag:
            ans = int(tmp)
            break
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A_list = []
dic_A = {}
flag = True
for i in range(M):
    A = list(map(int, input().split()))
    if A[0] in dic_A:
        if dic_A[A[0]]!=A[1]:
            flag = False
    else:
        dic_A[A[0]] = A[1]
    A_list.append(A)
for i in range(M):
    if A_list[i][0]==1 and A_list[i][1]==0:
        flag = False
if flag == False:
    print(-1)
else:
    ans = ["0" for i in range(3)]
    for i, v in sorted(dic_A.items()):
        v = str(v)
        ans[i-1] = v
    if "".join(ans)[0] != "0":
        N, M = map(int, input().split())
A_list = []
dic_A = {}
flag = True
for i in range(M):
    A = list(map(int, input().split()))
    if A[0] in dic_A:
        if dic_A[A[0]]!=A[1]:
            flag = False
    else:
        dic_A[A[0]] = A[1]
    A_list.append(A)
for i in range(M):
    if A_list[i][0]==1 and A_list[i][1]==0:
        flag = False
if flag == False:
    print(-1)
else:
    ans = ["0" for i in range(3)]
    for i, v in sorted(dic_A.items()):
        v = str(v)
        ans[i-1] = v
    if "".join(ans)[0] != "0":
        print(int("".join(ans)))
    else:
        print(-1)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A_list = []
dic_A = {}
flag = True
for i in range(M):
    A = list(map(int, input().split()))
    if A[0] in dic_A:
        if dic_A[A[0]]!=A[1]:
            flag = False
    else:
        dic_A[A[0]] = A[1]
    A_list.append(A)
for i in range(M):
    if A_list[i][0]==1 and A_list[i][1]==0:
        flag = False
if flag == False:
    print(-1)
else:
    ans = []
    cnt = 1
    for i, v in sorted(dic_A.items()):
        if cnt==N+1:
            break
        if cnt!=i:
            while(cnt!=i):
                ans.append(str(0))
                cnt+=1
        v = str(v)
        ans.append(v)
        cnt+=1
    if "".join(ans)[0] != "0":
        print(int("".join(ans)))
    else:
        print(-1)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A_list = []
dic_A = {}
flag = True
for i in range(M):
    A = list(map(int, input().split()))
    if A[0] in dic_A:
        if dic_A[A[0]]!=A[1]:
            flag = False
    else:
        dic_A[A[0]] = A[1]
    A_list.append(A)
for i in range(M):
    if A_list[i][0]==1 and A_list[i][1]==0:
        flag = False
if flag == False:
    print(-1)
else:
    ans = []
    cnt = 1
    for i, v in sorted(dic_A.items()):
        if cnt==N+1:
            break
        if cnt!=i:
            while(cnt!=i):
                ans.append(str(0))
                cnt+=1
        v = str(v)
        ans.append(v)
        cnt+=1
    print(int("".join(ans)))
Problem p02784 (python)

Fixed submission:
H, N = map(int, input().split())
A_list = list(map(int, input().split()))
for i in range(N):
    H -= A_list[i]
if H > 0:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
H, N = map(int, input().split())
A_list = list(map(int, input().split()))
A_list = quicksort(A_list)
#A_list.reverse()
for i in range(N):
    H -= A_list[i]
if H > 0:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
H, N = map(int, input().split())
A_list = list(map(int, input().split()))
A_list = quicksort(A_list)
#A_list.reverse()
for i in range(N):
    H -= A_list[i]
if H > 0:
    print("No")
else:
    print("Yes")
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 = int(input())
print("Yes") if N==M else print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
M = int(input())
if N==M:
    print("Yes")
else:
    print("No")
Problem p02817 (python)

Fixed submission:
S, T = map(str, input().split())
T += S
print(T)

Buggy submission (verdict: Runtime Error):
from math import sqrt
X = int(input())
def is_prime_next(X):
    X_sqrt = int((sqrt(X)-5)/6) 
    if X==2 or X==3:
        return X
    if X%2 == 0:
        return None
    if X%3 == 0:
        return None
    for i in range(1, X_sqrt):
        if X % (6*i+1) == 0 or X % (6*i+5) == 0:
            return None
    return X
while(1):
    X_keep = is_prime_next(X)
    if X_keep != None:
        break
    X += 1
print(X)
Problem p02843 (python)

Fixed submission:
X = list(input())
if len(X)<=2:
    print(0)
    exit()
con = X[len(X)-2:len(X)]
kak = X[0:len(X)-2]
kak = int("".join(kak))
con = int("".join(con))
if con>=5:
    imp1 = con//5
    imp2 = con%5
else:
    imp1 = 1
    imp2 = 0
#print(kak, imp1, imp2)
if kak>=imp1+imp2:
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
X = list(input())
con = X[len(X)-2:len(X)]
kak = X[0:len(X)-2]
kak = int("".join(kak))
con = int("".join(con))
if con>=5:
    imp1 = con//5
    imp2 = con%5
else:
    imp1 = 1
    imp2 = 0
#print(kak, imp1, imp2)
if kak>=imp1+imp2:
    print(1)
else:
    print(0)
Problem p02971 (python)

Fixed submission:
N = int(input())
A_list = []
for i in range(N):
    A = int(input())
    A_list.append(A)
sort_A = sorted(A_list, reverse = True)
max_f = sort_A[0]
max_s = sort_A[1]
for i in range(N):
    print(max_s) if A_list[i] == max_f else print(max_f)

Buggy submission (verdict: Runtime Error):
N = int(input())
A_list = []
for i in range(N):
    A = int(input())
    A_list.append(A)
sort_A = sorted(A_list, reverse = True)
k = 0
while (1):
    if sort_A[k] != sort_A[k+1]:
        A_second = sort_A[k+1]
        break
    k += 1
for i in range(N):
    if A_list[i] == sort_A[0]:
        print(A_second)
    else:
        print(sort_A[0])
Problem p03076 (python)

Fixed submission:
from itertools import permutations
A_list = []
for i in range(5):
    A = int(input())
    A_list.append(A)
nes = [0,1,2,3,4]
iterator = []
for i in permutations(nes):
    iterator.append(i)
min1 = 10**9
for i in iterator:
    temp = 0
    for j in i:
        if temp%10 != 0:
            temp += (10-temp%10)
        temp += A_list[j]
    if temp < min1:
        min1 = temp
print(min1)

Buggy submission (verdict: Runtime Error):
from itertools import permutations
A_list = []
for i in range(5):
    A = int(input())
    A_list.append(A)
nes = [0,1,2,3,4]
iterator = []
print(A_list)
for i in permutations(nes):
    iterator.append(i)
for i in iterator:
    temp = 0
    for j in i:
        if temp%10 != 0:
            temp += (10-temp%10)
        temp += A_list[j]
    if temp < min1:
        min1 = temp
print(temp)

Buggy submission (verdict: Runtime Error):
from itertools import permutations
A_list = []
for i in range(5):
    A_list.append(int(input()))
nes = [0,1,2,3,4]
iterator = []
print(A_list)
for i in permutations(nes):
    iterator.append(i)
for i in iterator:
    temp = 0
    for j in i:
        if temp%10 != 0:
            temp += (10-temp%10)
        temp += A_list[j]
    if temp < min1:
        min1 = temp
print(temp)
Problem p03260 (python)

Fixed submission:
A, B = map(int, input().split())
flag = False
for C in range(1,4):
  if (A*B*C)%2 == 1:
    flag = True
    break
print("Yes") if flag else print("No")

Buggy submission (verdict: Runtime Error):
A, B = int(input())
flag = False
for C in range(1,4):
  if (A*B*C)%2 == 1:
    flag = True
    break
print("Yes") if flag else print("No")
Problem p03282 (python)

Fixed submission:
S = input()
K = int(input())
ans = 0
for i in range(K):
    if S[i]!="1":
        ans = S[i]
        break
print(1) if ans==0 else print(ans)

Buggy submission (verdict: Runtime Error):
S = int(input())
K = int(input())
if S[0]!="1":
  print(S[0])
else:
  print(S[1])
Problem p03624 (python)

Fixed submission:
S = input()
eng_list = [i for i in range(97, 123)]
for i in range(len(S)):
    for j in range(len(eng_list)):
        if ord(S[i]) == eng_list[j]:
            eng_list.pop(j)
            break
print(chr(eng_list[0])) if len(eng_list) != 0 else print("None")

Buggy submission (verdict: Runtime Error):
S = input()
eng_list = [i for i in range(97, 123)]
for i in range(len(S)):
    for j in range(len(eng_list)):
        if ord(S[i]) == eng_list[j]:
            k = j
    eng_list.pop(k)
print(chr(eng_list[0])) if len(eng_list) != 0 else print("None")
Problem p03738 (python)

Fixed submission:
A = int(input())
B = int(input())
if A > B:
    print("GREATER")
elif A==B:
    print("EQUAL")
else:
    print("LESS")

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
if A > B:
    print("GREATER")
elif A==B:
    print("EQUAL")
else:
    print("LESS")