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

Fixed submission:
import sys,heapq
#これを加える！！！！
def _heappush_max(heap, item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappop_max(heap):
    """Maxheap version of a heappop."""
    lastelt = heap.pop()    # raises appropriate IndexError if heap is empty
    if heap:
        returnitem = heap[0]
        heap[0] = lastelt
        heapq._siftup_max(heap, 0)
        return returnitem
    return lastelt

n = int(input())
a = list(map(int,input().split()))

res = [0]*(n+1)
head = a[:n:]
heapq.heapify(head)
p = sum(head)
for i in range(n+1):
    res[i] = p
    p += a[n+i]
    heapq.heappush(head,a[n+i])
    p -= heapq.heappop(head)
end = a[2*n::]
heapq._heapify_max(end)
q = sum(end)
for i in range(n+1):
    res[n-i] -= q
    q += a[2*n-1-i]
    _heappush_max(end,a[2*n-1-i])
    q -= _heappop_max(end)
print(max(res))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readlin

n = int(input())
a = list(map(int,input().split()))

Buggy submission (verdict: Runtime Error):
ef d_3n_numbers(N, A):
    import heapq
 
    def _heappush_max(heap, item):
        heap.append(item)
        heapq._siftdown_max(heap, 0, len(heap) - 1)
    def _heappop_max(heap):
    """Maxheap version of a heappop."""
    　　lastelt = heap.pop()    # raises appropriate IndexError if heap is empty
    　　if heap:
        　　returnitem = heap[0]
        　　heap[0] = lastelt
        　　heapq._siftup_max(heap, 0)
        　　return returnitem
    　　return lastelt
    setattr(heapq, '_heappush_max', _heappush_max)
 
    left = A[:N]
    heapq.heapify(left)
    right = A[2 * N:]
    heapq._heapify_max(right)
    left_sum, right_sum = [sum(left)], [sum(right)]
 
    # 同じ要素をleftとrightで取り合っても、相殺されるので問題ない
    for k in range(N, 2 * N):
        heapq.heappush(left, A[k])
        v = heapq.heappop(left)
        left_sum.append(left_sum[-1] + A[k] - v)
    for k in range(2 * N - 1, N - 1, -1):
        heapq._heappush_max(right, A[k])
        v = heapq._heappop_max(right)
        right_sum.append(right_sum[-1] + A[k] - v)
    right_sum = right_sum[::-1]
 
    ans_candidate = [a - b for a, b in zip(left_sum, right_sum)]
    return max(ans_candidate)
 
N = int(input())
A = [int(i) for i in input().split()]
print(d_3n_numbers(N, A))
Problem p03856 (python)

Fixed submission:
s=list(input())
n = len(s)

c=0
k=0
while c==0:
    if k ==n:
        c = 1
    else:
        
        if k + 7 <= n-1 and s[k]=='d' and s[k+1] == 'r' and s[k+2] == 'e' and s[k+3] == 'a' and s[k+4] == 'm' and s[k+5] == 'e' and s[k+6] == 'r' and s[k+7] == 'a':
            k += 5
        elif k + 6 <= n-1 and s[k]=='d' and s[k+1] == 'r' and s[k+2] == 'e' and s[k+3] == 'a' and s[k+4] == 'm' and s[k+5] == 'e' and s[k+6] == 'r':
            k += 7
        elif k + 4 <= n-1 and s[k]=='d' and s[k+1] == 'r' and s[k+2] == 'e' and s[k+3] == 'a' and s[k+4] == 'm':
            k += 5
        elif k+6 <= n-1 and s[k] == 'e' and s[k+1] == 'r' and s[k+2] == 'a' and s[k+3] == 's' and s[k+4] == 'e' and  s[k+5] == 'r' and s[k+6] == 'a':
            k+= 5
        elif k+5 <= n-1 and s[k] == 'e' and s[k+1] == 'r' and s[k+2] == 'a' and s[k+3] == 's' and s[k+4] == 'e' and  s[k+5] == 'r':
            k += 6
        elif k+4 <= n-1 and s[k] == 'e' and s[k+1] == 'r' and s[k+2] == 'a' and s[k+3] == 's' and s[k+4] == 'e':
            k += 5
        else:
            c = 1

if k == n:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
dreameraser
Problem p03864 (python)

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

res = 0
for i in range(1,n):
    if a[i]+a[i-1]>= x:
        res += (a[i]+a[i-1]-x)
        if a[i-1]>= x:
            a[i]=0
        else:
            a[i] = x-a[i-1]
    
print(res)

Buggy submission (verdict: Runtime Error):
def dijkstra(s):
    #始点sから各頂点への最短距離
    #n:頂点数,　w:辺の数, cost[u][v] : 辺uvのコスト(存在しないときはinf)
    d = [float("inf")] * n
    used = [False] * n
    d[s] = 0
    
    while True:
        v = -1
        #まだ使われてない頂点の中から最小の距離のものを探す
        for i in range(n):
            if (not used[i]) and (v == -1):
               v = i
            elif (not used[i]) and d[i] < d[v]:
                v = i
        if v == -1:
               break
        used[v] = True
               
        for j in range(n):
               d[j] = min(d[j],d[v]+cost[v][j])
    return d

Xs,Ys,Xt,Yt = map(int,input().split())
n = int(input())
p = [[Xs,Ys,0],[Xt,Yt,0]]
for i in range(2,n+2):
    p.append(list(map(int,input().split())))
cost = [[0]*(n+2)for i in range(n+2)]

for i in range(n+2):
    for j in range(i,n+2):
        cost[i][j] = cost[j][i] =  max(((p[i][0]-p[j][0])**2+(p[i][1]-p[j][1])**2)**0.5 - p[i][2] - p[j][2],0)

n += 2

res = dijkstra(0)
print(res[1])
Problem p03938 (python)

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

a = [0] * n
b = [0] * n
c = []

for i in range(n):
    a[i] = 30000*(i+1)+5
    b[i] = 30000*(n-i-1)+5

for i in range(n):
    k = p[i]
    b[k-1] += i

res = ''
ans = ''
for i in range(n):
    if i == n-1:
        res += str(a[i])
        ans += str(b[i])
    else:
        res += str(a[i]) + ' '
        ans += str(b[i]) + ' '

print(res)
print(ans)

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

a = [0] * n
b = [0] * n
c = []

for i in range(n):
    a[i] = 30000*i
    b[i] = 30000*(n-i)

for i in range(n):
    k = p[i]
    b[k] += i

res = ''
ans = ''
for i in range(n):
    res += str(a[i]) + ' '
    ans += str(b[i]) + ' '
print(res)
print(ans)
Problem p02641 (python)

Fixed submission:
x, n = map(int, input().split())
if n == 0:
    print(x)
else:
    p = [int(x) for x in input().split()]
    for i in range(n + 1):
        if not x - i in p:
            print(x - i)
            break
        elif not x + i in p:
            print(x + i)
            break
        else:
            continue

Buggy submission (verdict: Runtime Error):
import sys
x, n = map(int, input().split())
if n == 0:
    print(x)
    exit(1)
p = [int(x) for x in input().split()]
k = 0
while x in p:
    if not x - k in p:
        print(x - k)
        exit(1)
    elif not x + k in p:
        print(x + k)
        exit(1)
    else:
        k += 1
        continue
print(x)

Buggy submission (verdict: Runtime Error):
import sys
x, n = map(int, input().split())
if n == 0:
    print(x)
    exit(1)
p = [int(x) for x in input().split()]
k = 0
while x in p:
    if not x - k in p:
        print(x - k)
        exit(1)
    elif not x + k in p:
        print(x + k)
        exit(1)
    else:
        k += 1
        continue
print(x)
Problem p02645 (python)

Fixed submission:
s=input()
print(s[:3])

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = list(map(int, input().split()))
for i in range(k):
    b = [0] * n
    for j in range(n):
        b[max(0, j - a[j]):min(n, j + a[j] + 1)] = map(lambda x: x + 1, b[max(0, j - a[j]):min(n, j + a[j] + 1)])
    a = b
print(' '.join([str(_) for _ in a]))
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=1
check=0
a=sorted(list(map(int,input().split())))
for i in range(n):
  if ans>=10**18:
    check=1
    break
  else:
    ans*=a[i]
print([ans,-1][check])

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=1
a=list(map(int,input().split()))
for i in range(n):
  ans*=a[i]
if ans>=10**18:
  print(-1)
else:
  print(ans)
Problem p02658 (python)

Fixed submission:
n=int(input())
ans=1
check=0
a=sorted(list(map(int,input().split())))
for i in range(n):
  if ans>10**18:
    check=1
    break
  else:
    ans*=a[i]
if ans>10**18:
    check=1
print([ans,-1][check])

Buggy submission (verdict: Runtime Error):
n=int(input())
ans=1
a=list(map(int,inpiut().split()))
for i in range(n):
  ans*=a[i]
if ans>=10**18:
  print(-1)
else:
  print(ans)
Problem p02681 (python)

Fixed submission:
s=input()
t=input()
if t[:-1]==s:
  print("Yes")
else:
  print("No")

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

n, k = map(int, input().split())
A = list(map(int, input().split()))


def check(x):
    return A[x - 1]


x = 1
lis = deque([])
for i in range(n + 2):
    if check(x) in lis:
        break
    else:
        lis.appendleft(check(x))
        x = check(x)

num = lis.index(check(x)) + 1
k = (k - (i - num)) % num
print(lis[- k - (i - num)])

Buggy submission (verdict: Runtime Error):
n, m, x = map(int, input().split())
keep = []
ans = 10**10
for i in range(n):
    c = list(map(int, input().split()))
    keep.append(c)

for j in range(2**n):
    bag = [0] * n
    total = 0
    check = 1
    for k in range(n):
        if ((j >> k) & 1):
            for l in range(m):
                bag[l] += keep[k][l + 1]
            total += keep[k][0]
    for a in range(m):
        if bag[a] < x:
            check *= 0
    if ans * check > total:
        ans = total
if ans == 10**10:
    print(-1)
else:
    print(ans)
Problem p02683 (python)

Fixed submission:
n, m, x = map(int, input().split())
keep = []
ans = 10**10
for i in range(n):
    c = list(map(int, input().split()))
    keep.append(c)
for j in range(2**n):
    bag = [0] * m
    total = 0
    check = 1
    for k in range(n):
        if ((j >> k) & 1):
            for l in range(m):
                bag[l] += keep[k][l + 1]
            total += keep[k][0]
    for a in range(m):
        if bag[a] < x:
            check *= 0
    if ans * check > total:
        ans = total
if ans == 10**10:
    print(-1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
n, m, x = map(int, input().split())
keep = []
ans = 10**10
for i in range(n):
    c = list(map(int, input().split()))
    keep.append(c)

for j in range(2**n):
    bag = [0] * n
    total = 0
    check = 1
    for k in range(n):
        if ((j >> k) & 1):
            for l in range(m):
                bag[l] += keep[k][l + 1]
            total += keep[k][0]
    for a in range(m):
        if bag[a] < x:
            check *= 0
    if ans * check > total:
        ans = total
if ans == 10**10:
    print(-1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
n, m, x = map(int, input().split())
keep = []
ans = 10**10
for i in range(n):
    c = list(map(int, input().split()))
    keep.append(c)

for j in range(2**n):
    bag = [0] * n
    total = 0
    check = 1
    for k in range(n):
        if ((j >> k) & 1):
            for l in range(m):
                bag[l] += keep[k][l + 1]
            total += keep[k][0]
    for a in range(m):
        if bag[a] < x:
            check *= 0
    if ans * check > total:
        ans = total
if ans == 10**10:
    print(-1)
else:
    print(ans)
Problem p02690 (python)

Fixed submission:
x = int(input())


i = 0
a, b = 0, 0
while i**5 < x:
    i += 1
mx = i
for k in range(2 * (mx + 1)):
    for j in range(-k, k + 1):
        if k**5 - j**5 == x:
            a, b = k, j
print(a, b)

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


i = 0

while i**5 < x:
    i += 1
for k in range(i):
    for j in range(-i, i + 1):
        if k**5 - j**5 == x:
            a, b = k, j
print(a, b)
Problem p02705 (python)

Fixed submission:
A=int(input())
print(A*2*3.141)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
for i in range(1,N+1):
    ans=A.count(i)
    print(ans)
Problem p02714 (python)

Fixed submission:
def main():
    N=int(input())
    S=input()
    k1=S.count("R")
    k2=S.count("B")
    ans=k1*k2*(len(S)-k1-k2)
    for i in range(N-2):
        for j in range(i+1,N-1):
            if j+(j-i)<N and S[i]!=S[j]:
                if S[j+(j-i)]!=S[i] and S[j+(j-i)]!=S[j]:
                    ans-=1
    print(ans)
main()

Buggy submission (verdict: Runtime Error):
def main():
    N=int(input())
    S=input()
    ans=0
    for i in range(N-2):
        for j in range(i+1,N-1):
            lis=["R","G","B"]
            if S[i]!=S[j]:
                lis=["R","G","B"]
                lis.remove(S[i],S[j])
                k=S[j+1:].count(lis[0])
                ans=ans+k
            if j+(j-i)<N and S[i]!=S[j]:
                if S[j+(j-i)]!=S[i] and S[j+(j-i)]!=S[j]:
                    ans-=1
    print(ans)
main()
Problem p02732 (python)

Fixed submission:
import collections

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

ans=0
dic=collections.Counter(A)
keys=list(dic.keys())
values=list(dic.values())


for i in values:
    
    ans+=(i*(i-1))//2

for j in A:
    ANS=ans
    num=dic[j]
    ANS=ANS-(num-1)
    print(ANS)

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

shim0=[-1 for i in range(N)]
real_ans=0
ans1=list(set(A))
for k in range(len(ans1)):
    num_k=A.count(ans1[k])
    real_ans+=(num_k*(num_k-1))//2
    
    
for i in range(N):
    if shim0[A[i]]!=-1:
        print(shim0[A[i]])
    else:
        num=A.count(A[i])
        re_ans=real_ans-(num-1)
        shim0[A[i]]=re_ans
        print(shim0[A[i]])
Problem p02741 (python)

Fixed submission:
K=int(input())
A=[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(A[K-1])

Buggy submission (verdict: Runtime Error):
K=int(input())
A=[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(A[K+1])
Problem p02761 (python)

Fixed submission:
N, M = map(int, input().split())
sc = [list(map(int, input().split())) for _ in range(M)]
dic = {}

# 一桁で0のときの対応
if sc == [] and N == 1:
    print(0)
    exit()
if sc == [[1, 0]] and N == 1:
    print(0)
    exit()

# 文字を組み立てます。
for k in sc:
    if k[0] in dic:
        if dic[k[0]] != k[1]:  # 重なったら即アウト
            print(-1)
            exit()
    else:
        dic[k[0]] = k[1]
ans = 0

if 1 in dic and dic[1] == 0:  # 一桁めが存在するかどうか判定している。
    print(-1)
    exit()
for k in dic:
    ans += 10**(N - k) * dic[k]
if ans < 10**(N - 1):
    ans += 10**(N - 1)
print(ans)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
S=["0" for i in range(N)]
seen=[]
for i in range(M):
    A=input().split()
    if A not in seen:
        seen.append(A)
        if S[int(A[0])-1]=="0":
            S[int(A[0])-1]=A[1]
        else:
            W="bad"
ANS="".join(S)
if (ANS[0]=="0" and len(ANS)!=1) or W=="bad":
    print("-1")
else:
    print(ANS)

Buggy submission (verdict: Runtime Error):
def get_unique_list(seq):
    seen = []
    return [x for x in seq if x not in seen and not seen.append(x)]

N,M=map(int,input().split())
a=[]
b=[]
A=0
for i in range(M):
    a.append(list(map(int,input().split())))
    b.append(a[i][0])

aa=get_unique_list(a)
if len(set(b))!=len(aa):
    ans=-1

else:
    for j in range(len(aa)):
      A+=aa[j][1]*(10**(N-aa[j][0]))
      ans=A
if N!=len(str(ans)):
    ans=-1
print(ans)
Problem p02801 (python)

Fixed submission:
S=input()
num=ord(S)
print(chr(num+1))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
keep=[]
lis=[]
ac=[0]*N
wa=[0]*N
WA=0
for i in range(M):
    ps=input().split()
    keep.append(ps)
    
for j in range(M):
    if keep[j][1]=="AC":
        ac[int(keep[j][0])-1]=1
    elif ac[int(keep[j][0])-1]==0:
        wa[int(keep[j][0])-1]+=1
AC=sum(ac)
for k in range(N):
    WA+=ac[k]*wa[k]
    
print(AC,WA)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
keep=[]
lis=[]
ac=[0]*N
wa=[0]*N
WA=0
for i in range(M):
    ps=input().split()
    keep.append(ps)
    
for j in range(M):
    if keep[j][1]=="AC":
        ac[int(keep[j][0])-1]=1
    elif ac[int(keep[j][0])-1]==0:
        wa[int(keep[j][0])-1]+=1
AC=sum(ac)
for j in range(M):
    WA+=ac[j]*wa[j]
    
print(AC,WA)
Problem p02802 (python)

Fixed submission:
N,M=map(int,input().split())
keep=[]
lis=[]
ac=[0]*N
wa=[0]*N
WA=0
for i in range(M):
    ps=input().split()
    keep.append(ps)
    
for j in range(M):
    if keep[j][1]=="AC":
        ac[int(keep[j][0])-1]=1
    elif ac[int(keep[j][0])-1]==0:
        wa[int(keep[j][0])-1]+=1
AC=sum(ac)
for k in range(N):
    WA+=ac[k]*wa[k]
    
print(AC,WA)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
keep=[]
lis=[]
ac=[0]*N
wa=[0]*N
WA=0
for i in range(M):
    ps=input().split()
    keep.append(ps)
    
for j in range(M):
    if keep[j][1]=="AC":
        ac[int(keep[j][0])-1]=1
    elif ac[int(keep[j][0])-1]==0:
        wa[int(keep[j][0])-1]+=1
AC=sum(ac)
for j in range(M):
    WA+=ac[j]*wa[j]
    
print(AC,WA)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
keep=[]
lis=[]
ac=[0]*N
wa=[0]*N
WA=0
for i in range(M):
    ps=input().split()
    keep.append(ps)
    
for j in range(M):
    if keep[j][1]=="AC":
        print(int(keep[j][0]-1))
        ac[int(keep[j][0]-1)]=1
    elif ac[int(keep[j][0]-1)]==0:
        wa[int(keep[j][0]-1)]+=1
AC=sum(ac)
for j in range(M):
    WA+=ac[j]*wa[j]
    
print(AC,WA)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
keep=[]
lis=[]
ac=[0]*N
wa=[0]*N
WA=0
for i in range(M):
    ps=input().split()
    keep.append(ps)
    
for j in range(M):
    if keep[j][1]=="AC":
        print(int(keep[j][0]))
        ac[int(keep[j][0])]=1
    elif ac[int(keep[j][0])]==0:
        wa[int(keep[j][0])]+=1
AC=sum(ac)
for j in range(M):
    WA+=ac[j]*wa[j]
    
print(AC,WA)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
keep=[]
lis=[]
ac=[0]*N
wa=[0]*N
WA=0
for i in range(M):
    ps=input().split()
    keep.append(ps)
    
for j in range(M):
    if keep[j][1]=="AC":
        ac[int(keep[j][0])]=1
    elif ac[int(keep[j][0])]==0:
        wa[int(keep[j][0])]+=1
AC=sum(ac)
for j in range(M):
    WA+=ac[j]*wa[j]
    
print(AC,WA)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
keep=[]
lis=[]
ac=[0]*M
wa=[0]*M
WA=0
for i in range(M):
    ps=input().split()
    keep.append(ps)
    
for j in range(M):
    if keep[j][1]=="AC":
        ac[int(keep[j][0])]=1
    elif ac[int(keep[j][0])]==0:
        wa[int(keep[j][0])]+=1
AC=sum(ac)
for j in range(M):
    WA+=ac[j]*wa[j]
    
print(AC,WA)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
keep=[]
lis=[]
ac=0
wa=0
for i in range(M):
    ps=input().split()
    keep.append(ps)
for j in range(M):
    if not keep[j][0] in lis:
        if keep[j][1]=="AC":
            ac+=1
            lis.append(keep[j][0])
        else:
            wa+=1
print(ans,wa)
Problem p02909 (python)

Fixed submission:
S=input()
if S=="Sunny":
    print("Cloudy")
elif S=="Cloudy":
    print("Rainy")
else:
    print("Sunny")

Buggy submission (verdict: Runtime Error):
S=int(input())
if S=="sunny":
    print("Cloudy")
elif S=="Cloudy":
    print("Rainy")
else:
    print("Sunny")

Buggy submission (verdict: Runtime Error):
S=int(input())
if S=="sunny":
    print("Cloudy")
elif S=="Cloudy":
    print("Rainy")
else:
    print("Sunny")
Problem p02921 (python)

Fixed submission:
S=input()
T=input()
ans=0
for i in range(3):
  if S[i]==T[i]:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
print((N*(N-1))/2)

Buggy submission (verdict: Runtime Error):
N=int(input())
print(N*(N-1)/2)

Buggy submission (verdict: Runtime Error):
N=int(input())
print(N*(N-1)/2)
Problem p02924 (python)

Fixed submission:
N = int(input())
if N == 1:
    print(0)
elif N == 2:
    print(1)
else:
    print((N * (N-1)) // 2)

Buggy submission (verdict: Runtime Error):
int(input())
print(N*(N-1)/2)

Buggy submission (verdict: Runtime Error):
int(input())
print(N*(N-1)/2)
Problem p02999 (python)

Fixed submission:
X,A=map(int,input().split())
print(0) if X<A else print(10)

Buggy submission (verdict: Runtime Error):
w,h,x,y=map(int,input().split())
ans=0
if (2*x==w)&(2*y==h):
  ans=1
print((w*h)/2,ans)

Buggy submission (verdict: Runtime Error):
w,h,x,y=map(int,input().split())
print((w*h)/2,(2*x==w)&(2*y==h))
Problem p03001 (python)

Fixed submission:
w,h,x,y=map(int,input().split())
ans=0
if (2*x==w)&(2*y==h):
  ans=1
print((w*h)/2,ans)

Buggy submission (verdict: Runtime Error):
w,h,x,y=map(int,input().split())
print((w*h)/2,(2x==w)&(2y==h))
Problem p03059 (python)

Fixed submission:
A,B,T=map(int,input().split())
i=0
while A*i<=T:
    i=i+1
print(B*(i-1))

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

souwa = 0
cnt = 0
keep = 1e10

for i in range(N):
    if A[i] < 0:
        cnt += 1
        A[i] *= (-1)

    souwa += A[i]
    keep = min(keep, A[i])

print(souwa - 2 * keep * (cnt % 2))
Problem p03076 (python)

Fixed submission:
summ = 0
check = 10
for i in range(5):
    i = int(input())
    summ += (i - 1) // 10 + 1
    if 0 < i % 10 < check:
        check = i % 10
print(summ * 10 - (10 - check))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
aa = (a - 1) // 10 + 1
bb = (b - 1) // 10 + 1
cc = (c - 1) // 10 + 1
dd = (d - 1) // 10 + 1
ee = (e - 1) // 10 + 1

aaa = a % 10
bbb = b % 10
ccc = c % 10
ddd = d % 10
eee = e % 10

print(((aa + bb + cc + dd + ee) * 10) -
      (10 - sorted(set([aaa, bbb, ccc, ddd, eee, 0]))[1]))
Problem p03085 (python)

Fixed submission:
b=input()
lis=["A","G","T","C"]
print(lis[(int(lis.index(b))+2)%4])

Buggy submission (verdict: Runtime Error):
n, q = map(int, input().split())
s = input()
keep = [0]*(n)

for i in range(1, n):
    l, r = i-1, i+1
    if s[l:r] == "AC":
        keep[i] = 1

for j in range(q):
    l, r = map(int, input().split())
    print(sum(keep[l:r]))
Problem p03125 (python)

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

if B%A==0:
  print(A+B)
else:
  print(B-A)

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

a = sorted(a)
check_minn = 10 ** 10


def check(a, n, check_minn):
    minn = 10 ** 10
    for i in range(1, n):
        if minn > a[i] - a[i - 1] and a[i] - a[i - 1] != 0:
            minn = a[i] - a[i - 1]
    if minn == 10 ** 10:
        return a[0]
    for i in range(n):
        a[i] = a[i] % minn
    a = sorted(list(set(a)))
    n = len(a)
    if a == [0]:
        return minn
    minn = 10 ** 10
    for i in range(n):
        minn = min(minn, a[i])
    if minn == check_minn:
        return minn
    else:
        check_minn = minn
        return check(a, n, check_minn)


print(check(a, n, check_minn))

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

if B%A==0:
  ptint(A+B)
else:
  print(B-A)

Buggy submission (verdict: Runtime Error):
A,B=int(input())
if B%A==0:
  ptint(A+B)
else:
  print(B-A)
Problem p03150 (python)

Fixed submission:
S=input()
l=len(S)
a=0
for i in range(l):
  for j in range(i,l):
    if S[:i]+S[j:]=="keyence":
      a=1
print(["NO","YES"][a])

Buggy submission (verdict: Runtime Error):
S=input()
moji="keyence"
i=0
j=0
while i<len(S):
    if S[i]==moji[j]:
        i+=1
        j+=1
    else:
        i+=1
if j==7:
    print("YES")
else:
    print("NO")