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

Fixed submission:
import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res


N,K=LI()
MP=[0] + LI()
LG = 10**15
DP=[[LG]*(N+1) for i in range(N-K+2)]

for i in range(1, N+1):
    DP[0][i] = 0
    DP[1][i] = MP[i]

for i in range(1, N-K):
    for j in range(1, N+1):
        for k in range(1, j):
            DP[i+1][j] = min(DP[i+1][j], DP[i][k] + max(0, MP[j] - MP[k]))

res = 10**15
for i in range(1, N+1):
    res = min(res, DP[N-K][i])
print(res)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res


N,K=LI()
MP=[0] + LI()
LG = 10**15
DP=[[LG]*(N+1) for i in range(N-K+1)]
DP[0][0] = 0

for i in range(1, N+1):
    DP[1][i] = MP[i]

for i in range(1, N-K):
    for j in range(1, N+1):
        for k in range(1, j):
            DP[i+1][j] = min(DP[i+1][j], DP[i][k] + max(0, MP[j] - MP[k]))

res = 10**15
for i in range(1, N+1):
    res = min(res, DP[N-K][i])
print(res)
Problem p02915 (python)

Fixed submission:
import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res
def gcd(x, y):
    if x < y: x, y = y, x
    div = x % y
    while div != 0:
        x, y = y, div
        div = x % y
    return y

print(II()**3)

Buggy submission (verdict: Runtime Error):
print(II()**3)
Problem p02955 (python)

Fixed submission:
import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res
def gcd(x, y):
    if x < y: x, y = y, x
    div = x % y
    while div != 0:
        x, y = y, div
        div = x % y
    return y

N,K=LI()
AS=LI()
SUMM= sum(AS)

DIVS=set()
for i in range(1,40000):
    if SUMM % i == 0:
        DIVS.add(i)
        DIVS.add(SUMM//i)
# DIVS.sort(reversed=True)
# print(DIVS)

DIFF=[0]*N
ACC=[0]*N

# res = 0

for div in sorted(DIVS, reverse=True):
    for i in range(N):
        DIFF[i] = AS[i]%div
    DIFF.sort()
    ACC[0] = DIFF[0]
    for i in range(1,N): ACC[i] = ACC[i-1] + DIFF[i]
    # print(ACC)
    for i in range(N-1):
        left = ACC[i]
        right = (N-1-i)*div-(ACC[N-1]-ACC[i])
        if left%div == right%div:
            if max(left, right) <= K:
                # print(max(left, right))
                print(div)
                exit()


# print(DIFF)
# print(res)

Buggy submission (verdict: Runtime Error):
import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res
def gcd(x, y):
    if x < y: x, y = y, x
    div = x % y
    while div != 0:
        x, y = y, div
        div = x % y
    return y

N,K=LI()
AS=LI()
SUMM= sum(AS)

DIVS=set()
for i in range(1,40000):
    if SUMM % i == 0:
        DIVS.add(i)
        DIVS.add(SUMM//i)
# DIVS.sort(reversed=True)
# print(DIVS)

DIFF=[0]*N
ACC=[0]*N

# res = 0

for x in devisor:
  b = [a[i]%x for i in range(n)]
  b.sort()
  sumb = list(accumulate(b))
  for y in range(n-1):
    bf = sumb[y]
    bl = sumb[n-1]-sumb[y]
    if bf%x == (x-(bl%x))%x:
      if k>=max(bf,(n-1-y)*x-bl):
        print(x)
        exit()
      else:
        continue

for div in sorted(DIVS, reverse=True):
    for i in range(N):
        DIFF[i] = AS[i]%div
    DIFF.sort()
    ACC[0] = DIFF[0]
    for i in range(1,N): ACC[i] = ACC[i-1] + DIFF[i]
    # print(ACC)
    for i in range(N-1):
        left = ACC[i]
        right = (N-1-i)*div-(ACC[N-1]-ACC[i])
        if left%div == right%div:
            if max(left, right) <= K:
                # print(max(left, right))
                print(div)
                exit()


# print(DIFF)
# print(res)
Problem p03017 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
MOD = 1000000007
def POW(x, y): return pow(x, y, MOD)
def INV(x, m=MOD): return pow(x, m - 2, m)
def DIV(x, y, m=MOD): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())
def SI(): return input()

N,A,B,C,D=LI()
st=input()

if C < D:
    if st[A:C].find('##') >= 0 or st[B:D].find('##') >= 0:
        print('No')
    else:
        print('Yes')
else:
    # Cの方がおおきいケース 入れ替わる
    if st.find('##', A-1, C) >= 0:
        print('No')
    else:
        fnd = st.find('...', B-2, D+1)
        if fnd >= 0:
            print('Yes')
        else:
            print('No')

Buggy submission (verdict: Runtime Error):

if C < D:
    if st[A:C].find('##') >= 0 or st[B:D].find('##') >= 0:
        print('No')
    else:
        print('Yes')
else:
    # Cの方がおおきいケース 入れ替わる
    if st[A:C].find('##') >= 0:
        print('No')
    else:
        fnd = st.find('...', B-1, D+1)
        if fnd >= 0:
            print('Yes')
        else:
            print('No')
Problem p03045 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10000000)
N,K=map(int, input().split())

class UnionFindTree:
    def __init__(self, n):
        self.nodes = list(range(n+10))
    def find(self, x):
        if self.nodes[x] == x:
            return x
        parent = self.find(self.nodes[x])
        self.nodes[x] = parent
        return parent
    def unite(self, a, b):
        a = self.find(a)
        b = self.find(b)
        if a == b:
            return
        self.nodes[a] = self.nodes[b]
    def is_same(self, a, b):
        return self.find(a) == self.find(b)

uf = UnionFindTree(N)
for i in range(K):
    i,j,k=map(int, input().split())
    uf.unite(i,j)

st = set()
for i in range(1,N+1):
    par = uf.find(i)
    st.add(par)

print(len(st))

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

class UnionFindTree:
    def __init__(self, n):
        self.nodes = list(range(n+10))
    def find(self, x):
        if self.nodes[x] == x:
            return x
        parent = self.find(self.nodes[x])
        self.nodes[x] = parent
        return parent
    def unite(self, a, b):
        a = self.find(a)
        b = self.find(b)
        if a == b:
            return
        self.nodes[a] = self.nodes[b]
    def is_same(self, a, b):
        return self.find(a) == self.find(b)

uf = UnionFindTree(N)
for i in range(K):
    i,j,k=map(int, input().split())
    uf.unite(i,j)

st = set()
for i in range(1,N+1):
    par = uf.find(i)
    st.add(par)

print(len(st))

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

class UnionFindTree:
    def __init__(self, n):
        self.nodes = list(range(n+1))
    def find(self, x):
        if self.nodes[x] == x:
            return x
        parent = self.find(self.nodes[x])
        self.nodes[x] = parent
        return parent
    def unite(self, a, b):
        a = self.find(a)
        b = self.find(b)
        if a == b:
            return
        self.nodes[a] = self.nodes[b]
    def is_same(self, a, b):
        return self.find(a) == self.find(b)

uf = UnionFindTree(N)
for i in range(K):
    i,j,k=map(int, input().split())
    uf.unite(i,j)

st = set()
for i in range(1,N+1):
    par = uf.find(i)
    st.add(par)

print(len(st))
Problem p03055 (python)

Fixed submission:
import collections
N=int(input())
inarr=[[int(j) for j in input().split()] for i in range(N-1)]
nodes={}
if N == 1:
    print("First")
    exit()

for i,j in inarr:
    if not i in nodes: nodes[i] = [j]
    else: nodes[i].append(j)
    if not j in nodes: nodes[j] = [i]
    else: nodes[j].append(i)

visited = {1}
queue = collections.deque([[1, 0]])
while queue:
    i, d = queue.popleft()
    for node in nodes[i]:
        if not node in visited:
            visited.add(node)
            queue += [[node, d + 1]]

# print("i: {} d: {}".format(i,d))

visited = {i}
queue = collections.deque([[i, 0]])
while queue:
    i, d = queue.popleft()
    for node in nodes[i]:
        if not node in visited:
            visited.add(node)
            queue += [[node, d + 1]]

# print(list(map(str,nodes.values())))
# print("i: {} d: {}".format(i,d))
print('Second' if (d + 1) % 3 == 2 else 'First')

Buggy submission (verdict: Runtime Error):
import collections
N=int(input())
inarr=[[int(j) for j in input().split()] for i in range(N-1)]
nodes={}
class Node:
    def __init__(self, parent, children, value):
        self.parent = parent
        self.children = children
        self.value = value
    
    def __str__(self):
        return "NODE[v={},par={},chld={}]".format(self.value,self.parent.value if self.parent else "none",list(map(lambda x: x.value, self.children)))

for i,j in inarr:
    if not i in nodes:
        nodes[i] = Node(None, [], i)
        if not j in nodes:
            nodes[j] = Node(nodes[i], [], j)
            nodes[i].children.append(nodes[j])
        else:
            nodes[i].parent = nodes[j]
            nodes[j].children.append(nodes[i])
    else:
        if not j in nodes:
            nodes[j] = Node(nodes[i], [], j)
            nodes[i].children.append(nodes[j])
        else:
            if not nodes[i].parent:
                nodes[i].parent = nodes[j]
                nodes[j].children.append(nodes[i])
            elif not nodes[j].parent:
                nodes[j].parent = nodes[i]
                nodes[i].children.append(nodes[j])
            else:
                print("error")

visited = {1: True}
queue = collections.deque([[1, 0]])
while queue:
    i, d = queue.popleft()
    for node in nodes[i].children:
        if not node.value in visited:
            visited[node.value] = True
            queue += [[node.value, d + 1]]
    if nodes[i].parent and not nodes[i].parent.value in visited:
        visited[nodes[i].parent.value] = True
        queue += [[nodes[i].parent.value, d + 1]]

# print("i: {} d: {}".format(i,d))

visited = {i: True}
queue = collections.deque([[i, 0]])
while queue:
    i, d = queue.popleft()
    for node in nodes[i].children:
        if not node.value in visited:
            visited[node.value] = True
            queue += [[node.value, d + 1]]
    if nodes[i].parent and not nodes[i].parent.value in visited:
        visited[nodes[i].parent.value] = True
        queue += [[nodes[i].parent.value, d + 1]]

# print(list(map(str,nodes.values())))
# print("i: {} d: {}".format(i,d))
print('Second' if (d + 1) % 3 == 2 else 'First')
Problem p03242 (python)

Fixed submission:
for s in input():
    if s == '9': print('1', end='')
    else: print('9', end='')
print('')

Buggy submission (verdict: Runtime Error):
inp = [[int(x) for x in input().split()] for _ in range(int(input()))]
inpsum = sum(map(lambda ij: abs(ij[0]+ij[1]) % 2, inp))
if not (inpsum == len(inp) or inpsum == 0):
    print(-1)
    exit(0)

seeds = ([] if inpsum == len(inp) else [1]) + [1 << i for i in range(0, 32)]
# print(inp)

print(' '.join(map(str, reversed(seeds))))

for x, y in inp:
    for k in reversed(seeds):
        res = ''
        if abs(x) > abs(y):
            if x > 0:
                res = 'R'
                x -= k
            else:
                res = 'L'
                x += k
        else:
            if y > 0:
                res = 'U'
                y -= k
            else:
                res = 'D'
                y += k
        # print((x,y))
        print(res, end='')
    print('')
Problem p03272 (python)

Fixed submission:
i,j=map(int, input().split())
print(i-j+1)

Buggy submission (verdict: Runtime Error):
i,j=map(int, input())
print(i-j+1)
Problem p03634 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**7)
N=int(input())

NODES={}
for i in range(N-1):
    a,b,c=map(int,input().split())
    if not a in NODES: NODES[a] = []
    if not b in NODES: NODES[b] = []
    NODES[a].append((b, c))
    NODES[b].append((a, c))

Q,K=map(int,input().split())
MP=[-1]*(N+1)
MP[K]=0
def dfs(k):
    for i, c in NODES[k]:
        if MP[i] == -1:
            MP[i] = MP[k] + c
            dfs(i)

dfs(K)
# print(MP)
for l,r in [tuple(map(int,input().split())) for _ in range(Q)]:
    print(MP[l]+MP[r])

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

NODES={}
for i in range(N-1):
    a,b,c=map(int,input().split())
    if not a in NODES:
        NODES[a] = []
    if not b in NODES:
        NODES[b] = []
    NODES[a].append((b, c))
    NODES[b].append((a, c))

Q,K=map(int,input().split())
MP=[-1]*(N+1)
MP[K]=0
def dfs(k):
    for i, c in NODES[k]:
        if MP[i] == -1:
            MP[i] = MP[k] + c
            dfs(i)

dfs(K)
# print(MP)
for l,r in [tuple(map(int,input().split())) for _ in range(Q)]:
    print(MP[l]+MP[r])
Problem p02847 (python)

Fixed submission:
s = input()
if s == 'MON':
	print(6)
elif s == 'TUE':
	print(5)
elif s == 'WED':
	print(4)
elif s == 'THU':
	print(3)
elif s == 'FRI':
	print(2)
elif s == 'SAT':
	print(1)
else:
	print(7)

Buggy submission (verdict: Runtime Error):
def bin_search(l, r, x):
	if x > 1e9:
		return 1e9
	mid = (l+r)//2
	if r-l == 1:
		if a*r+ b*len(str(r)) <= x:
			return int(r)
		elif a*l+ b*len(str(l)) <= x:
			return int(l)
		else:
			return 0
	elif a*mid+b*len(str(mid)) > x:
		return bin_search(l, mid-1, x)
	else:
		return bin_search(mid+1, r, x)


a, b, x = map(int, input().split())
if a+b > x:
	print(0)
else:
	print(bin_search(1, 1e9, x))
Problem p02881 (python)

Fixed submission:
import math
from functools import reduce

def factors(n):    
    return set(reduce(list.__add__, 
                ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))

def prime(n1):
	for i in range(2, int(math.sqrt(n1))+1):
		if n1%i == 0:
			return False
	return True

n = int(input())
if prime(n):
	print(n - 1)
else:
	k = sorted(list(factors(n)))
	#print(k)
	if len(k) % 2 != 0:
		if k[len(k)//2]*k[len(k)//2] == n:
			print(2*k[len(k)//2] - 2)
		#else:

	else:
		s = k[len(k)//2 - 1] + k[len(k)//2]
		print(s - 2)

Buggy submission (verdict: Runtime Error):
def factors(n):    
    return set(reduce(list.__add__, 
                ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))

def prime(n1):
	for i in range(2, int(math.sqrt(n1))+1):
		if n1%i == 0:
			return False
	return True

n = int(input())
if prime(n):
	print(n - 1)
else:
	k = sorted(list(factors(n)))
	#print(k)
	if len(k) %2 != 0:
		if k[len(k)//2]*k[len(k)//2] == n:
			print(2*k[len(k)//2] - 2)
		#else:

	else:
		s = k[len(k)//2 - 1] + k[len(k)//2]
		print(s - 2)

Buggy submission (verdict: Runtime Error):
def factors(n):    
    return set(reduce(list.__add__, 
                ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))

def prime(n1):
	for i in range(2, n1//2):
		if n1%i == 0:
			return False
	return True

n = int(input())
if prime(n):
	print(n - 1)
else:
	k = sorted(list(factors(n)))
	#print(k)
	s = k[len(k)//2 - 1] + k[len(k)//2]
	print(s - 2)
Problem p02897 (python)

Fixed submission:
n = int(input())
if n % 2 == 0:
    print(str.format('{0:.9f}', (n//2)/n))
else:
    print(str.format('{0:.9f}', ((n//2)+1)/n))

Buggy submission (verdict: Runtime Error):
from functools import reduce


def factors(n):
    return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))


a1, b1 = map(int, input().split())
temp = factors(a1).intersection(factors(b1))
s = set(range(2, max(temp)))
li = []
while s:
    m = min(s)
    li.append(m)
    s -= set(range(m, max(temp) + 1, m))
c = 0
for i in temp:
    if i == 1:
        c += 1
    if i in li:
        c += 1
print(c)
Problem p02753 (python)

Fixed submission:
def Main(S):
    return 'No' if S == 'AAA' or S == 'BBB' else 'Yes'

def main():
    S = str(input())
    print(Main(S))

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def Main(S):
    return "Yes" if 'A' in S and 'B' in S else "No"
    
def main():
    S = str(input())
    print(Main(N))

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

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
wa = 0
for i in range(N):
    wa += B[A[i]-1]
    if(i > 0 and A[i]-A[i-1] == 1):
        wa += C[A[i-1]-1]
print(wa)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
wa = 0
prev = 0
for i in range(N):
    wa += B[A[i]-1]
    if(prev == A[i]-2):
        wa += C[i-2]
    prev = A[i]-1
print(wa)
Problem p02594 (python)

Fixed submission:
n = int(input())
if n >= 30:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = input()
if n >= 30:
  print("Yes")
else:
  print("No")
Problem p02594 (python)

Fixed submission:
x = int(input())

if x>=30:
    print("Yes")
else:
    print("No")

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

ans = n
for i in range(n+1):
    a = c[:i].count("W")
    b = c[i:].count("R")
    ans = min(ans,max(a,b))

print(ans)
Problem p02594 (python)

Fixed submission:
t = int(input())
print("Yes" if t >= 30 else "No")

Buggy submission (verdict: Runtime Error):
t = int(input)
print("Yes" if t >= 30 else "No")

Buggy submission (verdict: Runtime Error):
t = int(input())
print "Yes" if t >= 30 else "No"
Problem p02595 (python)

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

count = 0
for t in range(n):
  x,y = map(int, input().split(" "))
  if x*x + y*y <= d*d:
    count += 1

print(count)

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

count = 0
for t in range(n):
  x,y = map(int, input())
  if x*x + y*y <= d*d:
    count += 1

print(count)
Problem p02627 (python)

Fixed submission:
c = str(input())

if c.islower():
    print('a')
else:
    print('A')

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

if c.lowercase():
  print('a')
  else:
    print('A')

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

if c.lowercase():
  print 'a'
else:
  print 'A'
Problem p02880 (python)

Fixed submission:
import sys
n = int(input())
for i in range(1, 10):
    for l in range(1, 10):
        if n == i*l:
            print('Yes')
            sys.exit()
print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(1, 10):
    for l in range(1, 10):
        if n == i*l:
            print('Yes')
            sys.exit()
print('No')
Problem p03767 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
s = 0
for i in range(n):
    s += a[i * 2 + n]
print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a.sort()
s = 0
for i in range(n):
    s += a[i * 2 + n]
print(sum(s))
Problem p03775 (python)

Fixed submission:
n = int(input())
ans = len(str(n))
a = 0
while a**2 <= n:
    a += 1
    if n % a != 0:
        continue
    b = n // a
    cur = max(len(str(a)), len(str(b)))
    if ans > cur:
        ans = cur
print(ans)

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

def is_prime(n):
    for i in range(2, n + 1):
        if i * i > n:
            break
        if n % i == 0:
            return False
    return n != 1

def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n /= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table

sq = math.sqrt(n)
if sq.is_integer():
    ansInt = sq

if is_prime(n):
    ansInt = n
else:
    ansInt = prime_decomposition(n)
print(len(str(int(max(ansInt)))))
Problem p02594 (python)

Fixed submission:
x = int(input())
if x >= 30:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
x = input()
if(x >= 30):
  print('Yes')
  else:
        print('No')
Problem p02777 (python)

Fixed submission:
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()
if u == s:
  a -= 1
else:
  b -= 1
print(a, b)

Buggy submission (verdict: Runtime Error):
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()
if u == s:
  a -= 1
 else:
  b -= 1
 print(a, b)
Problem p02594 (python)

Fixed submission:
print('Yes') if (int(input())) >= 30 else print('No')

Buggy submission (verdict: Runtime Error):
if int(input()) > 30 print('Yes') else print('No')

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

def find_cost(s):
    counter, i, j = 0, 0, len(s)-1
    while i < j:
        while i < len(s) and s[i] != 'W':
                i += 1
        while j >= 0 and s[j] != 'R':
                j -= 1
        if i < j:
            s[i], s[j] = s[j], s[i]
            counter += 1
        i += 1
        j -= 1
    for i in range(0, len(s) - 2):
        if s[i] == 'W' and s[i + 1] == 'R':
            counter += 1
    print(counter)
s = list(s)
find_cost(s)
Problem p02623 (python)

Fixed submission:
N, M, K=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
a, b=[0], [0]
for i in range(N):
    a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])
ans, j=0, M
for i in range(N+1):
    if a[i]>K:
        break
    while b[j]>K-a[i]:
        j-=1
    ans=max(ans, i+j)
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
from decimal import *

input = sys.stdin.readline

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	N,M,K = inputMap()
	A = inputList()
	B = inputList()

	sumA = sum(A)
	sumB = sum(B)
	if sumA + sumB <= K:
		print(N+M)
		sys.exit()

		A.append(inf)
		B.append(inf)

	ans = 0
	times = 0

	while True:
		if times > K:
			break

		if A[0] < B[0]:
			times += A[0]
			A = A[1:]
		else:
			times += B[0]
			B = B[1:]
		#print(times)
		ans += 1

	print(ans-1)



#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
if __name__ == "__main__":
	main()