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

Fixed submission:
n,k = map(int,input().split())
d = [0]*k
A = [[0]*n]*k
l = set()
for i in range(k):
	d[i] = int(input())
	A[i] = list(map(int,input().split()))
for i in range(k):
	l = l.union(A[i])
if set(range(1,n+1)) == l:
	print(0)
else:
	print(len(set(range(1,n+1))-l))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
d = [0]*k
A = [[0]*k]*n
l = set()
for i in range(k):
	d[i] = int(input())
	A[i] = list(map(int,input().split()))
for i in range(k):
	l = l.union(A[i])
if set(range(1,n+1)) == l:
	print(0)
else:
	print(len(set(range(1,n+1))-l))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
d = [0]*k
A = [[0]*k]*n
l = set()
for i in range(k):
	d[i] = int(input())
	A[i] = list(map(int,input().split()))
for i in range(k):
	l = l.union(A[i])
print(len(set(range(1,n+1))-l))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
d = [0]*k
A = [[0]*k]*n
l = set(range(1,n+1))
for i in range(k):
	d[i] = int(input())
	A[i] = list(map(int,input().split()))
for i in range(k):
	if set(A[i]) == l:
		l = set()
		break
	l = l - set(A[i])
print(len(l))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
d = [0]*k
A = [[0]*k]*n
l = set(range(1,n+1))
for i in range(k):
	d[i] = int(input())
	A[i] = list(map(int,input().split()))
for i in range(k):
	l = l - set(A[i])
print(len(l))
Problem p02862 (python)

Fixed submission:
import math
x,y = map(int,input().split())
mod = pow(10,9)+7
if (2*x-y)% 3 != 0 or (2*y-x)% 3 != 0 or ((2 * y - x) / 3 < 0) or ((2 * x - y) / 3 < 0):
	print(0)
else:
	n = int((2 * y - x) / 3)
	m = int((2 * x - y) / 3)
	P = [1]*(n + m + 1)
	for i in range(1, n+m+1):
		P[i] = P[i-1]*i
		P[i] %= mod
	print((P[n+m]*pow(P[n],mod-2,mod)*pow(P[m],mod-2,mod)) % mod)

Buggy submission (verdict: Runtime Error):
import math
x,y = map(int,input().split())
mod = pow(10,9)+7
if (2*x-y)% 3 == 0 and (2*y-x)% 3 == 0:
	n = int((2 * y - x) / 3)
	m = int((2 * x - y) / 3)
	P = [1]*(n + m + 1)
	for i in range(1, n+m+1):
		P[i] = P[i-1]*i
		P[i] %= mod
	print((P[n+m]*pow(P[n],mod-2,mod)*pow(P[m],mod-2,mod)) % mod)
else:
	print(0)

Buggy submission (verdict: Runtime Error):
import math
x,y = map(int,input().split())
if (2*x-y)% 3 == 0 and (2*y-x)% 3 == 0:
	n = (2*y-x)/3
	m = (2*x-y)/3
	p = m/n
	print(int(pow(1+p,n)*pow(1+1/p,m)*math.sqrt((n+m)/(n*m))/math.sqrt(2*math.pi))%(pow(10,9)+7))
#	print(int(math.factorial(n+m)/(math.factorial(n)*math.factorial(m)))%(pow(10,9)+7))
else:
	print(0)

Buggy submission (verdict: Runtime Error):
import math
x,y = map(int,input().split())
if (2*x-y)% 3 == 0 and (2*y-x)% 3 == 0:
	n = (2*y-x)/3
	m = (2*x-y)/3
	print(int(math.factorial(n+m)/(math.factorial(n)*math.factorial(m)))%(pow(10,9)+7))
else:
	print(0)
Problem p03631 (python)

Fixed submission:
n = input()
if n[0] == n[2]:
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
if n[0] == n[2]:
	print('Yes')
else:
	print('No')
Problem p03634 (python)

Fixed submission:
import heapq

def dijkstra(s):
	hq = [(0, s)]
	heapq.heapify(hq) # リストを優先度付きキューに変換
	cost = [float('inf')] * n # 行ったことのないところはinf
	cost[s] = 0 # 開始地点は0
	while hq:
		c, v = heapq.heappop(hq)
		if c > cost[v]: # コストが現在のコストよりも高ければスルー
			continue
		for d, u in e[v]:
			tmp = d + cost[v]
			if tmp < cost[u]:
				cost[u] = tmp
				heapq.heappush(hq, (tmp, u))
	return cost

n = int(input())
e = [[] for _ in range(n)]
for _ in range(n-1):
	a,b,c = map(int,input().split())
	a,b = a-1, b-1
	e[a].append((c, b))
	e[b].append((c, a))
q,k = map(int,input().split())
l = dijkstra(k-1)
for _ in range(q):
	x,y = map(int,input().split())
	print(l[x-1] + l[y-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
 
def bellman_ford(s):
	d = [float('inf')]*10 # 各頂点への最小コスト
	d[s] = 0 # 自身への距離は0
	for i in range(10):
		update = False # 更新が行われたか
		for x, y, z in g:
			if d[y] > d[x] + z:
				d[y] = d[x] + z
				update = True
		if not update:
 			break
		# 負閉路が存在
		if i == 9:
			return -1
	return d

g = []
for _ in range(n-1):
	a,b,c = map(int,input().split())
	g.append([a-1,b-1,c])
	g.append([b-1,a-1,c])

q,k = map(int,input().split())
for i in range(q):
	x,y = map(int,input().split())
	print(bellman_ford(x-1)[k-1] + bellman_ford(k-1)[y-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
 
def bellman_ford(s):
	d = [float('inf')]*10 # 各頂点への最小コスト
	d[s] = 0 # 自身への距離は0
	for i in range(10):
		update = False # 更新が行われたか
		for x, y, z in g:
			if d[y] > d[x] + z:
				d[y] = d[x] + z
				update = True
		if not update:
 			break
		# 負閉路が存在
		if i == 9:
			return -1
	return d

g = []
for _ in range(n-1):
	a,b,c = map(int,input().split())
	g.append([a-1,b-1,c])
	g.append([b-1,a-1,c])

q,k = map(int,input().split())
for i in range(q):
	x,y = map(int,input().split())
	print(bellman_ford(x-1)[k-1] + bellman_ford(k-1)[y-1])
Problem p02659 (python)

Fixed submission:
a, b = map(str, input().split())
a = int(a)
b = int(b.replace('.', ''))
print(a*b//100)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = str(input())
b = int(B.replace(".",""))
print(A * b // 100)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = input()
b = int(B.replace(".",""))
print(A * b // 100)

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

C = B*100
print(A * C // 100)

Buggy submission (verdict: Runtime Error):
A, B = map(int,input().split())
print(math.floor(A*B))
Problem p02682 (python)

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

Buggy submission (verdict: Runtime Error):
A, B, C, K = map(int,input().split())
print(max(A*1*K + B*0*(K-A) + C*-1*(K-A-B)))
Problem p02712 (python)

Fixed submission:
N = int(input())

list = [i for i in range(1, N+1) if not (i % 3 == 0 or i % 5 ==0)]

print(sum(list))

Buggy submission (verdict: Runtime Error):
N = input(int())
for i in range(1, N+1):
    if i % 15 == 0:
        i = "FizzBuzz"
    elif i % 3 == 0:
        i = "Fizz"
    elif i % 5 == 0:
        i = "Buzz"
    else:
        i = i
        print(sum(i))
Problem p02729 (python)

Fixed submission:
import itertools

N,M = map(int,input().split())

if N == 1:
    c1 = 0
else:
    c1 = len(list(itertools.combinations(range(N), 2)))

if M == 1:
    c2 = 0
else:
    c2 = len(list(itertools.combinations(range(M), 2)))

c3 = c1 + c2
print(c3)

Buggy submission (verdict: Runtime Error):
import itertools

N,M = map(int,input().split())

if N == 1:
    c1 = 0
else:
    c1 = len(list(itertools.combinations(N, 2)))

if M == 1:
    c2 = 0
else:
    c2 = len(list(itertools.combinations(M, 2)))

c3 = c1 + c2
print(c3)

Buggy submission (verdict: Runtime Error):
from scipy.special import comb

N,M = map(int,input().split())

if N == 1:
    c1 = 0
else:
    c1 = comb(N, 2, exact = False)

if M == 1:
    c2 = 0
else:
    c2 = comb(M, 2, exact = False)

c3 = c1 + c2
print(c3)

Buggy submission (verdict: Runtime Error):
from scipy.special import comb

N,M = map(int,input().split())

if N == 1:
    c1 = 0
else:
    c1 = comb(N, 2, exact=True)

if M == 1:
    c2 = 0
else:
    c2 = comb(M, 2, exact=True)

c3 = c1 + c2
print(c3)

Buggy submission (verdict: Runtime Error):
import itertools

N,M = map(int,input().split())

if N == 1:
    c1 = 0
else:
    c1 = len(list(itertools.combinations(N, 2)))

if M == 1:
    c2 = 0
else:
    c2 = len(list(itertools.combinations(M, 2)))

c3 = c1 + c2
print(c3)

Buggy submission (verdict: Runtime Error):
from scipy import special

N,M = map(int,input().split())

if N == 1:
    c1 = 0
else:
    c1 = special.comb(N, 2)

if M == 1:
    c2 = 0
else:
    c2 = special.comb(M, 2)

c3 = c1 + c2
print(c3)

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

if N == 1:
    c1 = 0
else:
    c1 = N! / (2! * (N - 2)!)

if M == 1:
    c2 = 0
else:
    c2 = M! / (2! * (M - 2)!)

print(c1 + c2)
Problem p02819 (python)

Fixed submission:
N = int(input())

def prime_check(num):
    for i in range(2, num):
        if num % i == 0:
            return False
    return True

for x in range(N, 1000000):
    if prime_check(x):
        print(x)
        exit()

Buggy submission (verdict: Runtime Error):
from sympy import nextprime
import sympy
import isprime

X = int(input())

if isprime(X) = "True":
    print(X)

else:
    p = sympy.nextprime(X, 1)
    print(p)

Buggy submission (verdict: Runtime Error):
from sympy import nextprime

X = int(input())
p = sympy.nextprime(X, 1)

print(p)
Problem p02873 (python)

Fixed submission:
s = input()
n = len(s)
L=[0]
R=[0]
cnt = 0

for i in range(n):
    if s[i] == '<':
        cnt += 1
    else:
        cnt = 0
    L.append(cnt)
cnt = 0
s = s[::-1]
for i in range(n):
    if s[i]  == '>':
        cnt += 1
    else:
        cnt = 0
    R.append(cnt)

R = R[::-1]
ans = 0
for i in range(n+1):
    ans += max(R[i], L[i])

print(ans)

Buggy submission (verdict: Runtime Error):
s = list(input())
L = 0
R = 0
tmp = []
for i in range(len(s)):
    if s[i] == "<":
        L += 1
    if s[i] == ">":
        R += 1
    if i == len(s)-1:
        if L == 0 or R == 0:
            tmp.append(L)
            tmp.append(R)
            L = 0
            R = 0
            break
        elif L > R:
            tmp.append(L)
            tmp.append(R-1)
            L = 0
            R = 0
            break
        elif L < R:
            tmp.append(L-1)
            tmp.append(R)
            L = 0
            R = 0
            break
    if s[i] == ">" and s[i+1] == "<":
        if L == 0 or R == 0:
            tmp.append(L)
            tmp.append(R)
            L = 0
            R = 0
        elif L > R:
            tmp.append(L)
            tmp.append(R-1)
            L = 0
            R = 0
        elif L < R:
            tmp.append(L-1)
            tmp.append(R)
            L = 0
            R = 0
ans = 0
for i in range(len(tmp)):
    if tmp[i] % 2 == 0:
        ans += (tmp[i] * (tmp[i] + 1) // 2)
    else:
        ans += ((tmp[i] - 1) * ((tmp[i] - 1) + 1) // 2 + tmp[i])
print(ans)
Problem p02659 (python)

Fixed submission:
A, B = input().split()
AA = int(A)
# BB = int(float(B)*100)
BB = int(B.replace('.', ''))
print(AA*BB//100)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
B *= 100
print(A*B//100)
Problem p02661 (python)

Fixed submission:
N = int(input())

A,B = [], []
for i in range(N):
    a,b = map(int, input().split())
    A.append(a)
    B.append(b)

A.sort()
B.sort()

cnt = 0
if(N % 2 == 1):
    l = A[N//2]
    r = B[N//2]
    cnt = r - l + 1
else:
    l = A[N//2-1] + A[N//2]
    r = B[N//2-1] + B[N//2]
    cnt = r - l + 1
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
T = [0] * (10**6+10)

nax = 0
for i in range(N):
    A, B = map(int, input().split())
    T[A] += 1
    T[B+1] -= 1
    nax = max(nax, B)

for i in range(1, nax+1):
    T[i] += T[i-1]

cnt = 0
for i in range(nax-1):
    if T[i] > 0:
        cnt+=1
        if T[i+1] > 0:
            cnt += N-1
else:
    if T[nax-1] > 0:
        cnt += 1

print(cnt)
Problem p02735 (python)

Fixed submission:
def solve():
    h, w = map(int, input().split())
    s = [input() for _ in range(h)]
    INF = 10 ** 9
    dp = [[0]*(w+10) for _ in range(h+10)]
    dp[0][0] = 1 if s[0][0] == '#' else 0

    for i in range(h):
        for j in range(w):
            if not i==j==0:
                dp[i][j] = INF
            if i>0:
                dp[i][j] = min(dp[i][j], dp[i-1][j] + (1 if s[i-1][j]=='.' and s[i][j]=='#' else 0))
            if j>0:
                dp[i][j] = min(dp[i][j], dp[i][j-1] + (1 if s[i][j-1]=='.' and s[i][j]=='#' else 0))

    # for i in range(h):
    #     for j in range(w):
    #         print(dp[i][j], end=' ')
    #     print()
    print(dp[h-1][w-1])


solve()

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = [input() for i in range(h)]

# count min of color change cnt in the path
dp = [[0]*w for i in range(h)]
dp[0][0] = 1 if s[0][0] == '#' else 0
for i in range(w):
    for j in range(h):
        if i==j==0: continue
        a,b = h*w, h*w
        if i>0:
            a = dp[i-1][j] + (1 if s[i-1][j]!=s[i][j] else 0)
        if j>0:
            b = dp[i][j-1] + (1 if s[i][j-1]!=s[i][j] else 0)
        dp[i][j] = min(a,b)
if s[h-1][w-1] == '#':
    dp[h-1][w-1]+=1
print(int(dp[h-1][w-1]/2))
Problem p02831 (python)

Fixed submission:
from fractions import gcd

a, b = map(int, input().split())
t = gcd(a, b)
print(a // t * b)

Buggy submission (verdict: Runtime Error):
import math

a, b = map(int, input().split())
t = math.gcd(a, b)
print(a // t * b)
Problem p02862 (python)

Fixed submission:
X, Y = map(int, input().split())
mod = 10 ** 9 + 7
if (X + Y) % 3 != 0:
    print(0)
    exit()
    
n = (2 * Y - X) // 3
m = (2 * X - Y) // 3
if n < 0 or m < 0:
    print(0)
    exit()    

ans = 1
for i in range(1, n+1):
    ans *= (n+m+1-i) * pow(i, mod-2, mod)
    ans %= mod
    
print(ans)

Buggy submission (verdict: Runtime Error):
from math import factorial

X, Y = map(int, input().split())
mod = 10 ** 9 + 7
if (X + Y) % 3 != 0:
    print(0)
else:
    n = (2 * Y - X) // 3
    m = (2 * X - Y) // 3
    print((factorial(n+m)%mod * pow(factorial(n)*factorial(m), mod-2, mod))%mod)
Problem p02990 (python)

Fixed submission:
import math

N, K = map(int, input().split())
mod = 1000000007

# 順列(Permutation)を求める関数
def P(n, k):
    return math.factorial(n)//math.factorial(n-k)
    
# 組合せ(Combination)を求める関数
def C(n, k):
    return P(n, k)//math.factorial(k)
   
for i in range(1, K+1):
    if (N-K+1 < i) or (K-1 < i-1):
        print(0)
    else:
        print(((C(N-K+1, i)%mod)*(C(K-1, i-1)%mod))%mod)

Buggy submission (verdict: Runtime Error):
import math

N, K = map(int, input().split())
mod = 1000000007

def P(n, k):
    return math.factorial(n)//math.factorial(n-k)

def C(n, k):
    return P(n, k)//math.factorial(k)

for i in range(1, K+1):
    print(((C(N-K+1, i)%mod)*(C(K-1, i-1)%mod))%mod)
Problem p03127 (python)

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

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a%b)


if N == 1:
    print(x[0])
else:
    num = gcd(x[0], x[1])
    if N == 2:
        print(num)
    else:
        for i in range(2, N):
            num = gcd(num, x[i])
        print(num)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
N = int(input())
a = list(map(int, input().split()))
print(reduce(math.gcd, a))
Problem p02547 (python)

Fixed submission:
n = int(input())
cnt=0
for _ in range(n):
    a,b=map(int,input().split())
    if a==b:
        cnt+=1
        if cnt>=3:
            break
    else:
        cnt=0
if cnt>=3:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
cnt=0
for _ in range(n):
    a,b=map(int,input()split())
    if a==b:
        cnt+=1
        if cnt>=3:
            break
    else:
        cnt=0
if cnt>=3:
    print("Yes")
else:
    print("No")
Problem p02570 (python)

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

Buggy submission (verdict: Runtime Error):
d,t.s = map(int,input().split())
a = d/s
if t>=a:
    print("Yes")
else:
    print("No")
Problem p02624 (python)

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

Buggy submission (verdict: Runtime Error):
import numpy as np
import sympy
n=int(input())
a=[(sympy.divisor_count(i)*i) for i in range(1,n+1)]
print(np.sum(a))
Problem p02659 (python)

Fixed submission:
a,b=input().split()
a=int(a)
b=(100*float(b)+0.05)
print(a*int(b)//100)

Buggy submission (verdict: Runtime Error):
a,b=input().split()
a=int(a)
b=int(100*b)
print((a*b)/100)
Problem p02723 (python)

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

Buggy submission (verdict: Runtime Error):
x = int(input())
print(x//500*500*2+x%500//5*5)

Buggy submission (verdict: Runtime Error):
x = int(input())
print(x//500*500*2+x%500//5*5)
Problem p02753 (python)

Fixed submission:
s = input()
if s[0] == s[1] and s[1] == s[2]:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
s = input()
if s[0] == s[1] and a[1] == a[2]:
  print("No")
else:
  print("Yes")
Problem p02754 (python)

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

print(n // (a + b) * a + min(a, n%(a+b)))

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

s = ""
i = 0

while len(s) < n:
    s += "b"*a if i%2==0 else "r"*b
    i += 1

print(s[:n].count("b"))
Problem p02773 (python)

Fixed submission:
class Counter(dict):
  def __missing__(self, i):
    return 0

n = int(input())

s = Counter()

for _ in range(n):
  i = input()
  s[i] += 1

s = list(sorted(s.items(), key=lambda x: -x[1]))
m = s[0][1]

ans = []
for key, value in s:
  if value == m:
    ans.append(key)
  else:
    break

ans.sort()

print('\n'.join(ans))

Buggy submission (verdict: Runtime Error):
if (n := int(input())) > 0:
  for _ in range(n):
    input()

Buggy submission (verdict: Runtime Error):
class Counter(dict):
  def __missing__(self, i):
    return 0

n = int(input())

s = Counter()

for _ in range(n):
  i = input()
  s[i] += 1

s = dict(sorted(s.items(), key=lambda x: x[1]))
m = s.values()[0]

ans = []
for i in s:
  if s[i] == m:
    ans.append(i)

print('\n'.join(ans))
Problem p02779 (python)

Fixed submission:
input()
a = input().split()

ans = "YES"
x = {}
for i in a:
    if x.get(i, False):
        ans = "NO"
        break
    x[i] = True

print(ans)

Buggy submission (verdict: Runtime Error):
input()
a = input().split()

x = {}
for i in a:
	if x.get(i, False):
		print("No")
		break
    x[i] = True
else:
	print("Yes")

Buggy submission (verdict: Runtime Error):
input()
a = input().split()

x = {}
for i in a:
	if x.get(i, False):
		print("No")
		break
    x[i] = True
else:
	print("Yes")
Problem p02735 (python)

Fixed submission:

h,w = map(int,input().split())

def isvalid(r,c):
    return 0 <= r < h and 0 <= c < w

g = [input() for _ in range(h)]
d = [1,0]
queue = [(0,0)]
dist = [[1000000]* w for _ in range(h)]
dist[0][0] = 0
if g[0][0] == '#':
    dist[0][0] = 1
while len(queue) > 0:
    next_queue = []
    for r,c in queue:
        for i in range(2):
            cos = dist[r][c]
            nr = r + d[i]
            nc = c + d[1^i]
            if not isvalid(nr,nc):
                continue
            if  g[r][c] != g[nr][nc]:
                cos += 1
            if cos < dist[nr][nc]:
                dist[nr][nc] = cos
                next_queue.append((nr,nc))
    queue = next_queue
print((dist[h-1][w-1] + 1)//2)

Buggy submission (verdict: Runtime Error):

h,w = map(int,input().split())

def isvalid(r,c):
    return 0 <= r < h and 0 <= c < w

g = [input() for _ in range(h)]
d = [1,0,-1,0]
queue = [(0,0)]
dist = [[1000000]* h for _ in range(w)]
dist[0][0] = 0
if g[0][0] == '#':
    dist[0][0] = 1
while len(queue) > 0:
    next_queue = []
    for r,c in queue:
        for i in range(4):
            cos = dist[r][c]
            nr = r + d[i]
            nc = c + d[1^i]
            if not isvalid(nr,nc):
                continue
            if  g[r][c] != g[nr][nc]:
                cos += 1
            if cos < dist[nr][nc]:
                dist[nr][nc] = cos
                next_queue.append((nr,nc))
    queue = next_queue
print((dist[h-1][w-1] + 1)//2)
Problem p02897 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%2=0:
  print(1/2)
else:
  print((n+1)/(2*n))

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%2=0:
  print(1//2)
else:
  print((n+1)//2)

Buggy submission (verdict: Runtime Error):
n=int(input())
print((n+1)//2n)
Problem p03041 (python)

Fixed submission:
n,k=map(int,input().split())
s=input()
print(s[:k-1]+s[k-1].lower()+s[k:])

Buggy submission (verdict: Runtime Error):
n, k= map(int, input().split())
s=input()
s[k], lower()
print("s")

Buggy submission (verdict: Runtime Error):
n, k= map(int, input().split())
s=input()
s[k], lower()
print(s)
Problem p03135 (python)

Fixed submission:
t,x=map(int, input().split())
print(t/x)

Buggy submission (verdict: Runtime Error):
t,x=map(int,input().split())
print(round((t/x),4)))
Problem p03631 (python)

Fixed submission:
n=input()
ck=0
for i in range(len(n)//2):
  if not n[i]==n[-1-i]:
    ck+=1
if ck==0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n=input()
ck=0
for i in range(n//2):
  if not n[i]==n[-1-i]:
    ck+=1
if ck==0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n=input()
ck=0
for _ in range(n//2):
  if not n[_]==n[-1-_]:
    ck+=1
if ck==0:
  print('Yes')
else:
  print('No')
Problem p02595 (python)

Fixed submission:
from math import sqrt
n, p = map(int, input().split())
r = 0
for i in range(n):
  x, y = map(int, input().split())
  if sqrt(x*x+y*y) <= p:
    r += 1
print(r)

Buggy submission (verdict: Runtime Error):
from math importsqrt
n, p = map(int, input().split())
r = 0
for i in range(n):
  x, y = map(int, input().split())
  if sqrt(x*x+y*y) <= p:
    r += 1
print(r)
Problem p02701 (python)

Fixed submission:
n = int(input())
s = set()
for i in range(n):
  s.add(input())
print(len(s))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = set()
for i in range(n):
  s.insert(input())
print(len(s))
Problem p02597 (python)

Fixed submission:
from math import floor, ceil
N = int(input())
WHITE = 0
RED = 1
str = list(map(str, list(input())))
r = []
w = []

for i in range(N):
  w.append(i) if str[i] == "W" else r.append(i)
  str[i] = WHITE if str[i] == "W" else RED
r.reverse()
max_count = min(len(r), len(w))
count = 0
for i in range(max_count):
  if r[i] - w[i] > 0:
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
from math import floor, ceil
N = int(input())
WHITE = 0
RED = 1
str = list(map(str, list(input())))
r = []
w = []

for i in range(N):
  w.append(i) if str[i] == "W" else r.append(i)
  str[i] = WHITE if str[i] == "W" else RED
r.reverse()

max_count = max(len(r), len(w))
count = 0
for i in range(max_count):
  if r[i] - w[i] < 0:
    count = i
    break

print(count)
Problem p02598 (python)

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

l = 0
r = 10**10

while r > l + 1:
    m = (r+l)//2
    count = 0
    for i in a:
        if i <= m:
            continue
        count += (i)//m
        
    if count > k:
        l = m
    else:
        r = m
    
print(r)

Buggy submission (verdict: Runtime Error):
from math import floor, ceil
N = int(input())
WHITE = 0
RED = 1
str = list(map(str, list(input())))
r = []
w = []

for i in range(N):
  w.append(i) if str[i] == "W" else r.append(i)
  str[i] = WHITE if str[i] == "W" else RED
r.reverse()

max_count = max(len(r), len(w))
count = 0
for i in range(max_count):
  if r[i] - w[i] < 0:
    count = i
    break

print(count)
Problem p02862 (python)

Fixed submission:
import math
X, Y = map(int, input().split())
if X > Y:
  X, Y = Y, X

if ((2*X-Y) % 3 != 0) or (2*X-Y < 0):
  print(0)
  exit()
A = (2*X-Y)//3
B = Y-X+A
N = A+B
nu = 1
de = 1
for i in range(B+1, N+1):
  nu = (nu * i) % (10 ** 9 + 7)
for i in range(1, A+1):
  de = (de * i) % (10 ** 9 + 7)
  
print((nu * pow(de, -1, 10 ** 9 + 7) ) % (10 ** 9 + 7))

Buggy submission (verdict: Runtime Error):
import math
X, Y = map(int, input().split())
if X > Y:
  X, Y = Y, X

if ((2*X-Y) % 3 != 0) or (2*X-3 < 0):
  print(0)
  exit()
A = (2*X-Y)//3
B = Y-X+A
N = A+B
nu = 1
de = 1

for i in range(B+1, N+1):
  nu = (nu * i) % (10 ** 9 + 7)
for i in range(1, A+1):
  de = (de * i) % (10 ** 9 + 7)
print((nu * pow(de, -1, 10 ** 9 + 7) ) % (10 ** 9 + 7))
Problem p03307 (python)

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

Buggy submission (verdict: Runtime Error):
print(int(input)*2)
Problem p02577 (python)

Fixed submission:
a = str(input())
b = []
c = 0
for i in range(len(a)):
    b.append(int(a[i]))
if sum(b) % 9 == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
[int(s) for s in l_si]