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

Fixed submission:
n = input()
m = n.split()
a = [input() for l in range(0,1)]
b = a[0].split()
for i in range(0, len(b)):
    b[i] = int(b[i])
c = sorted(b, reverse=True)
p = 0
for i in range(int(m[0]) - int(m[1]),int(m[0])):
    p = p + int(c[i])
print(p)

Buggy submission (verdict: Runtime Error):
n = input()
m = n.split()
for i in range(0, len(m)):
    m[i] = int(m[i])
a = m[0]
b = m[1]
m = m[2:]
p = 0
for i in range(a-b,a):
    p = p + int(m[i])
print(int(p))

Buggy submission (verdict: Runtime Error):
n = input()
m = n.split()
for i in range(0, len(m)):
    m[i] = int(m[i])
a = m[0]
b = m[1]
m = m[2:]

p = 0
for i in range(a-b,a):
    p = p + int(c[i])
print(int(p))

Buggy submission (verdict: Runtime Error):
n = input()
m = n.split()
a 

for i in range(0, len(m)):
    m[i] = int(m[i])
a = m[0]
b = m[1]
m = m[2:]
print(m,a,b)

p = 0
for i in range(a-b,a):
    p = p + int(c[i])
print(int(p))

Buggy submission (verdict: Runtime Error):
n = input()
m = n.split()
print(m)
a = [input() for l in range(0,1)]
b = a[0].split()
print(b)

for i in range(0, len(b)):
    b[i] = int(b[i])

c = sorted(b, reverse=True)
print(c)
p = 0
for i in range(int(m[0]) - int(m[1])+1,int(m[0])+1):
    p = p + int(c[i])
print(int(p))

Buggy submission (verdict: Runtime Error):
n = input()
m = n.split()
l = m[2:]
s = sorted(l, reverse=True)
p = 0
for i in range(0,int(m[1])):
    p = p + int(l[i])
print(int(p))

Buggy submission (verdict: Runtime Error):
n = input()
m = n.split()
l = m[2:]
a = sorted(l, reverse=True)
p = 0
for i in range(0,int(m[1])):
    p = p + int(c[i])
print(int(p))

Buggy submission (verdict: Runtime Error):
n = input()
m = n.split()
print(m)
l = m[2:]
a = sorted(l, reverse=True)
p = 0
for i in range(0,int(m[1])):
    p = p + int(c[i])
print(int(p))
Problem p02607 (python)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
count=0
for i in range(0,N,2):
    if a[i]%2==1:
        count+=1

print(count)

Buggy submission (verdict: Runtime Error):
N=int(input())
a=list(map(int,input().split()))
count=0
for i in range(0,N+1,2):
    if a[i]%2==1:
        count+=1

print(count)
Problem p02741 (python)

Fixed submission:
N=int(input())
list=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(list[N-1])

Buggy submission (verdict: Runtime Error):
N=int(input())
list=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(list[N+1])
Problem p02641 (python)

Fixed submission:
import sys
x, n = map(int, input().split())
if n == 0:
    print(x)
    sys.exit()

if x == 1:
    print(0)
    sys.exit()


if n == 100:
    if x <= 50:
        print(0)
        sys.exit()
    else:
        print(101)
        sys.exit()


nun_list = list(map(int, input().split()))
answer = 0

for i in range(0, 210):
    if nun_list.__contains__(i):
        continue
    else :
        if abs(x - answer) >= abs(x - i):
            if abs(x - answer) == abs(x - i):
                if answer > i:
                    answer = i
            else:
                answer = i
if abs(x - answer) <= abs(x - 0):
    print(answer)
else :
    print(0)

Buggy submission (verdict: Runtime Error):
import sys
x, n = map(int, input().split())
if n == 0:
    print(x)
    sys.exit()

if x == 1:
    print(0):
    sys.exit()


if n == 100:
    if x <= 50:
        print(0)
        sys.exit()
    else:
        print(101)
        sys.exit()


nun_list = list(map(int, input().split()))
answer = 0

for i in range(0, 210):
    if nun_list.__contains__(i):
        continue
    else :
        if abs(x - answer) >= abs(x - i):
            if abs(x - answer) == abs(x - i):
                if answer > i:
                    answer = i
            else:
                answer = i
if abs(x - answer) <= abs(x - 0):
    print(answer)
else :
    print(0)
Problem p02642 (python)

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
cnt = Counter(A)
A.sort()
ans = 0
P = [0] * (10 ** 6 + 1)
for a in A:
    if P[a] == 0:
        for i in range(10 ** 7):
            x = a * i
            if x > 10 ** 6:
                break
            P[x] = 1
        if cnt[a] == 1:
            ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
nun_list = list(map(int, input().split()))
count=0
hoge = len(nun_list) - 1
for i in range(1,n+1):
    if is_prime(nun_list[i-1]):
        count+=1
        continue
    tmp = 0
    for j in range(1,n+1):
        if i != j:
            if nun_list[i-1] % nun_list[j-1]  == 0:
                break
            else :
                tmp+=1
    if tmp == hoge:
        count+=1
print(count)

def is_prime(n):
    for i in range(2, n + 1):
        if i * i > n:
            break
        if n % i == 0:
            return False
    return n != 1
Problem p02584 (python)

Fixed submission:
def main():
    X, K, D = map(int, input().split())
    if abs(X) == D:
        if K % 2 == 0:
            print(abs(X))
        else:
            print(0)
        return

    diff = K * D - abs(X)
    if abs(diff) <= D:
        print(abs(diff))
        return
    elif diff < 0:
        print(abs(diff))
        return
    count_minus = abs(diff // (2 * D))
    if X > 0:
        dest = X - (K - count_minus) * D + count_minus * D
        dest2 = X - (K - count_minus - 1) * D + (count_minus + 1) * D
    else:
        dest = X + (K - count_minus) * D - count_minus * D
        dest2 = X + (K - count_minus - 1) * D - (count_minus + 1) * D

    print(abs(dest) if abs(dest) < abs(dest2) else abs(dest2))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    X, K, D = map(int, input().split())
    if abs(X) == D:
        if K % 2 == 0:
            print(abs(X))
        else:
            print(0)
        return
    for i in range(K):
        plus = abs(X + D)
        minus = abs(X - D)
        if plus < minus:
            X += D
        else:
            X -= D
        print(X)
    print(abs(X)) 
            
if __name__ == '__main__':
    main()
Problem p02706 (python)

Fixed submission:
n,m = (int(x) for x in input().split())
a = [int(i) for i in input().split()]
if sum(a)>n:
    print(-1)
else:
    print(n-sum(a))

Buggy submission (verdict: Runtime Error):
n,m = input().split()
a = [i for i in input.split()]
if sum(a)>n:
    print(-1)
else:
    print(m-sum(a))
Problem p02708 (python)

Fixed submission:
n,k = (int(x) for x in input().split())
M = 10**9+7
s = 0

for i in range(n+2-k):
    ad = 1 + (n+1-k-i)*(k+i)
    s += ad
#if s >= M:
#    s -= M
        
print(s%M)

Buggy submission (verdict: Runtime Error):
n,k = (int(x) for x in input().split())
M = 10**9+7
s = 0

for i in range(n+2-k):
    ad = 1 + (n+1-k-i)*(k+i)
    s += ad
    if s >= M:
        s -= N
        
print(s)

Buggy submission (verdict: Runtime Error):
n,k = (int(x) for x in input().split())
M = 10**9+7
s = 0

for i in range(n-k):
    ad = 1 + i*(n-i+1)
    s += ad
    if s >= M:
        s -= N
        
print(s)
Problem p02994 (python)

Fixed submission:
N,L=map(int ,input().split())
if L >= 0:
    print(int((2*L+N)*(N-1)/2) )
elif L < 0 and L+N-1>=0:
    print(int((2*L+N-1)*(N)/2) )
else:
    print(int((2*L+N-2)*(N-1)/2) )

Buggy submission (verdict: Runtime Error):
N,L=map(int ,input().split())
print((2*L+N)*(N-1)/2 )
Problem p02995 (python)

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

def lcm(x, y):
    return (x * y) // gcd(x, y)

A,B,C,D=map(int ,input().split())
a = B//C-(A-1)//C
b = B//D-(A-1)//D
c  =lcm(C,D)
d = B//c-(A-1)//c
e = B - A +1 - a -b + d 
print(e)

Buggy submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

A,B,C,D=map(int ,input().split())
a = B//C-(A-1)//C
b = B//D-(A-1)//D
c  =lcm(C,D)
d = B//c-(A-1)//c
e = B - A +1 - a -b + d 
print(e)

Buggy submission (verdict: Runtime Error):
import math
A,B,C,D=map(int ,input().split())
a = B//C-A//C
b = B//D-A//D
c  = math.gcd(C,D)
d = B//c-A//c
e = B - A - a -b + d 
print(e)
Problem p02996 (python)

Fixed submission:
import numpy as np
N =int(input())
A =[]
B =[]
for i in range(N):
    a,b = map(int,input().split())
    A.append(a)
    B.append(b)
index = np.argsort(B)
time = 0
f = 0
for i in index:
    time += A[i]
    if time>B[i]:
        f = 1
        break
if f == 1:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
import numpy as np
N =int(input())
A =[]
B =[]
for i in range(N):
    a,b = map(int,input().split())
    A.append(a)
    B.append(b)
index = np.argsort(B)
time = 0
f = 0
for i in index:
    time += A[index]
    if time>B[index]:
        f = 1
        break
if f == 1:
    print('No')
else:
    print('Yes')
Problem p03000 (python)

Fixed submission:
N,X=map(int ,raw_input().split())
L =list(map(int ,raw_input().split()))
p = 0
y = -1
for i in range(N):
    p += L[i]
    if p>X:
        y = i
        break
if y>=0:
    print y+1
else:
    print N+1

Buggy submission (verdict: Runtime Error):
N X=map(int ,raw_input().split())
L =list(map(int ,raw_input().split()))
p = 0
y = -1
for i in range(N):
    p += L[i]
    if p>X:
        y = i
        break
if y>=0:
    print y
else:
    print X
Problem p03001 (python)

Fixed submission:
W,H,x,y =map(int ,raw_input().split())
i = 0
if x*2 == W and y*2 ==H:
    i = 1
print float(W*H)/2,i

Buggy submission (verdict: Runtime Error):
W,H,x,y =map(int ,raw_input().split())
i = 0
if x*2 == W and y +2 ==H:
    i = 1
print float(W*H)/2,i

Buggy submission (verdict: Runtime Error):
W,H,x,y ==map(int ,raw_input().split())
i = 0
if x*2 == W and y +2 ==H:
    i = 1
print float(W*H)/2,i

Buggy submission (verdict: Runtime Error):
W,H,x,y ==map(int ,raw_input().split())
i = 0
if x*2 = W and y +2 =H:
    i = 1
print float(W*H)/2,i
Problem p03023 (python)

Fixed submission:
S =int(raw_input())
print (S-2)*180

Buggy submission (verdict: Runtime Error):
S =raw_input()
print (S-2)*180
Problem p03030 (python)

Fixed submission:
N =int(raw_input())
S =[]
P =[]
for i in range(N):
    s,p=map(str,raw_input().split())
    S.append(s)
    P.append(int(p))
ss=sorted(list(set(S)))
for sss in ss:
    a =[]
    b =[]
    for j in range(N):
        if sss==S[j]:
            a.append(j)
            b.append(P[j])
    if len(b)>0:
        c = sorted(b,reverse=True)
        #print c,b
        for k in c:
            for j in range(len(b)):
                if k == b[j]:
                    print(a[j]+1)

Buggy submission (verdict: Runtime Error):
N =int(raw_input())
S =[]
P =[]
for i in range(N):
    s,p=map(str,raw_input().split())
    S.append(s)
    P.append(p)
ss=sorted(list(set(S)))
for i in range(len(ss)):
    a =[]
    b =[]
    for j in range(N):
        if ss[i]==S[j]:
            a.append(j)
            b.append(P[i])
    c = list(sorted(b)).reverse()
    if len(c)>0:
        for k in c:
            for j in range(len(b)):
                if k == b[j]:
                    print(a[j])

Buggy submission (verdict: Runtime Error):
N =int(raw_input())
S =[]
P =[]
for i in range(N):
    s,p=map(str,raw_input().split())
    S.append(s)
    P.append(p)
ss=sorted(list(set(S)))
for i in range(len(ss)):
    a =[]
    b =[]
    for j in range(N):
        if ss[i]==S[j]:
            a.append(j)
            b.append(P[i])
    c = sorted(b).reverse()
    for k in c:
        for j in range(len(b)):
            if k == b[j]:
                print(a[j])

Buggy submission (verdict: Runtime Error):
N =int(raw_input())
S =[]
P =[]
for i in range(N):
    s,p=map(str,raw_input().split())
    S.append(s)
    P.append(p)
ss=sorted(list(set(S)))
for i in range(len(ss)):
    a =[]
    b =[]
    for j in range(100):
        if ss[i]==S[j]:
            a.append(j)
            b.append(P[i])
    c = sorted(b).reverse()
    for k in c:
        for j in range(len(b)):
            if k == b[j]:
                print(a[j])
Problem p03059 (python)

Fixed submission:
import numpy as np
nums = map(int ,raw_input().split())
print str(int(np.trunc((nums[2]+0.5)/nums[0])*nums[1]))

Buggy submission (verdict: Runtime Error):
import numpy as np
A =int(raw_input())
B =int(raw_input())
T =int(raw_input())
print str(int(np.trunc((T+0.5)/A)*B))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import numpy as np
A =int(raw_input())
B =int(raw_input())
T =int(raw_input())
print str(int(np.trunc((T+0.5)/A)*B))

Buggy submission (verdict: Runtime Error):
import numpy as np
A =int(raw_input())
B =int(raw_input())
T =int(raw_input())
print str(int(np.trunc((T+0.5)/A)*B))

Buggy submission (verdict: Runtime Error):
import numpy as np
A =int(raw_input())
B =int(raw_input())
T =int(raw_input())
print int(np.trunc((T+0.5)/A)*B)
Problem p03060 (python)

Fixed submission:
N =int(raw_input())
V =map(int ,raw_input().split())
C =map(int ,raw_input().split())
v = 0
for i in range(N):
    if V[i]-C[i]>0:
        v = v+V[i]-C[i]
print v

Buggy submission (verdict: Runtime Error):
N =int(raw_input())
V =map(int ,raw_input().split())
C =map(int ,raw_input().split())
V = V-C
v = 0
for i in range(N):
    if V[i]>0:
        v = v+V[i]
print v
Problem p02582 (python)

Fixed submission:
s=input()
count=0
i=0
while i<len(s):
    summ=0
    while i<len(s) and s[i]=='R':
        summ+=1
        i+=1
    if summ>count:
        count=summ
    i+=1


print(count)

Buggy submission (verdict: Runtime Error):
s=input()
count=0
i=0
while i<len(s):
    summ=0
    while s[i]=='R':
        summ+=1
        i+=1
    if summ>count:
        count=summ
    i+=1


print(count)
Problem p02582 (python)

Fixed submission:
s = input()
prev = "R"
res = 0
a = 0
for c in s :
    if c=="R" :
        a+=1
    else :
        a = 0
    res = max(res, a)
print(res)

Buggy submission (verdict: Runtime Error):
R, C, K = map(int, input().split(" "))
board = [ [0]*(C+1) for _ in range(R+1) ]
for _ in range(K) :
    i, j, v = map(int, input().split(" "))
    board[i][j] = v

score = [ [ [0]*4 for _ in range(C+1) ] for _ in range(R+1) ] 

for i in range(1, R+1) :
    for j in range(1, C+1) : 
        if board[i][j] == 0 :
            for k in range(4) :
                score[i][j][k] = score[i][j-1][k]    
        else :
            for k in range(3):
                score[i][j][k+1] = score[i][j-1][k] + board[i][j]
        
        descent = max(score[i-1][j])
        score[i][j][1] = max(descent + board[i][j], score[i][j-1][1], score[i][j-1][0]+board[i][j])
        score[i][j][0] = max(descent, score[i][j-1][0])



print(max(score[-1][-1]))
Problem p02687 (python)

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

Buggy submission (verdict: Runtime Error):
N, A, B, C = map(int, input().split(" "))
commands = []
data = {
    'A': A,
    'B': B,
    'C': C
}
ans = [] 

if A >=1 and B >= 1 and C >= 1 :
    print("Yes")
    for _ in range(N) :
        command = input()
        if data[command[0]] > data[command[1]] :
            data[command[0]] -= 1
            data[command[1]] += 1
            print(command[1])
        else :
            data[command[0]] += 1
            data[command[1]] -= 1
            print(command[0]) 
else :
    safe = []
    commands = []
    for _ in range(N) :
        commands.append(input())

    fail = False
    i = 0 
    ans = []
    
    while i < N : 
        if data[commands[i][0]] == 0 and data[commands[i][1]] == 0 :
            if safe == [] :
                fail = True
                break
            else : 
                data, i, _ans = safe.pop()
                ans = ans[:i+1]
                ans.append(_ans)
                
        elif data[commands[i][0]] == 1 and data[commands[i][1]] == 1 :
            _data = { 'A' :data['A'], 'B' :data['B'], 'C' :data['C'] }
            _i = i
            
            _data[commands[i][1]] += 1
            _data[commands[i][0]] -= 1
            _ans = commands[i][1] 
            safe.append( [_data, _i, _ans] )  

            data[commands[i][0]] += 1
            data[commands[i][1]] -= 1
            ans.append( commands[i][0] )
        else :
            if data[commands[i][0]] > data[commands[i][1]] :
                x = commands[i][0] 
                y = commands[i][1] 
            else :
                x = commands[i][1] 
                y = commands[i][0]

            data[x] -= 1 
            data[y] += 1
            ans.append(y)

        i += 1

    if fail :
        print("No")
    else :
        print("Yes")
        for c in ans :
            print(c)
Problem p02717 (python)

Fixed submission:
x, y, z = input().split(" ")
print("{} {} {}".format(z,x,y))

Buggy submission (verdict: Runtime Error):
x, y, z = input().split(" ")
print(f"{z} {x} {y}")

Buggy submission (verdict: Runtime Error):
x, y, z = input().split(" ")
print( f"{z} {x} {y}")
Problem p02684 (python)

Fixed submission:
n,k = map(int, input().split())
a = list(map(int,input().split()))
ans = 1
c = [1]
d = [0]*(n+5)
d[1] = 1
for j in range(1,2*n):
    i = a[c[-1]-1]
    if d[i] == 1:
        g = i
        break
    # if i in set(c):
    #     g = i
    #     break
    d[i] = 1
    c.append(i)
s = c.index(g)
r = len(c)-s
if k <=s:
    print(c[k])
else:
    b = (k-s)%r
    print(c[s+b])

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
a = list(map(int,input().split()))
ans = 1
c = [1]
for j in range(2*n):
    i = a[c[-1]-1]
    if i in set(c):
        g = j+1
        break
    c.append(i)
s = c.index(g)

print(c[k] if k < s else c[s - 1 + ((k-s+1) % (len(c)-s+1))])
Problem p02760 (python)

Fixed submission:
c = list(map(int,input().split())) + list(map(int,input().split())) + list(map(int,input().split()))
n = int(input())
d = [0]*9
for i in range(n):
    m = int(input())
    for j in range(9):
        if c[j] == m:
            d[j] = 1
if (d[0],d[1],d[2]) == (1,1,1) or (d[3],d[4],d[5]) == (1,1,1) or (d[6],d[7],d[8]) == (1,1,1)\
    or (d[0],d[3],d[6]) == (1,1,1) or (d[1],d[4],d[7]) == (1,1,1) or (d[2],d[5],d[8]) == (1,1,1)\
        or (d[0],d[4],d[8]) == (1,1,1) or (d[2],d[4],d[6]) == (1,1,1):
        print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a = [list(map(int, input().split())) for _ in range(3)]
    n = int(input())
    b = [int(input()) for i in range(n)]
    ai = [[1]*3 for _ in range(3)]
    for i in range(3):
        for j in range(3):
            if a[i][j] in b:
                ai[i][j] = 0
    ans = "No"
    for k in range(3):
        if sum(ai[k])== 0:
            ans = "Yes"
    for l in range(3):
        if ai[0][k]+ai[1][k]+ai[2][k] == 0:
            ans = "Yes"
    if ai[0][0]+ai[1][1]+ai[2][2] == 0 or ai[0][2]+ai[2][0]+ai[1][1] == 0:
        ans = "Yes"
    print(ans)
Problem p02761 (python)

Fixed submission:
n,m = map(int, input().split())
sc = [list(map(int, input().split())) for _ in range(m)]
for i in range(1000):
    num = str(i)
    if len(num) == n and all(num[s-1]==str(c) for s,c in sc):
        print(i)
        break
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
,m = map(int, input().split())
sc = [list(map(int, input().split())) for _ in range(m)]
for i in range(1001):
    if m == 0 and n == 1:
        print(0)
        break
    elif m==0:
        print("1"*n)
        break

    for j,k in sc:
        if len(str(i)) < j or len(str(i)) != n:
            break
        elif  int(str(i)[j-1]) != k:
            break

    else:
        print(i)
        break
else:
    print(-1)
Problem p02786 (python)

Fixed submission:
h = int(input())
x = "1"*(len(bin(h))-2)
print(int(x,2))

Buggy submission (verdict: Runtime Error):
h = int(input())
x = "1"*(h//2 + 1)
print(int(x,2))

Buggy submission (verdict: Runtime Error):
h = int(input())
n = h//2
x = "0b1"+("0"*(n+1))
# print(x)
# print((int(x,2)))
print(int((1-(int(x,2)))/(1-2)))
#print(int((1-2**(n+1))/(1-2)))

Buggy submission (verdict: Runtime Error):
h = int(input())
n = h//2
print(int((1-2**(n+1))/(1-2)))
Problem p02797 (python)

Fixed submission:
n,k,s = map(int,input().split())
for i in range(1,n+1):
    if i <=k:
        print(s)
    elif s == 10**9:
        print(1)
    else:
        print(10**9)

Buggy submission (verdict: Runtime Error):
n,k,s = map(int,input().split())
l = []
if n == k:
    l = [s]*n
    for i in range(n):
        print(a[i], end=" ")
else:
    if s%2:
        for i in range(k+1):
            print(i)
            if i%2:
                l += [int(s/2)]
            else:
                l += [int(s/2)+1]
        if s == 1 or s == 3:
            l += [100]*(n-(k+1))
        else:
            l += [1]*(n-(k+1))
    elif s != 2:
        l = [int(s/2)]*(k+1) + [int(s/2)+1]*(n-k-1)
    else:
        l = [int(s/2)]*(k+1) + [100]*(n-k-1)
        
    for i in range(n):
        print(l[i], end=" ")
Problem p02801 (python)

Fixed submission:
a = [chr((ord("a") + i)) for i in range(26)]
b = input()
for i in range(len(a)):
  if b == a[i]:
    print(a[i+1])

Buggy submission (verdict: Runtime Error):
s = int(input())
print(str(ord(s)+1))
Problem p02813 (python)

Fixed submission:
import itertools
n = int(input())
c1 = tuple(map(int, input().split()))
c2 = tuple(map(int, input().split()))
a = []
for i in range(1,n+1):
    a.append(i)
b = sorted(list(itertools.permutations(a)))
for i in range(len(b)):
    if b[i] == c1:
        d = i
    if b[i] == c2:
        e = i
print(abs(d-e))

Buggy submission (verdict: Runtime Error):
import itertools
n = int(input())
c1 = tuple(map(int, input().split()))
c2 = tuple(map(int, input().split()))
a = []
for i in range(1,n+1):
    a.append(i)
b = sorted(list(itertools.permutations(a)))
for i in range(len(b)):
    if b[i] == c1:
        d = i
    elif b[i] == c2:
        e = i
print(abs(d-e))
Problem p02842 (python)

Fixed submission:
import math
N = int(input())
X = math.ceil(N / 1.08)
if int(X*1.08) == N:
    print(X)
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
n = int(input())
if n//1.08 * 1.08 == n:
  print(n//1.08)
else (n//1.08+1)*1.08 == n:
  print(n//1.08+1)
else:
  print(":(")
Problem p02885 (python)

Fixed submission:
a,b = map(int,input().split())
print(max(0,a-(2*b)))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
print(max(0,a-(2*b))
Problem p03076 (python)

Fixed submission:
a = [int(input()) for i in range(5)]
if all(n%10==0 for n in a):
    b = sum([((k//10)+1)*10 for k in a if k%10 != 0])
    b += sum([l for l in a if l%10 ==0])
    print(b)
else:
    A = min([j%10 for j in a if j%10 != 0])
    b = sum([((k//10)+1)*10 for k in a if k%10 != 0])
    b += sum([l for l in a if l%10 ==0])
    print(b-(10-A))

Buggy submission (verdict: Runtime Error):
a = [int(input()) for i in range(5)]
A = min([j%10 for j in a if j%10 != 0])
b = sum([((k//10)+1)*10 for k in a if k%10 != 0])
b += sum([l for l in a if l%10 ==0])
print(b-(10-A))

Buggy submission (verdict: Runtime Error):
a = [int(input()) for i in range(5)]
A = min([j%10 for j in a if j%10 != 0])
b = sum([((k//10)+1)*10 for k in a if k%10 != 0])
b += sum([l for l in a if l%10 ==0])
print(b-(10-A))
Problem p03146 (python)

Fixed submission:
n = int(input())
ans = 1
while(n != 4 and n != 2 and n != 1):
    ans += 1
    if n%2 == 0:
        n = n//2
    else:
        n = 3*n+1
print(ans+3)

Buggy submission (verdict: Runtime Error):
ai=[s]
for i in range(1000000):
    if s%2:
        s =3*s+1
        ai.append(s)
    else:
        s = s//2
        ai.append(s)
    print(ai)
    if len(ai) != len(set(ai)):
        c=0
        for j in range(len(ai)):
            if ai.count(ai[j])==2:
                c +=1
                if c ==2:
                    print(j+1)
                    break
        exit()
Problem p03150 (python)

Fixed submission:
s = input()
k = "keyence"
for i in range(8):
    if s.startswith(k[:i]) and s.endswith(k[i:]):
        print("YES")
        break
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a = input()
b = "keyence"
j = 0
for i in a:
  if i==b[j]:
    j+=1
print("YES" if j == 7 else "NO")
Problem p03206 (python)

Fixed submission:
d = int(input())
print("Christmas" if d==25 else "Christmas Eve" if d==24 else "Christmas Eve Eve" if d==23 else "Christmas Eve Eve Eve")

Buggy submission (verdict: Runtime Error):
d = int(input())
print("Christmas" if d=25 else "Christmas Eve" if d =24 else "Christmas Eve Eve" if d=23 else "Christmas Eve Eve Eve")