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

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

dp = [float('inf') for _ in range(N)]
dp[0] = 0

for i in range(N):
    if i - 1 >= 0:
        if dp[i - 1] + abs(h[i] - h[i - 1]) < dp[i]:
            dp[i] = dp[i - 1] + abs(h[i] - h[i - 1])
    if i - 2 >= 0:
        if dp[i - 2] + abs(h[i] - h[i - 2]) < dp[i]:
            dp[i] = dp[i - 2] + abs(h[i] - h[i - 2])
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10000)


N = int(input())
h = list(map(int, input().split()))
dp = [float('inf')] * N
dp[0] = 0


def rec(i):

    if dp[i] < float('inf'):
        return dp[i]

    a = rec(i-1) + abs(h[i] - h[i-1])
    if i > 1:
        a = min(a, rec(i-2) + abs(h[i] - h[i-2]))

    dp[i] = a
    return a


print(rec(N-1))

Buggy submission (verdict: Runtime Error):
N = int(input())
h = list(map(int, input().split()))
dp = [float('inf')] * N
dp[0] = 0


def rec(i):

    if dp[i] < float('inf'):
        return dp[i]

    a = rec(i-1) + abs(h[i] - h[i-1])
    if i > 1:
        a = min(a, rec(i-2) + abs(h[i] - h[i-2]))

    dp[i] = a
    return a


print(rec(N-1))
Problem p03161 (python)

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

dp = [float('inf') for _ in range(N)]
dp[0] = 0

for i in range(N):
    for j in range(1, K+1):
        if i - j >= 0:
            if dp[i - j] + abs(h[i] - h[i - j]) < dp[i]:
                dp[i] = dp[i - j] + abs(h[i] - h[i - j])
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
import sys


N, K = map(int, input().split())
h = list(map(int, input().split()))

sys.setrecursionlimit(N+2)
dp = [float('inf')] * N
dp[0] = 0


def rec(i):

    if dp[i] < float('inf'):
        return dp[i]

    res = float('inf')
    for j in range(1, K+1):
        if i >= j:
            res = min(res, rec(i - j) + abs(h[i] - h[i - j]))

    dp[i] = res
    return res


print(rec(N-1))
Problem p02608 (python)

Fixed submission:
#C
N = int(input())

count = [0] * 10050
for j in range(1, 105):
    for k in range(1, 105):
        for l in range(1, 105):
            v = (j+k+l) ** 2 - (j*k + k*l + l*j)
            if v < 10050:
                count[v] += 1

for i in range(1, N+1):
    print(count[i])

Buggy submission (verdict: Runtime Error):
#C
N = int(input())

count = [0] * 10000
for j in range(1, 100):
    for k in range(1, 100):
        for l in range(1, 100):
            v = (j+k+l) ** 2 - (j*k + k*l + l*j)
            if v <= 10000:
                count[v] += 1

for i in range(1, N+1):
    print(count[i])

Buggy submission (verdict: Runtime Error):
#C
import math

N = int(input())


count = [0] * 10050
for j in range(1, 105):
    for k in range(1, 105):
        for l in range(1, 105):
            v = (j+k+l) ** 2 - (j*k + k*l + l*j)
            if v <= 10050:
                count[v] += 1

for i in range(1, N):
    print(count[i])
Problem p02687 (python)

Fixed submission:
#A
s = input()

if s == 'ABC':
    print('ARC')
else:
    print('ABC')

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

if s == ABC:
    print('ARC')
else:
    print('ABC')

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

if s == ABC:
    print('ARC')
else:
    print('ABC')
Problem p03086 (python)

Fixed submission:
S = input()

ACGT = 'ACGT'

count = []
tmp_num = 0
for i in S:
    if i in ACGT:
        tmp_num += 1
    elif i not in ACGT:
        count.append(tmp_num)
        tmp_num = 0
count.append(tmp_num)

print(max(count))

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

AGCT = 'AGCT'

count = []
tmp_num = 0
for i in S:
    if i in AGCT:
        tmp_num += 1
    else:
        count.append(tmp_num)
        tmp_num = 0

print(max(count))

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

str = []
ans = []

for i in range(len(s)):
    if s[i] in "ACGT":
        str.append(s[i])
    else:
        ans.append(len(str))
        str = []
print(max(ans))
print(ans)

Buggy submission (verdict: Runtime Error):
s = [i for i in input()]

str = []
ans = []

for i in s:
    if i in "ACGT":
        str.append(i)
    else:
        ans.append(len(str))
        str = []
print(max(ans))
Problem p03557 (python)

Fixed submission:
import bisect

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


a.sort()
b.sort()
c.sort()


result = 0
for i in range(n):
    b_bisect_in_a = bisect.bisect_left(a, b[i])
    b_bisect_in_c = bisect.bisect_right(c, b[i])
    result += b_bisect_in_a * (n - b_bisect_in_c)
        
        
print(result)

Buggy submission (verdict: Runtime Error):
import bisect

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


a.sort()
b.sort()
c.sort()


bi = bisect.bisect_right

result = 0
for i in range(n):
    a_bi_in_b = bi(b, a[i])
    b_bi_in_c = bi(c, b[a_bi_in_b])
    result += (n - a_bi_in_b) * (n - b_bi_in_c)
        
        
print(result)
Problem p02909 (python)

Fixed submission:
S = input()
weather = ['Sunny', 'Cloudy', 'Rainy']
if S == weather[0]:
    ans = weather[1]
elif S == weather[1]:
    ans = weather[2]
elif S == weather[2]:
    ans = weather[0]
print(ans)

Buggy submission (verdict: Runtime Error):
package main

import "fmt"

func main() {
	var S string
	fmt.Scan(&S)
	weather := []string{"Sunny","Cloudy","Rainy","Sunny"}
	for i, wthr := range weather{
		if S == wthr {
			fmt.Println(weather[i+1])
			return
		}
	}
}
Problem p02658 (python)

Fixed submission:
N = int(input())
An = list(map(int, input().split()))
sum = 1
max = 10 ** 18
if 0 in An:
  print(0)
  quit()
for i in range(N):
  sum *= An[i]
  if sum > max:
    print(-1)
    quit()
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
An = list(map(int, input().split()))
sum = 1
for i in range(N):
  sum *= An[i]
  if sum > 1e18:
    print(-1)
    quit()
  else sum == 0:
    print(0)
    quit()
print(sum)
Problem p02692 (python)

Fixed submission:
from sys import setrecursionlimit
setrecursionlimit(10 ** 6)

*I, = open(0).read().split()
N, A, B, C = map(int, I[:4])
S = I[4:]

Cnt = {"A": A, "B": B, "C": C}

ans = [""] * N
def dfs(i):
    if i == N:
        print("Yes")
        print("\n".join(ans))
        quit()

    for L, R in (S[i], reversed(S[i])):
        if Cnt[R] > 0:
            Cnt[L] += 1
            Cnt[R] -= 1

            ans[i] = L
            dfs(i + 1)

            Cnt[L] -= 1
            Cnt[R] += 1


dfs(0)
print("No")

Buggy submission (verdict: Runtime Error):
*I, = open(0).read().split()
N, A, B, C = map(int, I[:4])
S = I[4:]

Cnt = {"A": A, "B": B, "C": C}

ans = [""] * N
def dfs(i):
    if i == N:
        print("Yes")
        print("\n".join(ans))
        quit()

    for L, R in (S[i], reversed(S[i])):
        if Cnt[R] > 0:
            Cnt[L] += 1
            Cnt[R] -= 1

            ans[i] = L
            dfs(i + 1)

            Cnt[L] -= 1
            Cnt[R] += 1


dfs(0)
print("No")

Buggy submission (verdict: Runtime Error):
N, A, B, C = map(int, input().split())
SN = [input() for _ in range(N)]

ABC = {'A': A, 'B': B, 'C': C}
ans = [""] * N
# print('ABC : ' + str(ABC))

# Recursiveにすることによって、途中で負の値になってもいくらでも遡ることが可能となる
def recursive_exec(i):
  # 最後まで辿り着いたらクリア
  if i == N:
    print('Yes')
    print("\n".join(ans))
    quit()
  for L, R in (SN[i], reversed(SN[i])):	# ex) L, R in ('AB', 'BA')
    if ABC[L] > 0: # LでもRでもどちらでも良い
      ABC[L] -= 1
      ABC[R] += 1
      ans[i] = L

      # Next
      recursive_exec(i+1)

      # 0以下になったら戻して別の文字でやってみる (reversed(SN[i]))
      ABC[L] += 1
      ABC[R] -= 1

recursive_exec(0)
print('No')

Buggy submission (verdict: Runtime Error):
N, A, B, C = map(int, input().split())
SN = [input() for _ in range(N)]

ABC = {'A': A, 'B': B, 'C': C}
ans = [""] * N
# print('ABC : ' + str(ABC))

# Recursiveにすることによって、途中で負の値になってもいくらでも遡ることが可能となる
def recursive_exec(i):
  # 最後まで辿り着いたらクリア
  if i == N:
    print('OK')
    print("\n".join(ans))
    quit()
  for L, R in (SN[i], reversed(SN[i])):	# ex) L, R in ('AB', 'BA')
    if ABC[L] > 0: # LでもRでもどちらでも良い
      ABC[L] -= 1
      ABC[R] += 1
      ans[i] = L

      # Next
      recursive_exec(i+1)

      # 0以下になったら戻して別の文字でやってみる (reversed(SN[i]))
      ABC[L] += 1
      ABC[R] -= 1

recursive_exec(0)
print('NG')
Problem p03136 (python)

Fixed submission:
n = int(input())
x = list(map(int, input().split()))
 
longest = max(x)
x.remove(longest)
 
if longest < sum(x):
    print("Yes")
else:
    print("No")

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


longest = max(x)
x.remove(longest)

if longest < sum(x):
    print("Yes")
else:
    print("No")
Problem p02628 (python)

Fixed submission:
import sys
sys.setrecursionlimit(100000000)

N, K = map(int, input().split())
prices = list(map(int, input().split()))
INF = 10000000000

memo = {}

def minPrice(n, k):
    if (n, k) in memo:
        return memo[(n, k)]
    if n < k:
        return INF
    if k == 0:
        return 0
    take = prices[n-1] + minPrice(n-1, k-1)
    skip = minPrice(n-1, k)
    ans = min(INF, take, skip)
    memo[(n, k)] = ans
    return ans

print(minPrice(N, K))

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


INF = 10000000000

memo = {}

def minPrice(n, k):
    if (n, k) in memo:
        return memo[(n, k)]
    if n < k:
        return INF
    if k == 0:
        return 0
    if k == 1:
        return min(prices)
    take = prices[n-1] + minPrice(n-1, k-1)
    skip = minPrice(n-1, k)
    ans = min(INF, take, skip)
    memo[(n, k)] = ans
    return ans

print(minPrice(N, K))
Problem p02660 (python)

Fixed submission:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
n=int(input())
if n==1:
    ans=0
else:
    a=prime_factorize(n)
    if a==[]:
        ans=1
    else:
        ans=0
        xzen=a[0]
        count=1
        ans+=1
        for x in range(1,len(a)):
            if xzen==a[x]:
                count+=1
                if count==3 or count==6 or count==10 or count==15 or count==21 or count==28 or count==36:
                    ans+=1
            else:
                xzen=a[x]
                count=1
                ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
n=int(input())
if n==1:
    ans=0
else:
    a=prime_factorize(n)
    if a==[]:
        ans=1
    else:
        ans=0
        xzen=a[0]
        count=1
        ans+=1
        for x in range(1,len(a)):
            if xzen==a[x]:
                count+=1
                if count==3 or count==6 or count==10 or count==15 or count==21 or count==28 or or count==35:
                    ans+=1
            else:
                xzen=a[x]
                count=1
                ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
noso=[]
count=0
if n==1:
    count=0
elif sosu(n)==1:
        count=1
else:
    for x in range(2,int(n/2)+2):
        if x>n:
            break
        if x in noso:
            pass
        elif x<=10:
            xx=x
            while n%xx==0:
                noso.append(xx)
                count+=1
                n=n/xx
                xx=xx*x
        elif x>11:
            xx=x
            while n%xx==0:
                noso.append(xx)
                count+=1
                n=n/x
                xx=xx*x
print(count)
Problem p02663 (python)

Fixed submission:
h1,m1,h2,m2,k=map(int, input().split())
oki=h1*60+m1
ne=h2*60+m2
print(ne-oki-k)

Buggy submission (verdict: Runtime Error):
def aaaa():
    n=int(input())
    a=list(map(int, input().split()))
    ans=0
    if a[0]>0:
        return -1
    nezen=1
    hazen=0
    line=[]
    liha=[]
    line.append(nezen)
    liha.append(hazen)
    su=0
    su=sum(a[x] for x in range(len(a)))
    for x in range(1,n+1):
        if nezen<=0:
            return -1
        ha=a[x]
        su-=ha
        ne=min(nezen*2-ha,su)
        nezen=ne
        line.append(ne)
        liha.append(ha)
    line[n]=0
    for x in range(len(line)):
        ans+=line[x]+liha[x]
    return ans
print(aaaa())
Problem p02665 (python)

Fixed submission:
def aaaa():
    n=int(input())
    a=list(map(int, input().split()))
    ans=0
    if a[0]>0:
        if a[0]==1 and n==0:
            return 1
        else:
            return -1
        return -1
    nezen=1
    hazen=0
    line=[]
    liha=[]
    line.append(nezen)
    liha.append(hazen)
    su=0
    su=sum(a[x] for x in range(len(a)))
    for x in range(1,n+1):
        if nezen<=0:
            return -1
        ha=a[x]
        su-=ha
        ne=min(nezen*2-ha,su)
        nezen=ne
        line.append(ne)
        liha.append(ha)
    if line[n]<0:
        return -1
    line[n]=0
    for x in range(len(line)):
        ans+=line[x]+liha[x]
    return ans
print(aaaa())

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int, input().split()))
if a[0]>0:
    ans=-1
x=0
ans=1
nezen=1
suu=0
su=0
for x in a:
    su+=x
    suu+=x
for x in range(1,n):
    if nezen<0:
        ans=-1
        break
    ha=a[x]
    su-=ha
    ne=(min(su,nezen*2-ha))
    if ne<=0:
        ans=-1
        break
    ans+=ne
    nezen=ne
if ans!=-1:
    ans+=suu
    nezen=ne
    if ne<=0:
        ans=-1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int, input().split()))
if a[0]>0:
    ans=-1
x=0
ans=1
nezen=1
suu=0
su=0
for x in a:
    su+=x
    suu+=x
for x in range(1,n):
    if nezen<0:
        ans=-1
        break
    ha=a[x]
    su-=ha
    ne=(min(su,nezen*2-ha))
    ans+=ne
    nezen=ne
if ans!=-1:
    ans+=suu
    nezen=ne
    if ne<=0:
        ans=-1
print(ans)
Problem p02675 (python)

Fixed submission:
n=input()
n=n[-1]
if n=='3':
    print('bon')
if n=="0" or n=="1" or n=="6" or n=="8":
    print('pon')
if n=="2" or n=="4" or n=="5" or n=="7" or n=="9":
    print('hon')

Buggy submission (verdict: Runtime Error):
n=input()
n=n[-1]
print(n)
if n=='3':
    print('bon)
if n=="0" or n=="1" or n=="6" or n=="8":
    print('pon')
if n=="2" or n=="4" or n=="5" or n=="7" or n=="9":
    print('hon')

Buggy submission (verdict: Runtime Error):
n=input()
n=n[-1]
print(n)
if n=='3':
    print('bon)
if n=="0" or n=="1" or n=="6" or n=="8":
        print('pon')
if n=="2" or n=="4" or n=="5" or n=="7" or n=="9":
        print('hon')
Problem p02958 (python)

Fixed submission:
N = int(input())
numbers = input().split()

counter = 0

for i in range(N):
    if int(numbers[i]) != i+1:
        counter+=1
        
if counter <= 2:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
input1 = input()
 
row = input1.split('\n')

N = int(row[0])
numbers = row[1].split()

counter = 0

for i in range(N):
    if int(numbers[i]) != i+1:
        counter+=1
        
if counter <= 2:
    print('YES')
else:
    print('NO')
Problem p02612 (python)

Fixed submission:
n=int(input())
k=n%1000
if k!=0:
	print(1000-k)
else:
  print(k)

Buggy submission (verdict: Runtime Error):
n=int(input())
k=1000-n%1000
if k!=1000:
	print(k)
else:
  prnt(0)
Problem p02683 (python)

Fixed submission:
import numpy as np

n,m,x=map(int,input().split())
c=[]
a=[]
ans=10**8

for k in range(n):
  line=list(map(int,input().split()))
  c.append(line[0])
  a.append(line[1:])

a=np.array(a)


for i in range(2**n):
  level=np.zeros(m)
  price=0
  for j in range(n):
    if ((i>>j)&1):
      level+=a[j]
      price+=c[j]
  bottom=int(np.amin(level))
  if bottom>=x and price<ans:
    ans=price
if ans==10**8:
  print(-1)
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n,m,x=map(int,input().split())
c=[]
a=[]
ans=10**6
for x in range(n):
  line=list(map(int,input().split()))
  c.append(line[0])
  a.append(line[1:])
a=np.array(a)
for i in range(2**n):
  level=np.zeros(m)
  price=0
  for j in range(n):
    if ((i>>j)&1):
      level+=a[j]
      price+=c[j]
	for k in range(m):
      if np.amin(level)>=x and price<=ans:
        ans=price
if ans==10**6:
  print(-1)
else:
  print(ans)
Problem p02687 (python)

Fixed submission:
lw=input()
if lw=='ABC':
    print('ARC')
else:
    print('ABC')

Buggy submission (verdict: Runtime Error):
lw=input()
if lw='ABC':
    print('ARC')
else:
    print('ABC')
Problem p02678 (python)

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main():
    from collections import deque as d
    N, M = map(int, readline().split())
    m = map(int, read().split())
    AB = zip(m, m)
    graph = [[] for _ in range(N + 1)]
    for a, b in AB:
        graph[a].append(b)
        graph[b].append(a)
    que = d([1])
    ans = [0]*(N+1)
    while que:
        x = d.popleft(que)
        for i in graph[x]:
            if ans[i] != 0:
                continue
            ans[i] = x
            que.append(i)
    for a in ans[2:]:
        if a == 0:
            print('No')
            break
    else:
        print('Yes')
        print('\n'.join(map(str, ans[2:])))

    return

if __name__ == '__main__':
    main()

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

def main():
    from collections import deque as d
    N, M = map(int, readline().split())
    m = map(int, read().split())
    AB = zip(m, m)
    graph = [[] for _ in range(N + 1)]
    for a, b in AB:
        graph[a].append(b)
        graph[b].append(a)
    que = [1]
    stack = [1]
    ans = [0]*(N+1)
    while que:
        x = d.popleft(que)
        for i in graph[x]:
            if ans[x] == 0:
                ans[x] = x
            stack.append(i)
    for a in ans[2:]:
        if a == 0:
            print('No')
            break
    else:
        print('Yes')
        print('\n'.join(map(str, ans[2:])

    return

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

Fixed submission:
XYZ = input().split()
print(XYZ[2], XYZ[0], XYZ[1])

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
s = sum(A)
min = s / (4 * M)
cnt = 0
for a in A:
  if a >= min:
    cnt += 1
if M <= cnt:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
XYZ = map(int, input().split())
print(XYZ[2], XYZ[1], XYZ[0])
Problem p02724 (python)

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main():
    x = int(input())
    temp = (x // 500) * 1000
    x %= 500
    ans = temp + (x // 5) * 5
    print(ans)


    return

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
x = input()
temp = (x // 500) * 1000
x %= 500
ans = temp + (x // 5) * 5
print(ans)
Problem p02730 (python)

Fixed submission:
def kaibun(s):
  if s == s[::-1]:
    flg = True
  else:
    flg = False
  return flg

S = input()
N = len(S)
ans = 'Yes'
if kaibun(S):
  pass
else:
  ans = ('No')
if kaibun(S[:(N-1)//2]):
  pass
else:
  ans = ('No')
if kaibun(S[:(-(N-1)//2)-1:-1]):
  pass
else:
  ans = ('No')
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
N = len(S)
if S[:(N−1)/2] == S[N-((N−1)/2)::-1]:
  print('Yes')
else:
  print('No')
Problem p02789 (python)

Fixed submission:
N,M=input().split()
print('Yes' if N == M else 'No')

Buggy submission (verdict: Runtime Error):
import sys
readline = sys.stdin.buffer.readline
N=int(readline().strip())
n=[str(i) for i in range(1,N+1)]
cnt=0
for i in n:
  for j in n:
    if i[0]==j[-1] and i[-1]==j[0]:
      cnt+=1
print(cnt)
Problem p02811 (python)

Fixed submission:
from functools import lru_cache
import sys

sys.setrecursionlimit(10**8)

K, X = map(int, input().split())

@lru_cache(maxsize=None)
def dp(k,x):
    if k*500 < x:
        result = 'No'
    else:
        result = 'Yes'
    return result
print(dp(K,X))

Buggy submission (verdict: Runtime Error):
from functools import lru_cache
import sys

sys.setrecursionlimit(10**8)

N = int(input())
S = input()

@lru_cache(maxsize=None)
def dp(s):
    result = s.count("ABC")
    return result
print(dp(S))

Buggy submission (verdict: Runtime Error):
from functools import lru_cache
import sys

sys.setrecursionlimit(10**8)

N = int(input())
S = input()

@lru_cache(maxsize=None)
def dp(s):
    print(s.count("ABC"))
print(dp(S))
Problem p02898 (python)

Fixed submission:
N, K = map(int,input().split())
H = list(map(int,input().split()))
print(sum([h>=K for h in H]))

Buggy submission (verdict: Runtime Error):
N, K = map(int,input().split())
H = list(map(int,input().split()))
print(sum([h>=Kfor h in H]))
Problem p02921 (python)

Fixed submission:
import sys
read=sys.stdin.buffer.read
S,T=map(iter,read().split())
cnt=0
for s,t in zip(S,T):
  if s==t:
    cnt+=1
print(cnt)

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

Buggy submission (verdict: Runtime Error):
S,T=map(iter,input().split())
cnt=0
for s,t in zip(S,T):
  if s==t:
    cnt+=1
print(cnt)
Problem p02922 (python)

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

def main():
    A, B = map(int, read().split())
    print(-(-(B-1) // (A-1)))
    return

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
A,B=map(int,input()．split())
res=-(-B//A)
print(res)
Problem p02957 (python)

Fixed submission:
A, B = map(int, input().split())
C = A + B
if C %2 == 0:
  print(C//2)
else:
  print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
A, B = map(int, input())
C = A + B
if C %2 == 0:
  print(C//2)
else:
  print('IMPOSSIBLE')
Problem p02999 (python)

Fixed submission:
XA = list(map(int, input().split()))
if XA[0]<XA[1]:
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
XA = list(map(int, input().split()))
if XA[0]<XA[1]:
  print(0)
else:
  ptint(10)

Buggy submission (verdict: Runtime Error):
XA = map(int, input().split())
if XA[0]<XA[1]:
  print(0)
else:
  ptint(10)
Problem p03000 (python)

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main():
    N, X = list(map(int,readline().split()))
    L = map(int,readline().split())
    sum = 0
    cnt = 1
    for l in L:
        sum += l
        if sum <= X:
            cnt += 1
    print(cnt)

    return

if __name__ == '__main__':
    main()

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

def main():
    N, X = list(map(int,readline().split()))
    L = map(int,readline().split())
    sum = 0
    cnt = 1
    for n in N:
        sum += n
        if sum <= X:
            cnt += 1
    print(cnt)

    return

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

Fixed submission:
import sys 
from decimal import Decimal
readline = sys.stdin.buffer.readline
N,K = map(int, readline().split())
l = [2**i for i in range(18)]
ans = 0
for i in range(1,N+1):
  for j in l:
    if i*j < K:
      continue
    ans += 1/j
    break
print(ans/N)

Buggy submission (verdict: Runtime Error):
import sys 
readline = sys.stdin.buffer.readline
N,K = map(int, readline().split())
l = [2**i for i in range(1,15)]
ans = 0
for i in range(1,N+1):
  for j in 1:
    if i*j < K:
      continue
    else:
      ans += 1/N + 1/j 
      break
print(ans)
Problem p03280 (python)

Fixed submission:
x,y=map(int,input().split())
print((x-1)*(y-1))

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split()
print((x-1)*(y-1))