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

Fixed submission:
k = int(input())
d1 = k % 10
mae = 0
sd = [0]*10
cnt = 0
if not d1 in (1, 3, 7, 9):
  print(-1)
  exit()
for i in range(1,10) :
  sd[d1 * i % 10] = i
#print(sd)

for j in range(999999):
  d2 = 7 - mae % 10
  s = str(sd[d2] * k + mae)
#  print("mae ", mae,"",sd[d2] * k )
#  print("s1=",s)
  for i in range(len(s)-1, -1, -1):
#    print("s[",i,"]=",s[i])
    if (s[i]) == "7":
      cnt += 1
    else:
      s = s[0:i+1]
      mae = int(s)
#      print("s2=",s)
      break
#    print("i= ",i)
    if i == 0 :
      print(cnt)
      exit()

Buggy submission (verdict: Runtime Error):
n,d = list(map(int, input().split()))
c=0
d *= d
for i in range(n):
  x,y = list(map(int, input().split()))
  x *= x
  y *= y
  y += x
  if y <= d:
    c += 1
print(c)
Problem p02580 (python)

Fixed submission:
h, w, m = map(int, input().split())
s = []
r = [0] * (h + 1)
c = [0] * (w + 1)
for i in range(m):
    bh, bw = map(int, input().split())
    s.append([bh, bw])
    r[bh] += 1
    c[bw] += 1
R = max(r)
nr = {i for i, x in enumerate(r) if x == R}
C = max(c)
nc = {i for i, x in enumerate(c) if x == C}
count = sum(x in nr and y in nc for x, y in s)
print(R + C - (len(nr) * len(nc) == count))

Buggy submission (verdict: Runtime Error):
h, w, m = map(int, input().split())
s = []
bb = [[0] * (w + 1) for _ in range(h + 1)]
r = [0] * (h + 1)
c = [0] * (w + 1)
for i in range(m):
    bh, bw = map(int, input().split())
    s.append([bh, bw])
    bb[bh][bw] = 1
    r[bh] += 1
    c[bw] += 1
R = max(r)
nr = {i for i, x in enumerate(r) if x == R}
C = max(c)
nc = {i for i, x in enumerate(c) if x == C}
count = sum(x in nr and y in nc for x, y in s)
print(R + C - (len(nr) * len(nc) == count))

Buggy submission (verdict: Runtime Error):
import numpy as np

h, w, m = map(int, input().split())
bb = [[0] * w for _ in range(h)]
mx = 0
for _ in range(m):
    bh, bw = map(int, input().split())
    bb[bh - 1][bw - 1] = 1
smr = np.sum(bb,axis=1)
bb.pop(np.argmax(smr))
smc = np.sum(bb,axis=0)
print(max(smr) + max(smc))
Problem p02951 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(1, n + 1):
    if 10 <= i < 100 or 1000 <= i < 10000:
        continue
    else:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(1, n + 1):
    if 10 <= i < 100 or 1000 <= i < 10000 or i == 100000:
        continue
    else:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(1,n + 1):
    if 10 <= i < 100 or 1000 <= i < 10000 or i == 100000:
        continue
    else:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(1,n + 1):
    if 10 <= i < 100 or 1000 <= i < 10000 or i == 100000:
        ans += 0
    else:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 0
for i in range(1,n + 1):
    if 10 <= i < 100 or 1000 <= i < 10000 or i == 100000:
        ans = ans
    else:
        ans += 1
print(ans)
Problem p03307 (python)

Fixed submission:
n=input()
if int(n)%2==0:
  print(n)
else:
  print(int(n)*2)

Buggy submission (verdict: Runtime Error):
n=input()
if n%2==0:
  print(n)
else:
  print(n*2)
Problem p02785 (python)

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

cnt = 0
H.sort(reverse=True)

if K >= N:
    print(0)
else:
    print(sum(H[K:]))

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

ans = sum(H)

for n in range(1,min(N+1,K+1)):
    ans -= sorted(H)[-n]

print(ans)]
Problem p02831 (python)

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

# from math import gcd
def gcd(a, b):
	if a < b:
	    a, b = b, a
	while a % b != 0:
	    a, b = b, a % b
	return(b)

print(int(A * B / gcd(A, B)))

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

from math import gcd
print(int(A * B / gcd(A, B)))
Problem p02699 (python)

Fixed submission:
s, w = map(int, input().split(" "))
res = "safe"
if w >= s:
    res = "unsafe"
print(res)

Buggy submission (verdict: Runtime Error):
s, w = map(int, input().split(""))
res = "safe"
if w >= s:
    res = "unsafe"
print(res)
Problem p02779 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split(" ")))
deta = set()
error = False

for i in range(n):
    if n == 0:
        pass
    elif error:
        break
    elif a[i] in deta:
        error = True
        break
    deta.add(a[i])
if error:
    print("NO")
else:
    print("YES")

Buggy submission (verdict: Runtime Error):
    n=int(input())
    a=list(map(int,input().split(" ")))
    deta=[]
    error=False
     
    for i in range(n):
      if len(deta)==0:
        pass
      elif error:
        break
      elif a[i] in deta:
        error=True
      deta.append(a[i])
    if error:
      print("YES")
    else:
      print("NO")

Buggy submission (verdict: Runtime Error):
    n=int(input())
    a=list(map(int,input().split(" ")))
    deta=[]
    error=False
    try:
      for i in range(n):
        if len(deta)==0:
          pass
        elif error:
          break
        elif a[i] in deta:
          error=True
        deta.append(a[i])
    if error:
      print("YES")
    else:
      print("NO")

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split(" ")))
deta=[]
error=False
try:
  for i in range(n):
    if error:
      break
    elif a[i] in deta:
      error=True
    
if error:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split(" ")))
deta=[]
try:
  for i in range(n):
  if a[i] in deta:
	raise "err"
except err:
	print("NO")
print("YES")
Problem p02627 (python)

Fixed submission:
import re
a = input()
content_lower = r'[a-z]'
content_upper = r'[A-Z]'

if(re.match(content_lower, a)):
  print('a')
elif(re.match(content_upper, a)):
  print('A')

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

sssss
sssss
sss

print(anser)
Problem p02571 (python)

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

Min = 100000

for i in range(len(S) - len(T) + 1):
    count = 0
    for n in range(len(T)):
        if S[i + n] != T[n]:
            count += 1
    if count < Min:
        Min = count

print(Min)

Buggy submission (verdict: Runtime Error):
 S = input()
T = input()

Min = 100000

for i in range(len(S) - len(T) + 1):
    count = 0
    for n in range(len(T)):
        if S[i + n] != T[n]:
            count += 1
    if count < Min:
        Min = count

print(count)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()

Min = 100000

for i in range(len(S)):
    if i + len(T) > len(S) - 1:
        break
    count = 0
    for n in range(len(T)):
        if S[i + n] != T[n]:
            count += 1
    if count < Min:
        Min = count

print(count)
Problem p02598 (python)

Fixed submission:
from math import ceil


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    def check(Min):
        kill = 0
        for a in A:
            kill += (ceil(a/Min)-1)
        return kill <= K

    l = 0
    r = 1000000000

    while r-l > 1:
        mid = (l+r)//2
        if check(mid):
            r = mid
        else:
            l = mid
    print(r)
        


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    A = sorted(A, reverse=True)
    tA = []
    for a in A:
        tA.append((a, 1))

    for k in range(K):
        #print('rope:' + str(k))
        a, diva = tA[1]
        b, divb = tA[0]
        #print(tA)
        while b/divb > a/diva:
            divb += 1
        B = b/divb
        x = 1
        while x < N:
            xn, divx = tA[x]
            if xn/divx < B:
                break
            x += 1
        if x != N:
            tA.insert(x, (b, divb))
        else:
            tA.append((b, divb))
        tA = tA[1:]
        #print(tA)
    print(math.ceil(tA[0][0]/tA[0][1]))




if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math

def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    A = sorted(A, reverse=True)
    tA = []
    for a in A:
        tA.append((a, 1))

    for k in range(K):
        print('rope:' + str(k))
        a, diva = tA[1]
        b, divb = tA[0]
        print(tA)
        while b/divb > a/diva:
            divb += 1
        B = b/divb
        x = 1
        while x < N:
            xn, divx = tA[x]
            if xn/divx < B:
                break
            x += 1
        if x != N:
            tA.insert(x, (b, divb))
        else:
            tA.append((b, divb))
        tA = tA[1:]
        print(tA)
    print(math.ceil(tA[0][0]/tA[0][1]))


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

Fixed submission:
N = int(input())
z,w = [],[]
K = 0
for i in range(N):
  x,y = map(int,input().split())
  z.append(x)
  w.append(y)
for j in range(N-2):
  if z[j] == w[j] and z[j+1] == w[j+1] and z[j+2] == w[j+2]:
    K += 1

if K >= 1:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
z,w = [],[]
K = 0
for i in range(N):
  x,y = map(int,input().split())
  z.append(x)
  w.append(y)
for j in range(1,N-1):
  if z[j] == w[j] and z[j+1] == w[j+1] and z[j+2] == w[j+2]:
    K += 1

if K >= 1:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
z,w = [],[]
K = 0
for i in range(N):
  x,y = map(int,input().split())
  z.append(x)
  w.append(y)
for j in range(N):
  if z[j] == w[j] and z[j+1] == w[j+1] and z[j+2] == w[j+2]:
    K += 1

if K >= 1:
  print("Yes")
else:
  print("No")
Problem p02552 (python)

Fixed submission:
x = int(input())
if x == 0:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
print(max(a*c,a*d,b*c,b*d))
Problem p02987 (python)

Fixed submission:
#ABC132 A

S = str(input())
T = [S[0],S[1],S[2],S[3]]
T.sort()
if T[0] == T[1] and T[2] == T[3] and T[1] != T[2]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#ABC132 B

n = int(input())
K = 0
for i in range(n-2):
    if (P[i]<P[i+1] and P[i+1] < P[i+2]) or (P[i+2]<P[i+1] and P[i+1]<P[i]):
        K += 1
        
print(K)

Buggy submission (verdict: Runtime Error):
#ABC132 A

S = str(input())
T = [S[0],S[1],S[2],S[3]]
T.sort()
if T[0] == T[1] and T[2] == T[3] and T[1] != T[2]
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
#ABC132 A

S = str(input())
S.sort()
if S[0] = S[1] and S[2] = S[3]:
    print("Yes")
else:
    print("No")
Problem p02989 (python)

Fixed submission:
#ABC132 C

N = int(input())
D = list(map(int,input().split()))
D.sort()
A = list(range(D[int(N/2)-1]+1,D[int(N/2)]+1))

print(len(A))

Buggy submission (verdict: Runtime Error):
#ABC132 C

N = int(input())
D = list(map(int,input().split()))
count = 0
for K in range(N):
    A = []
    B = []
    if D[i] >= K:
        A.append(D[i])
    else:
        B.append(D[i])
    if len(A) == len(B):
        count += 1
    
print(count)
Problem p03041 (python)

Fixed submission:
N,K = map(int,input().split())
S = str(input())
T = list(map(str,S))

for i in range(N):
    if i == K-1:
        T[i] = str.lower(T[i])

print("".join(T))

Buggy submission (verdict: Runtime Error):
#ABC126 B

S = list(map(int,input()))
if 1 <= S[0]*10 + S[1] <= 12 and 1 <= S[2]*10 + S[3] <= 12:
    print("AMBIGUOUS")
elif 1 <= S[0]*10 + S[1] <= 12 and (S[2]*10 + S[3] > 12 or S[2]*10 + S[3] == 0):
    print("MMYY")
elif (S[0]*10 + S[1] > 12 or S[0]*10 + S[1] == 0)  and  1 <= S[2]*10 + S[3] <= 12:
    print("YYMM")
elif (S[0]*10 + S[1] > 12 or S[0]*10 + S[1] == 0) and (S[2]*10 + S[3] > 12 or S[2]*10 + S[3] == 0):
    print("NA")
Problem p02987 (python)

Fixed submission:
s = input()
ans = 'No'
index = s.find(s[0], 1)
if index >= 1:
    s = s.replace(s[0], '')
    if (len(s) == 2):
        if (s[0] == s[1]):
            ans ='Yes'
    
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = 'No'
index = s.find(s[0], 1)
if index >= 1:
    s = s.replace(s[0], '')
    if (len(s) >= 2) & (s[0] == s[1]):
        ans ='Yes'
    
print(ans)
Problem p02777 (python)

Fixed submission:
str1, str2 = input().split()
num1, num2 = map(int,input().split())
trim = input()
 
if trim == str1:
	num1 = num1 - 1
else:
  	num2 = num2 - 1
 
print("%d %d"  %(num1, num2))

Buggy submission (verdict: Runtime Error):
num = input()
list = list(map(int,input().split()))
flg  = False
for i in list:
  if list.count(i) >= 2:
  	flg = True
    break
print("NO") if flg else print("YES")

Buggy submission (verdict: Runtime Error):
str1, str2 = input().split()
num1, num2 = map(int,input.split())
trim = input()
 
if trim == str1:
	num1 = num1 - 1
else:
  	num2 = num2 - 1
 
print("%d %d",%(num1, num2))

Buggy submission (verdict: Runtime Error):
str1, str2 = input().split()
num1, num2 = map(int,input.split())
trim = input()
 
if trim == str1:
	num1 = num1 - 1
else:
  	num2 = num2 - 1
 
print("%d %d",%(num1, num2))

Buggy submission (verdict: Runtime Error):
str1, str2 = input().split()
num1, num2 = map(int,input.split())
trim = input()

if trim == str1:
	num1 = num1 - 1
else:
  	num2 = num2 - 1

print("%d %d",%(num1, num2))
Problem p02779 (python)

Fixed submission:
num = input()
list = list(map(int,input().split()))
list2 = set(list) 
print("YES") if len(list) == len(list2) else print("NO")

Buggy submission (verdict: Runtime Error):
num = input()
list = list(map(int,input().split()))
flg  = False
for i in list:
  if list.count(i) >= 2:
	flg = True
	break
print("NO") if flg else print("YES")
Problem p02679 (python)

Fixed submission:
import sys
import math
from collections import defaultdict

input = sys.stdin.buffer.readline
MOD = 1000000007
N = int(input())
dd = defaultdict(int)
count = 1
iwashi = [list(map(int, input().split())) for _ in range(N)]


checked = defaultdict(bool)
zeros = 0

for i in range(N):
    if iwashi[i][0] == iwashi[i][1] == 0:
        zeros += 1
        continue
    iw = iwashi[i]
    gcd_iw = math.gcd(iw[0], iw[1])
    if gcd_iw != 0:
        iw = list(map(lambda x: x // gcd_iw, iw))
    if iw[0] < 0:
        iw = list(map(lambda x: -x, iw))
    if iw[0] == 0 and iw[1] < 0:
        iw = list(map(lambda x: -x, iw))
    dd[tuple(iw)] += 1

for key, val in dd.items():
    if checked[key]:
        continue
    vert_key = (key[1], -key[0]) if key[1] > 0 else (-key[1], key[0])
    vert_val = dd[vert_key] if vert_key in dd else 0
    count *= (pow(2, val, MOD) - 1) + (pow(2, vert_val, MOD) - 1) + 1
    count %= MOD
    checked[vert_key] = True

# 0匹入れる場合を除外
count -= 1

count += zeros
print(count % MOD)

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

input = sys.stdin.buffer.readline
MOD = 1000000007
N = int(input())
dd = defaultdict(int)
count = 1
iwashi = [list(map(int, input().split())) for _ in range(N)]


checked = defaultdict(bool)
zeros = 0

for i in range(N):
    if iwashi[i][0] == iwashi[i][1] == 0:
        zeros += 1
        continue
    iw = iwashi[i]
    gcd_iw = math.gcd(iw[0], iw[1])
    if gcd_iw != 0:
        iw = [iw[0] / gcd_iw, iw[1] / gcd_iw]
    if iw[0] < -1:
        iw *= -1
    dd[tuple(iw)] += 1
for key, val in dd.items():
    if checked[key]:
        continue
    vert_key = (key[1], -key[0]) if key[1] >= 0 else (-key[1], key[0])
    vert_val = dd[vert_key] if vert_key in dd else 0
    count *= (pow(2, val, MOD) - 1) + (pow(2, vert_val, MOD) - 1) + 1
    count %= MOD
    checked[vert_key] = True

# 0匹入れる場合を除外
count -= 1

count += zeros
print(count % MOD)
Problem p02693 (python)

Fixed submission:
import sys
input = sys.stdin.buffer.readline

K = int(input())

A, B = map(int, input().split())


def main(K, A, B):
    for i in range(A, B + 1):
        if i % K == 0:
            print('OK')
            sys.exit()
    print('NG')


if __name__ == '__main__':
    main(K, A, B)

Buggy submission (verdict: Runtime Error):
import sys
from numba import njit
input = sys.stdin.buffer.readline


@njit
def main():
    K = int(input())
    A, B = map(int, input().split())
    for i in range(A, B + 1):
        if i % K == 0:
            print('OK')
            return 0
    print('NG')
    return 0


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.buffer.readline
 
 
def main():
    K = int(input())
    A, B = map(int, input().split())
	for i in range(A, B + 1):
        if i % K == 0:
            print('OK')
            sys.exit()
    print('NG')
 
 
if __name__ == '__main__':
    main()

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


def main():
  	K = int(input())
	A, B = map(int, input().split())
    for i in range(A, B + 1):
        if i % K == 0:
            print('OK')
            sys.exit()
    print('NG')


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

Fixed submission:
import sys
from itertools import combinations_with_replacement


def main():
    input = sys.stdin.buffer.readline
    n, m, q = map(int, input().split())
    query = [list(map(int, input().split())) for _ in range(q)]
    li = [0] * m
    for i in range(1, m + 1):
        li[i - 1] = i
    max_point = 0
    for a in combinations_with_replacement(li, n):
        point = 0
        for qer in query:
            if a[qer[1] - 1] - a[qer[0] - 1] == qer[2]:
                point += qer[3]
        if point > max_point:
            max_point = point
    print(max_point)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
from itertools import combinations_with_replacement
from numba import njit


@njit('(i8,i8,i8[:,:])')
def solve(n, m, query):
    li = [0] * m
    for i in range(1, m + 1):
        li[i - 1] = i
    max_point: int = 0
    for a in combinations_with_replacement(li, n):
        point = 0
        for qer in query:
            if a[qer[1] - 1] - a[qer[0] - 1] == qer[2]:
                point += qer[3]
        if point > max_point:
            max_point = point
    print(max_point)


def main():
    input = sys.stdin.buffer.readline
    n, m, q = map(int, input().split())
    query = [list(map(int, input().split())) for _ in range(q)]
    solve(n, m, query)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
from itertools import combinations_with_replacement
from numba import njit


@njit('(i8,i8,i8[:,:])')
def solve(n, m, query):
    li = [i for i in range(1, m + 1)]
    max_point: int = 0
    for a in combinations_with_replacement(li, n):
        point = 0
        for qer in query:
            if a[qer[1] - 1] - a[qer[0] - 1] == qer[2]:
                point += qer[3]
        if point > max_point:
            max_point = point
    print(max_point)


def main():
    input = sys.stdin.buffer.readline
    n, m, q = map(int, input().split())
    query = [list(map(int, input().split())) for _ in range(q)]
    solve(n, m, query)


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

Fixed submission:
S = input()
 
if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = list(input().split())
if S[2] == S[3] or S[4] == S[5]:
  print("Yes")
else:
  print("No")
Problem p02725 (python)

Fixed submission:
K,N = map(int,input().split())
A = list(map(int, input().split()))
max = K + A[0] - A[N-1]
for i in range(N-1):
    if max < A[i+1] - A[i]:
        max = A[i+1] - A[i]
print(K - max)

Buggy submission (verdict: Runtime Error):
K, N = int(input().split())
A = list(map(int, input().split()))
max = A[1] - A[0]
for i in range(1, N-1):
    if max < A[i+1] - A[i]:
        max = A[i+1] - A[i]
if max < K - A[N-1]:
    max = K - A[N+1]
print(K - max)
Problem p02682 (python)

Fixed submission:
s = input().split()
n = int(s[3])
sum_=0
if int(s[0]) >= n:
    sum_=1*n
elif int(s[0])+int(s[1]) >= n:
    sum_=1*(n-int(s[1]))
elif int(s[0])+int(s[1])+int(s[2]) >= n:
    sum_=1*int(s[0])+(-1*(n-int(s[0])-int(s[1])))

print(sum_)

Buggy submission (verdict: Runtime Error):
s = input().split()
n = int(s[3])
l1=[1]*int(s[0])
l2=[0]*int(s[1])
l3=[-1]*int(s[2])
l=l1+l2+l3
sum_=0
i=0
while i < n:
    sum_+=l[i]

    i += 1
print(sum_)

Buggy submission (verdict: Runtime Error):
s = input().split()
n = int(s[3])

l1=[1]*int(s[0])
l2=[0]*int(s[1])
l3=[-1]*int(s[2])
l=l1+l2+l3
sum_=0
i=0
while i < n:
    sum_+=l[i]

    i += 1
print(sum_)
Problem p02624 (python)

Fixed submission:
n = int(input())
def div(n):
    a = 0
    for i in range(1, n+1):
        y = int(n/i)
        a += y* (y+1)*i/2
    return int(a)
print(div(n))

Buggy submission (verdict: Runtime Error):
import sympy

n = int(input())


count = 0
for i in range(1, n + 1):
    count += i * len(sympy.divisors(i))
print(count)
Problem p02659 (python)

Fixed submission:
import math
ab = input()
ab = list(ab.split())
a, b = int(ab[0]), ab[1]
b = b[0] + b[2] + b[3]
b = int(b)

print(a * b // 100)

Buggy submission (verdict: Runtime Error):

a = list(map(int, input().split()))
count = 1
for i in a:
    count *= i
if count > 10 ** 18:
    print(-1)
else:
    print(count)
Problem p02682 (python)

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

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

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

Fixed submission:
d,t,s=map(int,input().split())
if s*t<d:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
D,T,S=map(int,input().spltit())
if D>T*S:
    print("No")
else:
    print("Yes")
Problem p02820 (python)

Fixed submission:
N,K=map(int,input().split())
R,S,P=map(int,input().split())
T=input()
a=0
for i in range(K):
    t=0
    l=T[i:N:K]
    for j in l:
        if j=="r":
            if t!=1:
                a+=P
                t=1
            else:
                t=0
        if j=="s":
            if t!=2:
                a+=R
                t=2
            else:
                t=0
        if j=="p":
            if t!=3:
                a+=S
                t=3
            else:
                t=0
print(a)

Buggy submission (verdict: Runtime Error):
    return sys.stdin.readline()[:-1]
N,K=map(int,input().split())
R,S,P=map(int,input().split())
T=input()
l=[None]*K
a=0
for i in range(K):
    t=0
    l[i]=T[i:N:K]
    for j in l[i]:
        if j=="r":
            if t!=1:
                a+=P
                t=1
            else:
                t=0
        if j=="s":
            if t!=2:
                a+=R
                t=2
            else:
                t=0
        if j=="p":
            if t!=3:
                a+=S
                t=3
            else:
                t=0
print(a)
Problem p02935 (python)

Fixed submission:
N=int(input())
v= list(map(int, input().split()))
v.sort()
t=(v[0]+v[1])/2
for i in range(2,N):
    t=(t+v[i])/2
print(t)

Buggy submission (verdict: Runtime Error):
N,Q=map(int,input().split())
l=[[1,0,0]]
for i in range(1,N):
    a,b=map(int,input().split())
    l.append([b,a,0])
l.sort()
for i in range(Q):
    p,x=map(int,input().split())
    l[p-1][2]+=x
t=[l[0][2]]
for i in range(1,N):
    t.append(t[l[i][1]-1]+l[i][2])
print(*t)