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

Fixed submission:
n,m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse = True)
if a[m-1] * 4*m >= sum(a):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n,m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse = True)
if a[m] * 4*m >= sum(a):
    print('Yes')
else:
    print('No')
Problem p02732 (python)

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

from collections import Counter
cnt = Counter(A)

ans = 0
for v in cnt.values():
    ans += v*(v-1)//2

for a in A:
    k = cnt[a]
    print(ans - (k*(k-1)//2) + (k-1)*(k-2)//2)

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

from collections import Counter
cnt = Counter(A)

ans = 0
for v in cnt.values():
    ans += v*(v-1)//2

for a in A:
    k = C[a]
    print(ans - (k*(k-1)//2) + (k-1)*(k-2)//2)
Problem p02848 (python)

Fixed submission:
N = int(input())
S = input()
T = ''
for i in S:
    if (ord(i)-64+N)%26 != 0:
        T += chr((ord(i)-64+N)%26 + 64)
    else:
        T += 'Z'
print(T)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
for i in range(len(s)):
    for j in range(26):
        if s[i]==alpha[j]:
            s = s[:i]+alpha[j+n]+s[i+1:]
            break
print(s)
Problem p02911 (python)

Fixed submission:
from collections import Counter
n,k,q = map(int,input().split())
a = [int(input()) for _ in range(q)]
a = Counter(a)
for i in range(1,n+1):
    if a[i] > q-k:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
from collections import Counter
n,k,q = map(int,input().split())
a = [int(input) for _ in range(n)]
a = Counter(a)
for i in range(1,n+1):
    if a[i] > q-k:
        print('Yes')
    else:
        print('No')
Problem p03086 (python)

Fixed submission:
s = input()
ans = 0
for i in range(1,len(s)+1): #i文字の文字列について調べる
    for j in range(len(s)-i+1): #j文字目でスタートしたとして
        if all(s[k]=='A' or s[k]=='G' or s[k]=='C' or s[k]=='T' for k in range(j,j+i)):
            ans = i
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = 0
for i in range(1,len(s)+1): #i文字の文字列について調べる
    for j in range(len(s)-1): #j文字目でスタートしたとして
        if all(s[k]=='A' or s[k]=='G' or s[k]=='C' or s[k]=='T' for k in range(j,j+i)):
            ans = i
print(ans)
Problem p03161 (python)

Fixed submission:
import numpy as np
n,k = map(int, input().split())
h = np.array(list(map(int, input().split())))

dp = np.zeros(n, dtype = int)
for i in range(1,n):
    s = max(0,i-k)
    dp[i] = min(dp[s:i] + np.abs(h[i] -h[s:i]))
print(dp[-1])

Buggy submission (verdict: Runtime Error):
import numpy as np
n,k = map(int,input().split())
h = list(map(int,input().split()))
dp = np.array([10**10]*(n))
dp[0] = 0
if n-1 <= k:
    print(abs(h[-1]-h[0]))
else:
    for i in range(1,k+1):
        dp[i] = abs(h[i]-h[0])
    for i in range(k+1,n): 
        for j in range(1,k+1):
            dp[i] = min(dp[i], dp[i-j] + abs(h[i]-h[i-j]))
    print(dp[-1])

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
h = list(map(int,input().split()))
dp = np.array([10**10]*(n))
dp[0] = 0
if n-1 <= k:
    print(abs(h[-1]-h[0]))
else:
    for i in range(1,k+1):
        dp[i] = abs(h[i]-h[0])
    for i in range(k+1,n): 
        for j in range(1,k+1):
            dp[i] = min(dp[i], dp[i-j] + abs(h[i]-h[i-j]))
    print(dp[-1])
Problem p03220 (python)

Fixed submission:
n = int(input())
t, a = map(float, input().split())
h = list(map(float, input().split()))
import numpy as np
for i in range(n):
  h[i] = abs( a - (t - h[i] * 0.006))
print(np.argmin(h) + 1)

Buggy submission (verdict: Runtime Error):
n = int(input())
t, a = map(float, input().split())
h = list(map(float, input().split()))
import numpy as np
for i in range(n):
  h[i] = abs( a - (t - h[i] * 0.006))
print(np.armmin(h) + 1)

Buggy submission (verdict: Runtime Error):
n = int(input())
t, a = map(float, input().split())
h = list(map(float, input().split()))
import numpy as np
for i in range(n):
  h[i] = abs( a - (t - h[i] * 0.006))
print(np.armmin(h) + 1)

Buggy submission (verdict: Runtime Error):
n = int(input())
t, a = map(float, input().split())
h = list(map(float, input().split()))
import numpy as np
for i in range(n):
  h[i] = abs( a - (t - h[i] * (-0.006)))
print(np.armmin(h) + 1)

Buggy submission (verdict: Runtime Error):
n = input()
t, a = map(float, input().split())
h = list(map(float, input().split()))
for i in range(n):
  h[i] = abs( a - (t - h[i] * (-0.006)))
print(min(h))
Problem p03285 (python)

Fixed submission:
n = int(input())
count = 0
for i in range(n+1):
  for j in range(n+1):
    if 4*i + 7*j == n:
      count = 1
      break
if count == 1:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(n//7 + 1):
    if (n - 7*x) % 4 == 0:
        print('Yes')
        exit()
print('No')
Problem p03331 (python)

Fixed submission:
n = int(input())
c = n
def digitsum(n):
  s = 0
  while n>0:
    s += n % 10
    n //= 10
  return s
for i in range(1, n//2+1):
  a = digitsum(i)
  b = digitsum(n-i)
  if c > a + b:
    c = a + b
print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
c = n
for i in range(1, n//2+1):
  a = digitsum(i)
  b = digitsum(n-i)
  if c > a + b:
    c = a + b
print(c)
Problem p03369 (python)

Fixed submission:
print(700 + 100 * int(input().count("o")))

Buggy submission (verdict: Runtime Error):
print("700 + int(input().count("o"))")
Problem p03371 (python)

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

ans = 0
if min(x,y)==x:
    ans += x*min(a+b,2*c)
    y -= x
    x = 0
else:
    ans += y*min(a+b,2*c)
    x -= y
    y = 0
    
if x == 0:
    ans += y*min(b, 2*c)
else:
    ans += x*min(a, 2*c)

print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,x,y = map(int,input().split())
ans = 0
if x=>y:
    if 2*c <= a:
        print(2*c*x)
    else:
        if 2*c <= a+b:
            print(2*c*y + a*(x-y))
        else:
            print(a*x + b*y)
else:
    if 2*c <= b:
        print(2*c*y)
    else:
        if 2*c <= a+b:
            print(2*c*x + a*(y-x))
        else:
            print(a*x + b*y)
Problem p03433 (python)

Fixed submission:
a = int(input())
b = int(input())
if a % 500 <= b:
  print("Yes")
else:
  print("No")

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

if a % 500 <= b:
  print("Yes")
else:
  print("No")

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

if a % 500 <= b:
  print("Yes")
else:
  print("No")

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

if a % 500 <= b:
  print("Yes")
else:
  print("No")
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
if a * b % 2 == 0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
input()
a, b = map(int, input().split())
if a * b % 2 == 0:
  print("Even")
else:
  print("Odd")

Buggy submission (verdict: Runtime Error):
if (a * b) % 2 == 1:
  print("Odd")
else:
  print("Even")

Buggy submission (verdict: Runtime Error):
if a * b % 2 == 1:
  print("Odd")
else:
  print("Even")

Buggy submission (verdict: Runtime Error):
if a * b % 2 == 1:
  print("Odd")
else:
  print("Even")
Problem p03469 (python)

Fixed submission:
print(input().replace(str(2017), str(2018)))

Buggy submission (verdict: Runtime Error):
print("input().replace("2017", "2018")")

Buggy submission (verdict: Runtime Error):
print("input().replace("2017", "2018")")
Problem p03494 (python)

Fixed submission:
input()
A = list(map(int, input().split()))
count = 0
while all(a % 2 == 0 for a in A):
  A = [a/2 for a in A]
  count += 1
print(count)

Buggy submission (verdict: Runtime Error):
A = [input().split()]
count = 0
while all(a % 2 == 0 for a in A):
  A = [a/2 for a in A]
  count += 1
print(count)

Buggy submission (verdict: Runtime Error):
count = 0
A = [input().split()]
while all(a % 2 == 0 for a in A):
    A = [a/2 for a in A]
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
count = 0
while all(a % 2 == 0 for a in A):
    A = [a/2 for a in A]
    count += 1
print(count)
Problem p03495 (python)

Fixed submission:
import collections
n, k = map(int, input().split())
d = collections.defaultdict(int)
b = map(int, input().split())
for e in b:
    d[e] += 1
ret = 0
a = sorted([v for v in d.values()], reverse = True)
while len(a) > k:
    ret  += a.pop()
print(ret)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
d = collections.defaultdict(int)
b = map(int, input().split())
for e in b:
    d[e] += 1
ret = 0
a = sorted([v for v in d.values()], reverse = True)
while len(a) > k:
    ret  += a.pop()
print(ret)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
array = list(map(int, input().split()))
count = [0] * n
from collections import Counter
lis = sorted((Counter(array)).items(), key = lambda x: x[1])
count2 = 0
for i in range(len(lis)):
    if len(lis) > k:
        count2 += lis[i][1]
        lis.remove(lis[i])
print(count2)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
array = list(map(int, input().split()))
count = [0] * n
from collections import Counter
lis = sorted((Counter(array)).items(), key = lambda x: x[1])[:n]
count2 = 0
for i in range(len(lis)):
    if len(lis) > k:
        count2 += lis[i][1]
        lis.remove(lis[i])
print(count2)
Problem p03607 (python)

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]
import collections
b = collections.Counter(a)
set_a = list(set(a))
cnt = 0
for i in range(len(set_a)):
    if b[set_a[i]]%2 == 1:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for i in range(n)]
import collections
b = collections.Counter(a)
set_a = set(a)
cnt = 0
for i in range(len(set_a)):
    if b[set_a[i]]%2 == 1:
        cnt += 1
print(cnt)
Problem p03611 (python)

Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
a1 = [i+1 for i in a]
a2 = [i-1 for i in a]
a3 = Counter(a+a1+a2)
print(max(a3.values()))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
cnt = [0]*(max(a))
for i in range(max(a)):
    cnt[i] = a.count(i-1) + a.count(i) + a.count(i+1)
print(max(cnt))
Problem p03636 (python)

Fixed submission:
a = input()
print(a[0] + str(len(a) - 2) + a[len(a) -1])

Buggy submission (verdict: Runtime Error):
print(input()[0] + str(len(input()) - 2) + input()[len(input()) -1])
Problem p03644 (python)

Fixed submission:
n = int(input())
import numpy as np
a = list(range(1,n+1))
b = list(range(1,n+1))
c = [0] * n
for i in range(n):
  while a[i] % 2 == 0:
    a[i] /= 2
    c[i] += 1
print(b[np.argmax(c)])

Buggy submission (verdict: Runtime Error):
n = input()
import numpy as np
a = list(range(1,n+1))
b = list(range(1,n+1))
c = [0] * n
for i in range(n):
  while a[i] % 2 ==0:
    a[i] /= 2
    c[i] += 1
print(b[np.argmax(c)])

Buggy submission (verdict: Runtime Error):
n = input()
queue1 = list(range(1,n+1))
queue2 = list(range(1,n+1))
count = [0] * n
for i in range(n):
  while queue1[i] % 2 == 0:
    count[i] += 1
    queue1[i] /= 2
print(queue2[max(count)])
Problem p03693 (python)

Fixed submission:
A = list(map(int, input().split()))
a = A[1] * 10 + A[2]
if a % 4 == 0:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
A = list(input().split())
a = A[1] * 10 + A[2]
if a % 4 == 0:
  print("YES")
else:
  print("NO")
Problem p03814 (python)

Fixed submission:
s = input()
t = 0
u = 0
n = len(s)
for i in range(n):
  if s[i] == "A":
    t = i
    break
for j in range(n):
  if s[n-j-1] == "Z":
    u = n-j-1
    break
print(u-t+1)

Buggy submission (verdict: Runtime Error):
s = input()
t = 0
u = 0
n = len(s)
for i in range(n):
  if s[i] == "A":
    t = i
    break
for j in range(n):
  if s[n-j] == "Z":
    u = n-j
print(u-t)
Problem p03993 (python)

Fixed submission:
N = int(input())
A = list(map(lambda x:int(x)-1,input().split()))
ans = 0
paired = []
flag = [0]*N
for i in range(N):
    if flag[i]:
        continue
    else:
        if A[A[i]] == i:
            ans += 1
            flag[A[i]] = 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(lambda x:int(x)-1,input().split()))
ans = 0
paired = []
for i in range(n):
    if i in paired:
        continue
    else:
        if A[A[i]] == i:
            ans += 1
            paired.append(i)
            paired.append(A[i])
print(ans)
Problem p02600 (python)

Fixed submission:
N = int(input())
print(10-(N//200))

Buggy submission (verdict: Runtime Error):
N= int(input())
A = list(map(int,input().split()))
A.insert(0,A[0])
A.append(0)
 
money = 1000
previous_tendency = "remain"
current_tendency = "remain"
count = 1

 
for n in range(1,len(A)-1):
    if A[n] < A[n+1]:
        current_tendency = "up"
    elif A[n] > A[n+1]:
        current_tendency = "down"
    else:
        current_tendency = "remain"
        
    if previous_tendency != "down" and current_tendency != "up":
        #print(money,n,"chance",A[n],min(A[count:n+1]),previous_tendency, current_tendency)
        money += (money//min(A[count:n+1]))*(A[n]-min(A[count:n+1]))
        #print(A[count:n+1],money)
        count = n + 1
        previous_tendency = "remain"
    #print(A[n],max_price,min_price,previous_tendency,current_tendency)
    
    if current_tendency != "remain":
      previous_tendency = current_tendency
print(money)
Problem p02607 (python)

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

ans = 0
for a in range(0,len(A),2):
    if A[a]% 2 == 1:
        ans += 1
print(ans)

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

ans = 0
for a in range(0,len(A),2):
    if A[a]% 2 == 1:
        ans += 1
print(ans)
Problem p02639 (python)

Fixed submission:
x = list(map(int,input().split()))
print(15-sum(x))

Buggy submission (verdict: Runtime Error):
x = list(input().split())
print(15-sum(x))
Problem p02681 (python)

Fixed submission:
S = input()
T = input()

T2 = T[:len(T)-1]

if S == T2:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A,B,C,K = map(int,input().split())
 
if K <= A:
  print(K)
elif K <= (A+B):
  print(A)
else:
  print(A-(K-(A+B)))
Problem p02732 (python)

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

import collections
import math

dicA = collections.Counter(A)

total = 0
for x in list(dicA.values()):
  if x != 1:
    total += math.factorial(x) // (math.factorial(x - 2)*2)

for i in range(N):
  print(total - dicA[A[i]] +1)

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

import collections
import math

dicA = collections.Counter(A)

total = 0
for x in list(dicA.values()):
  total += math.factorial(x) // (math.factorial(x - 2)*2)

for i in range(N):
  print(total - dicA[A[i]] +1)
Problem p02796 (python)

Fixed submission:
import sys
import math
import itertools
import collections
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()

NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()

def main():
    N = NI()
    XL = [NLI() for _ in range(N)]
    
    #print(XL)
    arm_range = []
    for n in range(N):
        arm_range.append([XL[n][0]-XL[n][1],XL[n][0]+XL[n][1]])
    #print(arm_range)
    
    sorted_arm_range = sorted(arm_range, key=lambda x: x[1])  #[1]に注目してソート
    #print(sorted_arm_range)
    
    ans = 1
    arm_end = sorted_arm_range[0][1]
    
    if N == 1:
        ans = 1
    else:
        for n in range(N-1):
            if sorted_arm_range[n+1][0] >= arm_end:
                arm_end = sorted_arm_range[n+1][1]
                ans += 1

    print(ans)

if __name__ == '__main__':
    main()

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

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()

NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()

def main():
    N = NI()
    XL = [NLI() for _ in range(N)]
    

    arm_range = []
    for n in range(N):
        arm_len = XL[1]
        arm_range.append([XL[n][0]-XL[n][1],XL[n][0]+XL[n][1]])

    
    sorted_arm_range = sorted(arm_range, key=lambda x: x[1])  #[1]に注目してソート

    
    x = 0
    ans = 1
    while x<N-1:
        arm_end = sorted_arm_range[x][1]
        while x<N-1 and sorted_arm_range[x+1][0] < arm_end:
            x += 1
        ans += 1
        x += 1
        
    print(ans)

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

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

if (A-B)%2 == 0:
  print(abs(A-B)//2)
else:
  print(min((A+B-1)//2,(2*N-(A+B)+1)//2))

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

if (A-B)%2 == 0:
  print((A-B)//2)
else:
  print(min(max(N-A,N-B),max(A-1,B-1)))
Problem p02885 (python)

Fixed submission:
A, B = map(int,input().split())
 
C = A- 2*B
 
if C >=0:
  print(C)
else:
  print(0)

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

C = A- 2*B

if C >=0:
  print(C)
else:
  print(0)
Problem p02981 (python)

Fixed submission:
N, A, B= map(int,input().split())
 
print(min(N*A, B))

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

print(min(N*A, B)
Problem p02995 (python)

Fixed submission:
A, B, C, D = map(int,input().split())
import fractions
lcm = C*D//fractions.gcd(C,D)
print((B-B//C-B//D+ B//lcm)-((A-1) - (A-1)//C - (A-1)//D + (A-1)//lcm))

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int,input().split()
import fractions
lcm = C*D//fractions.gcd(C,D)
print((B-B//C-B//D+ B//lcm)-((A-1) - (A-1)//C - (A-1)//D + (A-1)//lcm))
Problem p02999 (python)

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

if X>=A:
  print(10)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
import sys
import math
import itertools
import collections
from collections import deque
from collections import defaultdict

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
MOD2 = 998244353
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()

def main():

    N, K = NMI()
    A = NLI()
    
    left = 0
    shakutori = 0
    ans = 0
    
    for left in range(N):
        shakutori = 0
        right = left
        
        while shakutori < K and right <N:
            shakutori += A[right]
            right+= 1
            
        if shakutori >= K:
            ans += N-right+1
        else:
            break
        
    print(ans)
    


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

Fixed submission:
A,B =map(int,input().split())
 
print(max(A*2-1,A+B,B*2-1))

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

print(max(A*2-1,A+B,B*2-1)
Problem p03085 (python)

Fixed submission:
b=input()
 
if b == 'A':
  print("T")
elif b == 'T':
  print('A')
elif b == 'C':
  print('G')
elif b == 'G':
  print('C')

Buggy submission (verdict: Runtime Error):
b=input()

if b = 'A':
  print("T")
elif b = 'T':
  print('A')
elif b = 'C':
  print('G')
elif b = 'G':
  print('C')
Problem p03160 (python)

Fixed submission:
import sys
import math
import itertools
import collections
from collections import deque
 
sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
 
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()
 
def main():
    N = NI()
    h = NLI()
    
    dp = [0 for _ in range((10**5)+10)]
    dp[0] = 0
    dp[1] = abs(h[1]-h[0])
    
    for n in range(2,N):
        dp[n] = min(dp[n-2]+abs(h[n]-h[n-2]),dp[n-1]+abs(h[n]-h[n-1]))
    print(dp[N-1])
 
 
if __name__ == '__main__':
    main()

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

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()

NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()

def main():
    N = NI()
    h = NLI()
    
    dp = [0 for _ in range((10**5)+10)]
    dp[0] = 0
    dp[1] = abs(h[1]-h[0])
    
    for n in range(2,N):
        dp[n] = min(dp[n-2]+abs(h[n]-h[n-2]),dp[n-1]+abs(h[n]-h[n-1]))
    print(dp[n])


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

Fixed submission:
s = input()
 
if len(s) == 2:
  print(s)
else:
  print("".join(list(reversed(s))))

Buggy submission (verdict: Runtime Error):
s = input()

if len(s) == 2:
  print(s)
else:
  print("".join(list(reverse(s))))
Problem p03371 (python)

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

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

Buggy submission (verdict: Runtime Error):
1500 2000 1600 3 2
Problem p03437 (python)

Fixed submission:
X ,Y = map(int,input().split())
 
if X%Y !=0:
  print(X)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
X ,Y = mao(int,input().split())

if (Y != 1)and(Y!=X):
  print(X)
else:
  print(-1)
Problem p03471 (python)

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

ans = [-1,-1,-1]

for n1 in range(N+1):
  for n2 in range(N-n1+1):
    yen = n1 * 10000 + n2 * 5000 + (N-n1-n2) * 1000
    if yen == Y:
      ans = [n1,n2,N-n1-n2]
      break

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

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

ans = [-1,-1,-1]

for n1 in range(N+1):
  for n2 in range(N-n1+1):
    yen = n1 * 10000 + n2 * 5000 + (N-n1-n2) * 1000
    if yen == Y:
      ans = [n1,n2,N-n1-n2]
      break
print(" ".join(ans))