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

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

s=[]
d=[-1]*(n+1)

v=1
while(d[v]==-1):
    d[v]=len(s)
    s.append(v)
    v=a[v-1]
c=len(s)-d[v]
l=d[v]

if(k<l):print(s[k])
else:
    k-=l
    k%=c
    print(s[k+l])

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
d=[]
s=[-1]*(n+1)
t=1
for i in range(1,k):
    d.append(t)
    s[t]=1
    if(s[a[t-1]]==1):
        break
    t=a[t-1] 
idx=d.index(a[t-1])
d=d[idx:]
print(d[(k-i)%len(d)])

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
d=[]
t=1
for i in range(1,k):
    d.append(t)
    if(a[t-1] in d):
        break
    t=a[t-1] 
idx=d.index(a[t-1])
d=d[idx:]
print(d[(k-i)%len(d)])

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
d=[1]
t=a[0]
for i in range(1,k):
    d.append(t)
    if(a[t-1] in d):
        break
    t=a[t-1] 
idx=d.index(a[t-1])
d=d[idx:]
print(d[(k-i-1)%len(d)])

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
d=[1]
t=a[0]
for i in range(1,k):
    d.append(t)
    if(a[t-1] in d):
        break
    t=a[t-1] 
idx=d.index(a[t-1])
d=d[idx:]
print(d[(k-i-1)%len(d)])

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
d=[]
t=a[0]
for i in range(1,k):
    d.append(t)
    if(a[t-1] in d):
        # d.pop()
        break
    t=a[t-1] 
idx=d.index(a[t-1])
d=d[idx:]
print(d[(k-i-1)%len(d)])

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
d=[]
t=a[0]
for i in range(1,k):
    d.append(t)
    if(a[t-1] in d):
        # d.pop()
        break
    t=a[t-1] 
idx=d.index(a[t-1])
idx=len(d[:idx])
print(d[(k-i-1)%len(d)-idx])
Problem p02780 (python)

Fixed submission:
n,k=map(int,input().split())
p=list(map(int,input().split()))
f=lambda x:0.5*(x+1)
pp=list(map(f,p))
t=[0]*(n+1)
for i in range(n):
    t[i+1]=t[i]+pp[i]
ans=0
for i in range(n-k+1):
    ans=max(ans,t[i+k]-t[i])
print(ans)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
p=list(map(int,input().split()))
f=lambda x:0.5*(x+1)
pp=list(map(f,p))
t=[0]*(n+1)
for i in range(n):
    t[i+1]=t[i]+pp[i]

for i in range(n-k+1):
    ans=max(ans,t[i+k]-t[i])
print(ans)
Problem p02802 (python)

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

l=[0 for i in range(n)]
ll=[0 for i in range(n)]
w=0
a=0
for i in range(m):
    p,s=input().split()
    if(l[int(p)-1]==1):continue
    if(s=="WA"):ll[int(p)-1]+=1
    if(s=="AC"):
        l[int(p)-1]=1
        w+=ll[int(p)-1]
        a+=1
print(a,w)

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

l=[0 for i in range(n)]
t=""
w=0
ww=0
a=0
for i in range(m):
    p,s=input().split()
    if(l[int(p)-1]==1):continue
    if(s=="WA"):
        w+=1
        ww+=1
    if(s=="AC"):
        ww=0
        a+=1
        l[int(p-1)]=1
print(a,w-ww)
Problem p03161 (python)

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

dp=[int(10e8)]*n
dp[0]=0
for i in range(1,n):
    for j in range(min(i,k)):
        dp[i]=min(dp[i],dp[i-j-1]+abs(h[i]-h[i-j-1]))

print(dp[n-1])

Buggy submission (verdict: Runtime Error):
import numpy as np
n,k=map(int,input().split())
h=list(map(int,input().split()))

# dp=[int(10e8)]*n
dp[0]=0
for i in range(1,n):
    for j in range(min(i,k)):
        dp[i]=min(dp[i],dp[i-j-1]+abs(h[i]-h[i-j-1]))

print(dp[n-1])
Problem p02684 (python)

Fixed submission:
N, K = map(int, input().split())
A = input().split()
A_MAP = {}
for i in range(N):
    A_MAP[str(i+1)] = A[i]

route_hash = {'1': 0}
current_pos = '1'
next_pos = ''
counter = 0
breaked = False
while counter < K:
    next_pos = A_MAP[current_pos]
    counter+=1
    if next_pos in route_hash:
        breaked = True
        break
    route_hash[next_pos] = counter # たどり着くまでにかかった回数
    current_pos = next_pos

if not breaked:
    print(current_pos)
    exit()

remain = K - counter
counter -= route_hash[next_pos]
remain = remain % counter

current_pos = next_pos
for i in range(remain):
    next_pos = A_MAP[current_pos]
    route_hash[next_pos] = counter # たどり着くまでにかかった回数
    current_pos = next_pos
print(current_pos)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = input().split()
A_MAP = {}
for i in range(N):
    A_MAP[str(i+1)] = A[i]

route_hash = {'1': 0}
current_pos = '1'
next_pos = ''
counter = 0
while counter <= K:
    next_pos = A_MAP[current_pos]
    counter+=1
    if next_pos in route_hash:
        break
    route_hash[next_pos] = counter # たどり着くまでにかかった回数
    current_pos = next_pos

remain = K - counter
counter -= route_hash[next_pos]
remain = remain % counter

current_pos = next_pos
for i in range(remain):
    next_pos = A_MAP[current_pos]
    route_hash[next_pos] = counter # たどり着くまでにかかった回数
    current_pos = next_pos
print(current_pos)
Problem p02730 (python)

Fixed submission:
def isKaibun(str):
    for i in range(len(str)):
        if str[i] != str[len(str)-i-1]:
            return False
    return True

s = input()

if not isKaibun(s):
    print("No")
elif not isKaibun(s[0:int((len(s) - 1) / 2)]):
    print("No")
elif not isKaibun(s[int((len(s) + 3) / 2)-1:len(s)]):
    print("No")
else:
    print("Yes")

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

for i in range(len(a)):
    n = n - int(a[i])

if n >= 0:
    print(n)
else:
    print(-1)

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

def check(text):
    n = len(text)
    if n == 1:
        return True

    left = int((n-1)/2)
    right = int((n+3)/2 - 1)

    print(text[0:left], text[right:n])
    if len(text[0:left]) == len(text[right:n]):
        if text[0:left] == text[right:n] and check(text[0:left]):
            return True
    else:
        if text[0:left] == text[right+1:n] and check(text[0:left]):
            return True
    return False

if check(s):
    print("Yes")
else:
    print("No")

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

def check(text):
    n = len(text)
    if n == 1:
        return True

    left = int((n-1)/2)
    right = int((n+3)/2 - 1)

    print(text[0:left], text[right:n])
    if len(text[0:left]) == len(text[right:n]):
        if text[0:left] == text[right:n] and check(text[0:left]):
            return True
    else:
        if text[0:left] == text[right+1:n] and check(text[0:left]):
            return True
    return False

if check(s):
    print("Yes")
else:
    print("No")
Problem p03320 (python)

Fixed submission:
A = []
p = 10**18
for i in range(15,2,-1):
  l = max(0,10**(i-3) - 1)
  m = 10**(i-3)
  for j in range(999,9,-1):
    c = l+m*j
    s = c/sum(map(int,str(c)))
    if s-p <= 1e-7:
      A.append(c)
      p = s

for i in range(9,0,-1):A.append(10*i+9)
for i in range(9,0,-1):A.append(i)
A = A[::-1]
A = list(set(A))
A.sort() 


X = int(input())
for i in range(X):print(A[i])

Buggy submission (verdict: Runtime Error):
A = []
p = 10**18
for i in range(18,1,-1):
  l = max(0,10**(i-2) - 1)
  m = 10**(i-2)
  for j in range(99,0,-1):
    c = l+m*j
    s = c/sum(map(int,str(c)))
    if s <= p:
      A.append(c)
      p = s

A = A[::-1]
X = int(input())
for i in range(X):print(A[i])
Problem p03389 (python)

Fixed submission:
tin = [int(i) for i in input().split(' ') ]
A,B,C = tin[0],tin[1],tin[2]
if (A+B+C - max(A,B,C)) % 2 == 0:
  print(int((3*max(A,B,C) - A - B - C)/2))
else:
  print( int( (3*max(A,B,C) - A - B - C - 1)/2 + 2 ) )

Buggy submission (verdict: Runtime Error):
in = [int(i) for i in input().split(' ')]
A,B,C = in[0],in[1],in[2]
if (A+B+C - max(A,B,C)) % 2 == 0:
  print((3*max(A,B,C) - A - B - C)/2)
else:
  print((3*max(A,B,C) - A - B - C - 1)/2) + 2
Problem p02621 (python)

Fixed submission:
a = int(input())

print(a + a*a + a*a*a)

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

print(a + a*a + a*a*a)
Problem p02641 (python)

Fixed submission:
x, n = map(int, input().split())
p = list(map(int, input().split()))
for i in range(101):
    if x-i not in p:
        print(x-i)
        exit()
    elif x+i not in p:
        print(x+i)
        exit()

Buggy submission (verdict: Runtime Error):
x, n = map(int, input().split())
minn = 10000000
if n == 0:
    print(x)
    exit()
p = list(map(int, input().split()))
for i in range(1, 101):
    if i not in p:
        tmp = abs(x-i)  
        if minn > tmp:
            ans = i
            minn = tmp
        elif minn == tmp:
            ans = min(i, ans)

print(ans)

Buggy submission (verdict: Runtime Error):
x, n = map(int, input().split())
minn = 10000000
if n == 0:
    print(x)
    exit()
p = list(map(int, input().split()))
for i in range(1, 101):
    if i not in p:
        tmp = abs(x-i)
        if minn > tmp:
            ans = i
            minn = tmp
        elif minn == tmp:
            ans = min(i, ans)

print(ans)

Buggy submission (verdict: Runtime Error):
x, n = map(int, input().split())
minn = 10000000
if n == 0:
    print(x)
    exit()
p = list(map(int, input().split()))

for i in range(1, 101):
    if not i in p:
        tmp = abs(x-i)
        if minn > tmp:
            ans = i
            minn = tmp
        elif minn == tmp:
            ans = min(i, ans)

print(ans)

Buggy submission (verdict: Runtime Error):
x, n = map(int, input().split())
minn = 10000000
if n == 0:
    print(x)
    exit()
p = list(map(int, input().split()))

for i in range(1, 101):
    if not i in p:
        tmp = abs(x-i)
        if minn > tmp:
            ans = i
            minn = tmp
        elif minn == tmp:
            ans = min(i, ans)

print(ans)
Problem p02658 (python)

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

if 0 in a:
    print(0)
    exit()
 
for i in range(n):
    ans = ans * a[i]
    if ans>10**18:
        print(-1)
        exit()
print(ans)

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

if a.index(0):
    print(0)
    exit()
 
for i in range(n):
    ans *= a[i]
    if ans>10**18:
        print(-1)
        exit()
print(ans)
Problem p02705 (python)

Fixed submission:
r = int(input())
print(float(2*r*3.14))

Buggy submission (verdict: Runtime Error):
print(float(2*r*3.14))
Problem p02755 (python)

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
A,B = map(int,read().split())
 
def test(n):
    x = n * 8 // 100
    y = n * 10 // 100
    return (x == A) and (y == B)
 
answer = -1
for n in range(20000):
    if test(n):
        answer = n
        break
print(answer)

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
A, B = map(int,read().split())

def test(n):
    x = n * 8 // 100
    y = n * 10 // 100
    return (x == A) and (y == B)

answer = -1
for n in range(20000):
    if test(n):
        ans = n
        break
print(ans)

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

def test(n):
    x = n * 8 // 100
    y = n * 10 // 100
    return (x == A) and (y == B)

answer = -1
for n in range(20000):
    if test(n):
        ans = n
        break
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
a, b = map(int,read().split())

def test(n):
    x = n * 8 // 100
    y = n * 10 // 100
    return (x==a) and (y==b)

answer = -1
for n in range(20000):
    if test(n):
        ans = n
        break
print(ans)

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

def test(n):
    x = n * 8 // 100
    y = n * 10 // 100
    return (x==a) and (y==b)

answer = -1
for n in range(20000):
    if test(n):
        ans = n
        break
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
a, b = map(int,read().split())

def test(n):
    x = n * 8 // 100
    y = n * 10 // 100
    return (x==a) and (y==b)

answer = -1
for n in range(int(20000)):
    if test(n):
        ans = n
        break
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
a, b = map(int,read().split())

def test(n):
    x = n * 8 // 100
    y = n * 10 // 100
    return (x==a) and (y==b)

answer = -1
for n in range(int(2e+4)):
    if test(n):
        ans = n
        break
print(ans)

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

def test(n):
    x = n * 8 // 100
    y = n * 10 // 100
    return (x==a) and (y==b)

answer = -1
for n in range(int(2e+4)):
    if test(n):
        ans = n
        break
print(ans)

Buggy submission (verdict: Runtime Error):
def test(n):
    x = n * 8 // 100
    y = n * 10 // 100
    return (x==a) & (y==b)

if __name__ == "__main__":
    answer = -1
    a, b = map(int, input().split())
    for n in range(int(2e+4)):
        if test(n):
            ans = n
            break
    print(ans)
Problem p02761 (python)

Fixed submission:
def solve(n, m):
    ans = [-1] * n
    for _ in range(m):
        s, c = input().split()
        s = int(s) - 1
        if ans[s] == c:
            continue
        elif ans[s] == -1:
            ans[s] = c
        else:
            return -1
 
    if ans[0] == '0':
        if n == 1:
            return '0'
        else:
            return -1
    elif ans[0] == -1:
        if n == 1:
            return '0'
        else:
            ans[0] = '1'
    for i in range(1, n):
        if ans[i] == -1:
            ans[i] = '0'
    return ''.join(ans)
 
 
n, m = list(map(int, input().split()))
print(solve(n, m))

Buggy submission (verdict: Runtime Error):
def solve(n, m):
    ans = [-1]*n
    for _ in range(m):
        s, c = map(int, input().split())
        s = s-1
        if ans[s] == c:
            continue
        elif ans[s] == -1:
            ans[s] = c
        else:
            return -1

    if ans[0] == '0':
        if n == 1:
            return '0'
        else:
            ans[0] = '1'
    for i in range(1, n):
        if ans[i] == -1:
            ans[i] = '0'
    return ''.join(ans)

n, m = map(int, input().split())
print(solve(n, m))

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

for _ in range(m):
    s, c = map(int, input().split())
    if ans[s-1] == 0:
        ans[s-1] = c
    else:
        if not ans[s-1] == c:
            print(-1)
            exit()
tmp = set(ans)
tmp.remove(0)
if n == 1 and m == 0:
    print(0)
elif not tmp:
    print(-1)
else:
    print(*ans, sep='')
Problem p02791 (python)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
ans = 0
min = p[0]

for i in range(len(p)):
    if p[i]<=min:
        min = p[i]
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))
count = 0
tmp = p[0]

for i in range(len(p)):
    target = p[i]
    flag = True
    if tmp < target:
        tmp = target
        continue
    for j in range(i):
        ccount += 1
        if p[i] > p[j]:
            flag = False
            break
    if flag:
        count += 1

print(count)
Problem p02947 (python)

Fixed submission:
from collections import Counter
from math import factorial
n = int(input())
s = [''.join(sorted(list(input()))) for _ in range(n)]

def combination(i):
    return factorial(i) // (factorial(i-2) * factorial(2))

cnt = Counter(s)
ans = 0
for i in cnt.values():
    if i == 1:
        pass
    else:
        ans += combination(i)
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
from math import factorial
n = int(input())
s = [''.join(sorted(list(input()))) for _ in range(n)]

def combination(i):
    return factorial(i) // (factorial(i-2) * factorial(2))

cnt = Counter(s)
print(cnt)
ans = 0
for i in cnt.values():
    print(i)
    ans += combination(i)

print(ans)
Problem p02983 (python)

Fixed submission:
l, r = map(int, input().split())
res = 2018

if r-l > 2018:
    print(0)
    exit()
else:
    for i in range(l, r):
        for j in range(i+1, r+1):
            res = min(res, (i*j)%2019)
print(res)

Buggy submission (verdict: Runtime Error):
l, r = map(int, input().split())
ans = 2018

if r-l > 2018:
    print(0)
    eixt()
else:
    for i in range(l, r):
        for j in range(i+1, r+1):
            ans = min(ans, (i*j)%2019)
    print(ans)

Buggy submission (verdict: Runtime Error):
l, r = map(int, input().split())
res = 2018

if r-l > 2018:
    print(0)
    eixt()
else:
    for i in range(l, r):
        for j in range(i+1, r+1):
            res = min(res, (i*j)%2019)
print(res)
Problem p02921 (python)

Fixed submission:
a=input()
b=input()

cnt=0

for i, j in zip(a, b):
  if i==j:
    cnt+=1
    
print(cnt)

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

cnt = 0
p = 1

while p < b:
    p += a - 1
    cnt += 1
    
print(cnt)
Problem p02640 (python)

Fixed submission:
X, Y = map(int, input().split())
if Y % 2 == 1:
    print("No")
else:
    k = Y/2
    q = Y/4
    if q <= X and X <= k:
        print("Yes")
    else:
        print("No")

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split())
k = Y/2
q = y/4
if q<=X and X <= k:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split())
k = Y/2
q = y/4
if q<=X and X <= k:
    print("Yes")
else:
    print("No")
Problem p02658 (python)

Fixed submission:
#import numpy as np
N = int(input())
A = list(map(int, input().split()))
#A = np.array(A)
t = A[0]
for i in range(1,N):
    t *= A[i]
    if int(t) > 1e18:
        for j in range(i,N):
            if A[j] == 0:
                t = 0
        break
if int(t) <= 1e18:
    print(int(t))
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = list(map(int, input().split()))
if t > 1e18:
    print(-1)
else:
    print(np.prod(A))
Problem p02677 (python)

Fixed submission:
import numpy as np
import math
A, B, H, M = map(int, input().split())
thetaB = 6 * M
thetaA = 0.5 * (60 * H + M)
Ax = math.sin(math.radians(thetaA)) * A
Ay = math.cos(math.radians(thetaA)) * A
Bx = math.sin(math.radians(thetaB)) * B
By = math.cos(math.radians(thetaB)) * B
AA = np.array([Ax,Ay])
BB = np.array([Bx,By])
print(np.linalg.norm(AA-BB))

Buggy submission (verdict: Runtime Error):
a, b = map(float, input().split())
if a < 100000:
    print(int(int(a)*b))
else:
    num = str(int(int(a) * b))
    a = int(a)
    a = str(a)
    a = str(a[-6:])
    a = int(a)
    t = a * b
    t = int(t)
    t = str(t)
    t = "0000000" + t
    print(num[:-3] + t[-4:-1])
Problem p02761 (python)

Fixed submission:
N, M = map(int, input().split())
s = [-1]
c = [-1]
OK = True
x = 0
for i in range(M):
    s_, c_ = map(int, input().split())
    if N != 1 and s_ == 1 and c_ == 0:
        OK = False
    ok = True
    for i in range(len(s)):
        if s[i] == s_:
            ok = False
            if c[i] != c_:
                OK = False
                break
            break
    if ok:
        s.append(s_)
        c.append(c_)
        x += (10 ** (N - s_)) * c_

if N != 1 and x < 10 ** (N - 1):
    x += 10 ** (N - 1)

if OK:
    print(x)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
vN, M = map(int, input().split())
s = [-1]
c = [-1]
OK = True
x = 0
for i in range(M):
    s_, c_ = map(int, input().split())
    if N != 1 and s_ == 1 and c_ == 0:
        OK = False
    ok = True
    for i in range(len(s)):
        if s[i] == s_:
            ok = False
            if c[i] != c_:
                OK = False
                break
            break
    if ok:
        s.append(s_)
        c.append(c_)
        x += (10 ** (N - s_)) * c_

if N != 1 and x < 10 ** (N - 1):
    x += 10 ** (N - 1)

if OK:
    print(x)
else:
    print(-1)
Problem p02945 (python)

Fixed submission:
import numpy as np

a, b = map(int, input().split())
print(np.max([a + b, a - b, a * b]))

Buggy submission (verdict: Runtime Error):
def f(si, sj):
    for i in range(10):
        if si.count(sj[i]) != sj.count(sj[i]):
            return 0
    return 1
n = int(input())
s = [input() for i in range(n)]
x = 0
for i in range(n - 1):
    for j in range(i + 1, n):
        x = x + f(s[i], s[j])
print(x)
Problem p02658 (python)

Fixed submission:
from sys import stdin

nn = input()

N=int(nn)

arr=list(map(int,input().split()))


if 0 in arr:
    print(0)
    exit()

res=1
for i in arr:
    res*=i
    if res>1000000000000000000:
        print(-1)
        exit();

print(res)

Buggy submission (verdict: Runtime Error):
from sys import stdin

nn = input()

N=int(nn)

arr=list(map(int,input().split()))


if 0 in arr:
    print(0)
    exit()

res=1
for i in arr:
    res*=i
    if res>1000000000000000000:
        print(-1)
        exit();

print(res)
Problem p02657 (python)

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

print(A*B)

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

print(A*B)
Problem p03035 (python)

Fixed submission:
A,B = map(int,input().split())
 
if 13 <= A:
    print(B)
elif 6 <= A:
    print(int(B/2))
else :
    print(0)

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

if 13 <= A:
    print(B)
elif 6 <= A:
    print(int(B/2))
else :
    print(0
Problem p03043 (python)

Fixed submission:
import math
N,K = map(int,input().split())


print('{:.12f}'.format(sum([(1/N)*(0.5)**math.ceil(math.log2(math.ceil(K/i))) if i<K else 1/N for i in range(1,N+1)])))

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


print(sum([(1/N)*(0.5)**math.ceil(math.log2(math.ceil(K/i))) if i<K else 1/N for i in range(1,N+1)])

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


print(sum([(1/N)*(0.5)**math.ceil(math.log2(max(K//i,1))) for i in range(1,N+1)])

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


print(sum([(1/N)*(0.5)**math.ceil(math.log2(max(K//i,1))) for i in range(1,N+1)])
Problem p02727 (python)

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

P.sort(reverse=True)
Q.sort(reverse=True)
R.sort(reverse=True)

S = P[:X] + Q[:Y]
S.sort(reverse=True)

S_wa = []
wa = 0
for s in S[::-1]:
    wa += s
    S_wa.append(wa)
# print(S_wa)
big = S_wa[-1]
ans = S_wa[-1]

R_wa = []
wa = 0
for r in R:
    wa += r
    R_wa.append(wa)
# print(R_wa)

kazu = min(len(R_wa), len(S_wa))

for i in range(kazu):
    ans = max(ans, big + R_wa[i] - S_wa[i])
print(ans)

Buggy submission (verdict: Runtime Error):
X, Y, A, B, C = map(int, input().split())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))
R = list(map(int, input().split()))

P.sort(reverse=True)
Q.sort(reverse=True)
R.sort(reverse=True)

S = P[:X] + Q[:Y]
S.sort(reverse=True)

S_wa = []
wa = 0
for s in S[::-1]:
    wa += s
    S_wa.append(wa)
# print(S_wa)
big = S_wa[-1]
ans = S_wa[-1]

R_wa = []
wa = 0
for r in R:
    wa += r
    R_wa.append(wa)
# print(R_wa)

for i in range(len(R_wa)):
    ans = max(ans, big + R_wa[i] - S_wa[i])
print(ans)

Buggy submission (verdict: Runtime Error):
X, Y, A, B, C = map(int, input().split())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))
R = list(map(int, input().split()))

P.sort(reverse=True)
Q.sort(reverse=True)
R.sort(reverse=True)

S = P[:X] + Q[:Y]
# print(S)

S_wa = []
wa = 0
for s in S[::-1]:
    wa += s
    S_wa.append(wa)
# print(S_wa)
big = S_wa[-1]
ans = S_wa[-1]

R_wa = []
wa = 0
for r in R:
    wa += r
    R_wa.append(wa)
# print(R_wa)

for i in range(len(R_wa)):
    ans = max(ans, big + R_wa[i] - S_wa[i])
print(ans)