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

Fixed submission:
def main():
    N, M = map(int, input().split())
    P = {tuple(map(int, input().split())) for _ in range(M)}
    P = sorted(P)
    ans = [0 for _ in range(N)]

    if N == 1 and M == 0:
        print(0)
        return

    if N == 2 and M == 0:
        print(10)
        return

    if N == 3 and M == 0:
        print(100)
        return

    if N > 1 and (1, 0) in P:
        print(-1)
        return

    if N > 1 and P[0][0] != 1:
        ans[0] = 1

    for i in range(len(P) - 1):
        if P[i][0] == P[i + 1][0]:
            print(-1)
            return

    for p in P:
        ans[p[0] - 1] = p[1]

    print("".join(map(str, ans)))


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N, M = map(int, input().split())
    P = {tuple(map(int, input().split())) for _ in range(M)}
    P = sorted(P)
    ans = [0 for _ in range(N)]

    if N > 1 and (1, 0) in P:
        print(-1)
        return

    if N > 1 and P[0][0] != 1:
        ans[0] = 1

    for i in range(len(P) - 1):
        if P[i][0] == P[i + 1][0]:
            print(-1)
            return

    for p in P:
        ans[p[0] - 1] = p[1]

    print("".join(map(str, ans)))


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N, M = map(int, input().split())
    P = {tuple(map(int, input().split())) for _ in range(M)}
    P = sorted(P)
    ans = [0 for _ in range(N)]

    if N > 1 and (1, 0) in P:
        print(-1)
        return

    if N > 1 and P[0][0] != 1:
        print(-1)
        return

    for i in range(len(P) - 1):
        if P[i][0] == P[i + 1][0]:
            print(-1)
            return

    for p in P:
        ans[p[0] - 1] = p[1]

    ans = map(str, ans)
    print("".join(ans))


if __name__ == "__main__":
    main()
Problem p02971 (python)

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

    max_value = max(A)
    max_index = A.index(max_value)

    for i in range(N):
        if i != max_index:
            print(max_value)
        else:
            if i == 0:
                print(max(A[1:]))
            elif i == N - 1:
                print(max(A[: N - 1]))
            else:
                print(max(max(A[:i]), max(A[i + 1 :])))

    return


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]

    max_value = max(A)
    max_index = A.index(max_value)

    for i in range(N):
        if i != max_index:
            print(max_value)
        else:
            if i == 0:
                print(max(A[1:]))
            elif i == N:
                print(max(A[:N]))
            else:
                print(max(max(A[:i]), max(A[i + 1 :])))

    return


if __name__ == "__main__":
    main()
Problem p02717 (python)

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

A, B = B, A
A, C = C, A

print(A,B,C)

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


if N < K:
    print(N)
else:
    N = abs(N - (N // K + 1) * K)
    if abs(N-K) <= N:
        print(abs(N-K))
    else:
        print(N)
Problem p02718 (python)

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

A.sort(reverse=True)
total_point = sum(A)

selectable = False

if total_point * (1 / (4 * M)) <= A[M-1]:
    selectable = True

if selectable:
    print('Yes')
else:
    print('No')

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

A.sort(reverse=True)
total_point = sum(A)

selectable = False

if  total_point * (1 / (4 * M)) =< A[M-1]:
    selectable = True

if selectable:
    print('Yes')
else:
    print('No')
Problem p02756 (python)

Fixed submission:
from collections import deque
S = deque(list(input()))
Q = int(input())

flag = 0
for i in range(Q):
    query = input().split()
    if query[0] == '1':
        flag = flag ^ 1
    elif query[0] == '2':
        if flag == 0:
            if query[1] == '1':
                S.appendleft(query[2])
            else:
                S.append(query[2])
        else:
            if query[1] == '1':
                S.append(query[2])
            else:
                S.appendleft(query[2])
if flag == 0:
    print(''.join(S))
else:
    # deque型はスライスで取り出せない print(''.join(S[::-1]))
    S.reverse()
    print(''.join(S))

Buggy submission (verdict: Runtime Error):
from collections import deque
S = deque(list(input()))
Q = int(input())

flag = 0
for i in range(Q):
    query = input().split()
    if query[0] == '1':
        flag = flag ^ 1
    elif query[0] == '2':
        if flag == 0:
            if query[1] == '1':
                S.appendleft(query[2])
            else:
                S.append(query[2])
        else:
            if query[1] == '1':
                S.append(query[2])
            else:
                S.appendleft(query[2])
if flag == 0:
    print(''.join(S))
else:
    print(''.join(S[::-1]))

Buggy submission (verdict: Runtime Error):
from collections import deque
S = deque(list(input()))
Q = int(input())

flag = 0
for i in range(Q):
    query = input().split()
    if query[0] == '1':
        flag = flag ^ 1
    elif query[0] == '2':
        if flag == 0:
            if query[1] == '1':
                S.appendleft(query[2])
            else:
                S.append(query[2])
        else:
            if query[1] == '1':
                S.append(query[2])
            else:
                S.appendleft(query[2])
if flag == 0:
    print(''.join(S))
else:
    print(''.join(S[::-1]))
Problem p02789 (python)

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

if N == M:
    print('Yes')

else:
    print('No')

Buggy submission (verdict: Runtime Error):
N, M = map(int, input())

if N == M:
    print('Yes')

else:
    print('No')
Problem p03455 (python)

Fixed submission:
a = [int(item) for item in input().split()]
seki = a[0] * a[1]
if seki % 2 == 0:
    print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
a = int(input().replace(' ', ''))

count = 1
while count < 100001
    if a = count ** 2:
        print('Yes')
        break
    count += 1

Buggy submission (verdict: Runtime Error):
a = (int(item) for item in input().split())
seki = a[0] * a[1]
if seki % 2 == 0:
    print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
a = [str(item) for item in input().split()]
seki = a[0] * a[1]

if seki % 2 == 0:
    print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
a = [str(item) for item in input().split()]
seki = a[0] * a[1]

if seki / 2 == 0:
    print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
a = [str(item) for item in input().split()]
seki = a[0] * a[1]

if seki % 2 == 0:
    print('Odd')
else:
    print('Even')

Buggy submission (verdict: Runtime Error):
a = [str(item) for item in input().split()]
seki = a[0] * a[1]

if seki // 2 == 0:
    print('Odd')
else:
    print('Even')

Buggy submission (verdict: Runtime Error):
a = [str(item) for item in input().split()]
seki = a[0] * a[1]

if seki / 2 == 0:
    print('Odd')
else:
    print('Even')
Problem p03456 (python)

Fixed submission:
a = int(input().replace(' ', ''))

count = 1
while count < a:
    if a == count * count:
        print('Yes')
        exit()
    count += 1
print('No')

Buggy submission (verdict: Runtime Error):
a = int(input().replace(' ', ''))

count = 1
while count < 100001
    if a == count ** 2:
        print('Yes')
        break
    count += 1
Problem p02664 (python)

Fixed submission:
t=list(input())
if t[0]=='?':
    t[0]=t[0].replace('?','D')
for i in range(1,len(t)-1):
    if t[i]=='?' and t[i+1]=='D' and t[i-1]=='P':
        t[i]=t[i].replace('?','D')
    elif t[i]=='?' and t[i+1]=='P' and t[i-1]=='P':
        t[i]=t[i].replace('?','D')
    elif t[i]=='?' and t[i+1]=='D' and t[i-1]=='D':
        t[i]=t[i].replace('?','P')
    elif t[i]=='?' and t[i+1]=='P' and t[i-1]=='D':
        t[i]=t[i].replace('?','D')
    elif t[i]=='?' and t[i+1]=='?' and t[i-1]=='D':
        t[i]=t[i].replace('?','P')
    elif t[i]=='?' and t[i+1]=='?' and t[i-1]=='P':
        t[i]=t[i].replace('?','D')
if t[-1]=='?':
    t[-1]=t[-1].replace('?','D')
for i in t:
    print(i,end='')

Buggy submission (verdict: Runtime Error):
t=list(input())
if t[0]=='?' and t[1]=='P':
    t[0]=t[0].replace('?','D')
elif t[0]=='?' and t[1]=='D':
    t[0]=t[0].replace('?','P')
for i in range(1,len(t)-1):
    if t[i]=='?' and t[i+1]=='D' and t[i-1]=='P':
        t[i]=t[i].replace('?','D')
    elif t[i]=='?' and t[i+1]=='P':
        t[i]=t[i].replace('?','D')
    elif t[i]=='?' and t[i+1]=='D' and t[i-1]=='D':
        t[i]=t[i].replace('?','D')
    elif t[i]=='?' and t[i+1]=='?' and t[i-1]=='D':
        t[i]=t[i].replace('?','D')
        t[i+1]=t[i+1].replace('?','D')
    elif t[i]=='?' and t[i+1]=='?' and t[i-1]=='P':
        t[i]=t[i].replace('?','D')
        t[i+1]=t[i+1].replace('?','D')
if t[-1]=='?' and t[-2]=='P' or t[-2]=='D':
    t[-1]=t[-1].replace('?','D')
for i in t:
    print(i,end='')

Buggy submission (verdict: Runtime Error):
t=list(input())
if t[0]=='?' and t[1]=='P':
    t[0]=t[0].replace('?','P')
elif t[0]=='?' and t[1]=='D':
    t[0]=t[0].replace('?','D')
for i in range(1,len(t)-1):
    if t[i]=='?' and t[i+1]=='D':
        t[i]=t[i].replace('?','P')
    elif t[i]=='?' and t[i+1]=='P':
        t[i]=t[i].replace('?','D')
    elif t[i]=='?' and t[i+1]=='?' and t[i-1]=='D':
        t[i]=t[i].replace('?','P')
        t[i+1]=t[i+1].replace('?','D')
    elif t[i]=='?' and t[i+1]=='?' and t[i-1]=='P':
        t[i]=t[i].replace('?','D')
        t[i+1]=t[i+1].replace('?','D')
if t[-1]=='?' and t[-2]=='P' or t[-2]=='D':
    t[-1]=t[-1].replace('?','D')
for i in t:
    print(i,end='')
Problem p02678 (python)

Fixed submission:
N, M = map(int, input().split())
link = [[] for i in range(N)]
for i in range(M):
    A, B = map(int, input().split())
    link[A-1].append(B-1)
    link[B-1].append(A-1)
visited = [False for i in range(N)]
result = [0] * N
Q = [0]
visited[0] = True
#Qに要素がなくなるまで
while Q:
    #一番上の要素をpop
    v = Q.pop(0)
    for i in link[v]:
        if visited[i] == False:
            visited[i] = True
            result[i] = v
            Q.append(i)
print("Yes")
for i in range(1, N):
    print(result[i] + 1)

Buggy submission (verdict: Runtime Error):
n,m,x=map(int,input().split())
l=[]
while n>0:
    for i in range(n):
        a=list(map(int,input().split()))
        l.append(a)
        if a[i]
Problem p02700 (python)

Fixed submission:
import sys
a,b,c,d=map(int,input().split())
while a>0 or c>0:
    c-=b
    if c<=0:
        print('Yes')
        sys.exit()
    a-=d
    if a<=0:
        print('No')
        sys.exit()

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
while a>0 or c>0:
    c-=b
    if c<=0:
        print('Yes')
        sys.exit()
    a-=d
    if a<=0:
        print('No')
        sys.exit()
Problem p02714 (python)

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

num_r = s.count('R')
num_g = s.count('G')
num_b = s.count('B')

ans = num_r*num_g*num_b

for i in range(n):
    for j in range(i, n):
        k = j+(j-i)
        if (k < n) and (s[i] != s[j]) and (s[j] != s[k]) and (s[k] != s[i]):
            ans -= 1
print(ans)

Buggy submission (verdict: Runtime Error):
Npt
Problem p02718 (python)

Fixed submission:
import sys
n,m = map(int,input().split())
l = list(map(int,input().split()))
l.sort(reverse=True)
sum1 = sum(l)/(4*m)
for i in range(m):
    if l[i] < sum1:
        print('No')
        sys.exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
import sys
n,m = map(int,input().split())
l = list(map(int,input().split()))
l.sort(reverse=True)
sum1 = sum(l)/(4*m)
for i in range(m):
    if l[i] < sum1:
        print('No')
        sys.exit()
    else:
        l[i] == l[i+1]
print('Yes')
Problem p02730 (python)

Fixed submission:
S = input()
N = len(S)
S1 = S[0:(N-1)//2]
S2 = S[(N+3)//2-1:N+1]
print("Yes" if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1] else "No")

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
if s[0:(n-1)//2:1]==s[(n-1)//2:0:-1] and s[(n+3)//2:n:1]==s[n:(n+3)//2:-1]  and  s=s[::-1]:
    print('Yes')
else:
    print('No')
Problem p02731 (python)

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

Buggy submission (verdict: Runtime Error):
l=int(input())
ans=[]
for i in range(1,l):
    for j in range(1,l):
        ans.append(i*j*(l-i-j))
print(max(ans))

Buggy submission (verdict: Runtime Error):
l=int(input())
ans=[]
for i in range(1,l//2+1):
    for j in range(1,l//2+1):
        ans.append(i*j*(l-i-j))
print(max(ans))
Problem p02813 (python)

Fixed submission:
from itertools import permutations
 
n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))
a = list(permutations(range(1, n + 1)))
print(abs(a.index(p) - a.index(q)))

Buggy submission (verdict: Runtime Error):
from itertools import permutations
n = int(input())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
res = list(permutations(range(1,n+1)))
ans = abs(res.index(p) - res.index(q))
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
res = list(permutations(range(1,n+1)))
ans = abs(res.index(p) - res.index(q))
print(ans)

Buggy submission (verdict: Runtime Error):
Not found
Problem p02818 (python)

Fixed submission:
A, B, K = map(int, input().split())
print(max(0, A-K), max(0, B-max(0, K-A)))

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
print(min(k-a,0),min(b-(k-a),)
Problem p02885 (python)

Fixed submission:
a,b=map(int,input().split())
if a-2*b<0:
    print('0')
else:
    print(a-2*b)

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
t=s[0]
ans=1
for i in range(1,n):
    if t!=s[i]:
        ans+=1
        t=s[i]
print(ans)
Problem p02887 (python)

Fixed submission:
n=int(input())
s=input()
t=s[0]
ans=1
for i in range(1,n):
    if t!=s[i]:
        ans+=1
        t=s[i]
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
n=int(input())
s=input()
l=[]

for i in range(n):
    if i==0 or l[-1]!=s[i]:
        l.append(s[i])
print(len(l))
Problem p02910 (python)

Fixed submission:
S = input()
print("No" if "L" in S[::2] or "R" in S[1::2] else "Yes")

Buggy submission (verdict: Runtime Error):
not
Problem p02917 (python)

Fixed submission:
N = int(input())
B = [int(i) for i in input().split()]

A = [0 for i in range(N)]
A[0] = B[0]
for i in range(N-1):
    A[i] = min(A[i], B[i])
    A[i+1] = B[i]

print(sum(A))

Buggy submission (verdict: Runtime Error):
n=int(input())
b=list(map(int,input().split()))
a=[]
for i in b:
    for j in b:
        if i>=max(b[j],b[i]):
            a.append(max(b[j],b[j+1]))
print(sum(a))
Problem p02923 (python)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
ans = 0
cnt = 0
for i in range(n-1):
    if h[i+1]<=h[i]:
        cnt+=1
    else:
        ans = max(ans, cnt)
        cnt = 0
print(max(ans, cnt))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
l=[]
for i in range(n-1):
    if h[i+1]-h[i]<=0:
        l.append(1)
    else:
        l.append(0)
ans=0
mn=[]
for j in range(len(l)):
    if l[j]==0:
        ans=0
        mn.append(ans)
    else:
        ans+=1
        mn.append(ans)
print(max(mn))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
l=[]
for i in range(n-1):
    if h[i+1]-h[i]<=0:
        l.append(1)
    else:
        l.append(0)
ans=0
mn=[]
for j in range(len(l)):
    if l[j]==0:
        mn.append(ans)
        ans=0
    else:
        ans+=1
        mn.append(ans)
print(max(mn))
Problem p02946 (python)

Fixed submission:
K, X = map(int, input().split())
for x in range(X-K+1, X+K):
    print(x, end=" ")

Buggy submission (verdict: Runtime Error):
Not found
Problem p02952 (python)

Fixed submission:
n = int(input())
a = 0
for i in range(1,n+1):
    if len(str(i))%2 != 0:
        a += 1
print(a)

Buggy submission (verdict: Runtime Error):
Not found
Problem p03086 (python)

Fixed submission:
s = str(input())
m = ['A','G','C','T']
ans = 0
cnt = 0
for c in s:
    if c in m:
        cnt += 1
    else:
        ans = max(cnt,ans)
        cnt = 0
else:
    ans = max(cnt,ans)
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
A = 0
B = []
for i in S:
  if i == 'A' or i == 'C' or i == 'G' or i == 'T':
    A += 1
  else:
    B.append(A)
    A = 0

print(max(B))
Problem p03105 (python)

Fixed submission:
a,b,c=map(int,input().split())
if b//a>c:
    print(c)
else:
    print(b//a)

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

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

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
m = []
for i in range(min(a,b),0,-1):
    if a%i == 0 and b%i == 0:
        m.append(i)
        if c == k:
            break
print(m[k-1])

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

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
m = []
for i in range(min(a,b)+1,1,-1):
    if a%i == 0 and b%i == 0:
        m.append(i)

print(m[k-1])

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
m = []
for i in range(min(a,b)+1,1,-1):
    if a%i == 0 and b%i == 0:
        m.append(i)
print(m)
print(m[k-1])

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
m = []
for i in range(1,min(a,b)):
    if a%i == 0 and b%i == 0:
        m.append(i)

print(m[k-1])

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
m = []
for i in range(1,min(a,b)):
    if a%i == 0 and b%i == 0:
        m.append(i)
print(m)
print(m[k-1])
Problem p03140 (python)

Fixed submission:
n=int(input())
a = input()
b = input()
c = input()
ans=0
for i in range(n):
    l=[a[i],b[i],c[i]]
    ans+=len(set(l))-1
print(ans)

Buggy submission (verdict: Runtime Error):
Npt
Problem p03238 (python)

Fixed submission:
n=int(input())
if n==1:
    print('Hello World')
else:
    a=int(input())
    b=int(input())
    print(a+b)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=int(input())
b=int(input())
if n==1:
    print('Hello World')
else:
    print(a+b)
Problem p03239 (python)

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

c_min=1001
for i in range(N):
  c,t=map(int,input().split())
  if t<=T and c<c_min:
    c_min=c
if c_min==1001:
  print('TLE')
else:print(c_min)

Buggy submission (verdict: Runtime Error):
n,T=[int(i) for i in input().split()]
mn=10000
print(n)
print(t)
for i in range(n):
    c,t=[int(i) for i in input().split()]
    if t<=T:
        mn=min(mn,c)
print("TLE" if mn==10000 else mn)
Problem p03264 (python)

Fixed submission:
import math
n=int(input())
print(math.floor(n/2*n/2))

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if (a*b)%2==0:
    print('No')
else:
    print('Yes')
Problem p03292 (python)

Fixed submission:
a1,a2,a3=sorted(map(int,input().split()))
print(a3-a1)

Buggy submission (verdict: Runtime Error):
Not found
Problem p03308 (python)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
print(max(l)-min(l))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
l = []
for i in range(n+1):
    for j in range(n+1):
        l.append(abs(a[i]-a[j]))
print(max(l))
Problem p03338 (python)

Fixed submission:
n=int(input())
s=input()
t=""
k=""
ans=0
l=[]
for i in range(1,n):
    ans1=0
    t=sorted(set(s[:i]))
    k=sorted(set(s[i:]))
    for i in t:
        for j in k:
            if i==j:
                ans1+=1
            l.append(ans1)
print(max(l))

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
t=""
k=""
ans=0
l=[]
for i in range(1,n):
    ans1=0
    t=sorted(set(s[:i]))
    k=sorted(set(s[i:]))
    for i in t:
        for j in k:
            if i==j:
                ans1+=1
                l.append(ans1)
print(max(l))
Problem p03352 (python)

Fixed submission:
x=int(input())
ans=1
for i in range(1,x+1):
    for j in range(2,50):
        for k in range(2,50):
            if i==j**k:
                ans=j**k
print(ans)

Buggy submission (verdict: Runtime Error):
x=int(input())
l=[]
for i in range(1,x+1):
    for j in range(1,x+1):
        if j*j==i:
            l.append(j*j)
        if j*j*j==i:
            l.append(j*j*j)
        if j*j*j*j==i:
print(max(l))
Problem p03371 (python)

Fixed submission:
a,b,c,x,y = map(int,input().split())
anlist=[]
for i in range(max(x,y)+1):
    ans = 2*c*i+a*max(0,x-i)+b*max(0,y-i)
    anlist.append(ans)
print(min(anlist))

Buggy submission (verdict: Runtime Error):
Not found
Problem p03373 (python)

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

cost1 = A * X + B * Y
cost2 = C * max([X, Y]) * 2

if X > Y:
    cost3 = C * Y * 2 + A * (X - Y)
else:
    cost3 = C * X * 2 + B * (Y - X)

print(min([cost1, cost2, cost3]))

Buggy submission (verdict: Runtime Error):
a,b,c,x,y=map(int,input().split())
ans=10**18
for i in range(max(x,y)+1):
    price=a*max(0,x-i)+b*max(0,y-i)+s*c*i
    ans = min(ans,price)
print(ans)
Problem p03378 (python)

Fixed submission:
n,m,x=map(int,input().split())
l=list(map(int,input().split()))
ans1=0
ans2=0
for i in range(x+1,n):
    for j in range(m):
        if l[j]==i:
            ans1+=1
for i in range(0,x):
    for j in range(m):
        if l[j]==i:
            ans2+=1
print(min(ans1,ans2))

Buggy submission (verdict: Runtime Error):
n,m,x=map(int,input().split())
nums=[0]*(n+1)
indices=list(map(int,input().split()))
for i in indices:
    nums[i]=1
print(min(num[:x].count(1),nums[x:].count(1)))
Problem p03435 (python)

Fixed submission:
c11,c12,c13=map(int,input().split())
c21,c22,c23=map(int,input().split())
c31,c32,c33=map(int,input().split())
if c11+c22+c33 == c12+c23+c31 == c13+c21+c32:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
c11,c12,c13=map(int,input().split())
c21,c22,c23=map(int,input().split())
c31,c32,c33=map(int,input().split())
for i in range(1,101):
    for j in range(1,101):
        if
Problem p03455 (python)

Fixed submission:
a,b = (int(x) for x in input().split())
c = (a*b) % 2 
if c == 0:
    print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
k = input()
a = int(k)
l = input()
b = int(l)

if a*b%2 == 0:
    print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):
a = int(input())
b= int(input())
if a*b%2 == 0:
        print('Even')
else:
        print('Odd')

Buggy submission (verdict: Runtime Error):
input = (a, b)
int a 
int b

int c = a * b

if a * b % 2 = 0:
  print('Even')
  
  else:
    print('Odd')
Problem p03493 (python)

Fixed submission:
a,b,c = map(int, input().strip())
0 <= a <= 1
0 <= b <= 1
0 <= c <= 1

print(a + b + c)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
a == 1 or a == 0
b == 1 or b == 0
c == 1 or c == 0

print('a + b + c')

Buggy submission (verdict: Runtime Error):
a,b = (int(x) for x in input().split())
if a*b%2 == 0:
    print('Even')
else:
    print('Odd')
Problem p03495 (python)

Fixed submission:
from collections import Counter
n,k=map(int,input().split())
A=list(map(int,input().split()))
cnt=Counter(A)
alt=sorted(cnt.values(),reverse=True)
print(sum(alt[k:]))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
l = list(map(int,input().split()))
if set(l)<=k:
    print(0)
    break
Problem p03502 (python)

Fixed submission:
target=input()
t=sum(list(map(int,target)))
if int(target)%t == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = list(int(input()))
b = 0
for i in range(len(s)):
    b += int(s[i])
print(s)