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

Fixed submission:
a,b,c,k = input().split(None, 4)
A = int(a)
B = int(b)
C = int(c)
K = int(k)
X = K - A - B
if K <= A:
    print(K)
elif A < K <= A + B:
    print(A)
else:
    print(A - X)

Buggy submission (verdict: Runtime Error):
a,b,c,k = input().split(None, 4)
A = int(a)
B = int(b)
C = int(c)
K = int(k)
X = K - A - B
if K <= A:
    print(K)
elif A < K <= A + B:
    print(A)
else A + B < K:
    print(A - X)
Problem p02880 (python)

Fixed submission:
N = int(input())
for i in range(1,10):
 for j in range(1,10):
  if i*j == N:
   print("Yes")
   exit()
print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
for i in range(1,9):
    for j in range(1,9):
       if i*j == N:
         break
　　　　　print("YES")
       else:
          print("NO")
Problem p02596 (python)

Fixed submission:
k = int(input())
a = [None]*1000001
a[1]=7%k
n=0

if a[1]==0:
    print("1")
    n=1

for i in range(2,k+1):
    a[i]=(a[i-1]*10+7)%k
    if a[i]==0 and n==0:
        print("{}".format(i))
        n=1
if n==0:
    print("-1")

Buggy submission (verdict: Runtime Error):
k = int(input())
a = [None]*1000001
a[1]=7%k
n=0

for i in range(2:k+1):
    a[i]=(a[i-1]*10+7)%k
    if a[i]==0 and n==0:
        print("{}".format(i))
        n=1
if n==0:
    print("-1")
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 p02859 (python)

Fixed submission:
import sys

def cirCle(r: int):
 ans = r ** 2
 print(ans)
 return()


if __name__ == '__main__':
  args = input()
  cirCle(int(args))

Buggy submission (verdict: Runtime Error):
import sys

def cirCle(r: int):
 ans = r ** 2
 print(ans)
 return()


if __name__ == '__main__':
  args = sys.argv
  cirCle(int(args[1]))
Problem p02860 (python)

Fixed submission:
n = int(input())
s = input()

if s[ :n//2 ] == s[ n//2: ]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
c = n/2
stt = s[:c]
end = s[c:]

if (n%2 == 1):
  print("No")

if (stt == end):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
c = n/2
stt = s[: c]
end = s[c :]

if c%2 == 1:
  print("No")

if stt == end :
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
c = n/2
stt = s[: c]
end = s[c :]
if stt == end:
  print("Yes")
else:
  print("No")
Problem p02622 (python)

Fixed submission:
S=input()
T=input()
count=0
for i in range(len(S)):
  if S[i]!=T[i]:
    count +=1
print(count)

Buggy submission (verdict: Runtime Error):
#include<stdio.h>
#include<math.h>
int count;
int main(){
  char S[200005],T[200005];
  scanf("%c",S);
  scanf("%c",T);
  for (int i=0;S[i]!='\0';i++){
    if (S[i]!=T[i])
    count++;
  }
  printf("%d\n",count);
}

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
count=0
for i in range(len(S)):
  if S[i]!=T[i]:
    T[i]=S[i]
    count +=1
print(count)

Buggy submission (verdict: Runtime Error):
S=input()
T=input()
count=0
for i in range(len(S)):
  if S[i]!=T[i]:
    T[i]=S[i]
    count +=1
Problem p02835 (python)

Fixed submission:
a,b,c = map(int,input().split())
if a+b+c>=22:
  print("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a+b+c=>22:
  print(bust)
  else:
  print(win)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(a+b+c)
if d >= 22:
  print('bust')
else:
  print('win')

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
d = int(a+b+c)


if d >= 22:
    print('bust')
else:
     print('win')
Problem p02879 (python)

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

if a>9 or b>9:
  print("-1")
else:
  print(a*b)

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

if a>9 and b>9:
  print(-1)
  else
  print(a*b)
Problem p02594 (python)

Fixed submission:
n=int(input())

if 30<=n:
    print('Yes')
else :
    print('No')

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

if 30<=n:
    print('Yes')
else :
    print('No')

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

if 30<=n:
    print('Yes')
else :
    print('No')

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

if 30<=n:
    print('Yes')
else :
    print('No')
Problem p02595 (python)

Fixed submission:
N, D = map(int, input().split())
count = 0
for i 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().split())
count = 0
for i in range(N):
    x, y = map(int, input().split())
    if x^2+y^2 <= D^2:
      count += 1
return count
Problem p02693 (python)

Fixed submission:
K = int(input())
A, B = map(int, input().split())
f = "NG"

for i in range(A, B + 1):
    if i % K == 0:
        f = "OK"

print(f)

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

for i in range(A, B+1):
  i % K == 0:
    f = "OK"
    
print(f)
Problem p02753 (python)

Fixed submission:
S = input()

if "A" in S and "B" in S:
  print("Yes")
else:
  print("No")

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

if "A" in S and "B" in S:
  prnt("Yes")
else:
  ptint("No")
Problem p03208 (python)

Fixed submission:
N, K = map(int, input().split())
H = [int(input()) for _ in range(N)]
H.sort()
df = 0
min_h = H[K-1]-H[0]

for i in range(1, N-K+1):
    new_h = H[i+K-1]-H[i]
    if new_h < min_h:
        min_h = new_h

print(min_h)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
H = [int(input()) for _ in range(N)]
H.sort()
df = 0
min_h = H[K-1]-H[0]

for i in range(1, K):
    new_h = H[i+K-1]-H[i]
    if new_h < min_h:
        min_h = new_h

print(min_h)
Problem p04005 (python)

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

if any(i % 2 == 0 for i in [A, B, C]):
    print(0)
else:
    print(min(A*B, B*C, C*A))

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

if any(i % 2 == 0 for i in [A, B, C]):
    print(0)
else:
    AB = A * B
    lis = [AB] * C
    mid = len(lis) // 2
    print(sum(lis[mid:]) - sum(lis[0:mid]))
Problem p03013 (python)

Fixed submission:
def generate_range_combinations(n):
    C = [1] * n
    for i in range(2, n):
        C[i] = (C[i - 1] + C[i - 2]) % DIV
    return C


def solve(n, m, A):
    from collections import defaultdict

    if m == 0:
        C = generate_range_combinations(n + 1)
        return C[-1]

    D = defaultdict(lambda: 0)
    for i in range(m - 1):
        d = A[i + 1] - A[i] - 1
        if d == 0:
            return 0
        D[d] += 1
    D[A[0]] += 1
    D[n - A[-1]] += 1

    ans = 1
    C = generate_range_combinations(max(D.keys()))
    for k, v in D.items():
        ans *= C[k - 1] ** v
        ans %= DIV
    return ans


DIV = 1000000007
n, m = map(int, input().split())
A = [int(input()) for _ in range(m)]
print(solve(n, m, A))

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

n, m = map(int, input().split())
A = [0] * m
for i in range(m):
    A[i] = int(input())
B = []
if m > 1:
    for i in range(m - 1):
        if A[i + 1] - A[i] == 1:
            print(0)
            exit()
if m:
    B.append(A[0])
    A.append(n + 1)
    for i in range(len(A) - 2, -1, -1):
        B.append(A[i + 1] - A[i] - 1)
else:
    B.append(n + 1)
div = 1_000_000_007
ans = 1
for b in B:
    if b < 3:
        continue
    c = b - 1
    two_max = c // 2
    a = 0
    for two in range(two_max + 1):
        one = c - (2 * two)
        a += factorial(one + two) // (factorial(one) * factorial(two))
    ans *= a
    ans %= div
print(ans)
Problem p03038 (python)

Fixed submission:
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
BC = [None] * M
for i in range(M):
    BC[i] = tuple(map(int, input().split()))
BC.sort(key=lambda tpl: tpl[1], reverse=True)  # sort by C descendant

D = [0] * N
i = 0
j = 0
while i < N and j < M:
    b, c = BC[j]
    for k in range(i, min(i + b, N)):
        D[k] = c
    i += b
    j += 1

for i in range(N):
    A[i] = max(A[i], D[i])

print(sum(A))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
BC = [None] * M
for i in range(M):
    BC[i] = tuple(map(int, input().split()))
BC.sort(key=lambda tpl: tpl[1], reverse=True)  # sort by C descendant

D = [0] * N
i = 0
j = 0
while i < N and j < M:
    b, c = BC[j]
    for k in range(i, i + b):
        D[k] = c
    i += b
    j += 1

for i in range(N):
    A[i] = max(A[i], D[i])

print(sum(A))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
BC = [None] * M
for i in range(M):
    BC[i] = tuple(map(int, input().split()))
BC.sort(key=lambda tpl: tpl[1], reverse=True)  # sort by C descendant

D = [0] * N
i = 0
j = 0
while i < N and j < M:
    b, c = BC[j]
    for k in range(i, i + b):
        D[k] = c
    i += b
    j += 1

for i in range(N):
    A[i] = max(A[i], D[i])

print(sum(A))
Problem p03221 (python)

Fixed submission:
N, M = map(int, input().split())
C = [tuple(map(int, input().split())) for _ in range(M)]
P = {c[0]: [] for c in C}
for c in C:
    P[c[0]].append(c[1])
for p in P:
    P[p].sort()
    P[p] = {P[p][i]: i + 1 for i in range(len(P[p]))}
for c in C:
    print('{:06}{:06}'.format(c[0], P[c[0]][c[1]]))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
P = [0] * M
Y = [0] * M
for i in range(M):
    P[i], Y[i] = map(int, input().split())

X = [0] * M
for p in set(P):
    I = [i for i in range(M) if P[i] == p]
    Y = [Y[i] for i in I]
    earliest = min(Y)
    latest = max(Y)
    i = 0
    for y in range(earliest, latest + 1):
        if y in Y:
            X[I[i]] = Y.index(y) + 1
            i += 1

for i in range(M):
    print("{:06}{:06}".format(P[i], X[i]))
Problem p02792 (python)

Fixed submission:
import numpy as np
def cmb(n, r):
    if n<r:
      return 0
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

n = int(input())
field = np.array([[0 for _ in range(9)] for _ in range(9)])

for i in range(1, n+1):
    stri = str(i)
    mae = int(stri[0])
    ushiro = int(stri[-1])
    if mae != 0 and ushiro != 0:
        field[mae-1, ushiro-1] += 1

total = 0
for i in range(9):
    val = field[i, i]
    #print(val)
    #print(cmb(val, 2))
    total += val
    total += 2*cmb(val, 2)

for i in range(9):
    for j in range(i, 9):
        if i==j:
            continue
        else:
            total += 2*field[i,j]*field[j,i]
#print(field)
print(total)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
keta = len(str(n))
field = np.array([[0 for _ in range(0)] for _ in range(9)])
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result


for k in range(1, n+1):
    i = int(str(k)[0])
    j = int(str(k)[1])
    field[i, j] += 1
total = 0
for i in range(9):
    val = field[i,i]
    total += cmb(val+1, 2)
for i in range(9):
    for j in range(9):
        if i==j:
            continue
        else:
            val = field[i,j]
            total += 2*cmb(val, 2)
print(val)
Problem p02793 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
lcm = a[0]

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

for i in range(1, n):
    lcm = lcm * a[i] // gcd(lcm, a[i])
mod = 10**9 + 7
ans = 0
for i in range(n):
    ans += lcm // a[i]
print(ans % mod)

Buggy submission (verdict: Runtime Error):
mod = 10**9 + 7
n = int(input())
lst = list(map(int, input().split()))
koubai = lst[0]
def gcd(a, b):
    if a > b:
        a, b = b, a
    while b > 0:
        a, b = b, a % b
    return a
for i in range(1, n):
    koubai = koubai*lst[i]//gcd(koubai, lst[i])
 
total = 0
for i in lst:
    total += koubai//l

print(total%mod)

Buggy submission (verdict: Runtime Error):
mod = 10**9 + 7
n = int(input())
lst = list(map(int, input().split()))
koubai = lst[0]
def gcd(a, b):
    if a > b:
        a, b = b, a
    while b > 0:
        a, b = b, a % b
    return a
for i in range(1, n):
    koubai = koubai*lst[i]//gcd(koubai, lst[i])
 
total = 0
for l in lst:
    b += koubai//l

print(total%mod)
Problem p02987 (python)

Fixed submission:
S = list(input())
judge = 'Yes'
for s in set(S):
	if S.count(s) != 2:
		judge = 'No'
print(judge)

Buggy submission (verdict: Runtime Error):
S = input()
dic = {}
for s in S:
	if not dic[s]:
		dic[s] = 1
	if dic[s]:
		dic[s] += 1
judge = 'Yes'
for k, v in dic.items():
	if v != 2:
		judge = 'NO'
print(judge)
Problem p03011 (python)

Fixed submission:
def main():
    p,q,r = map(int, input().split())
    min_time = min([p+q, q+r, r+p])
    print(min_time)

if __name__ == '__main__':
	main()

Buggy submission (verdict: Runtime Error):
def main():
    p, q, r = map(int, input().split)
    min_time = min([p+q, q+r, r+p])
    print(min_time)

if __name__ == '__main__':
	main()

Buggy submission (verdict: Runtime Error):
pqr = list(map(int, input().split()))
kumi = [(pqr[0], pqr[1]), (pqr[1], pqr[2]), (pqr[0], pqr[2])
seki = []
for c in kumi:
	seki.append(c[0]*c[1])
print(min(seki))
Problem p03208 (python)

Fixed submission:
N, K =map(int, input().split())
lst = []
for _ in range(N):
    lst.append(int(input()))
sor = sorted(lst)

mindiff = float('inf')
for i in range(N-K+1):
    diff = sor[i+K-1] - sor[i] 
    if diff <= mindiff:
        mindiff = diff
print(mindiff)

Buggy submission (verdict: Runtime Error):
N, K =map(int, input().split())
lst = []
for _ in range(N):
    lst.append(int(input()))
sor = sorted(lst)

mindiff = float('inf')
for i in range(N-K+1):
    diff = selected[i] - selected[i+K-1]
    if diff <= mindiff:
        mindiff = diff
print(mindiff)
Problem p03307 (python)

Fixed submission:
n = int(input())
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def lcm(a, b):
	return a * b // gcd (a, b)
print(lcm(2, n))

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
print(lcm(2, n))
Problem p03805 (python)

Fixed submission:
import itertools
n, m = map(int, input().split())
adj_matrix = [[0] * n for _ in range(n)]

for _ in range(m):
    a, b = map(int, input().split())
    adj_matrix[a-1][b-1] = 1
    adj_matrix[b-1][a-1] = 1

cnt = 0
for each in itertools.permutations(range(n)):
    if each[0] != 0:
        break
    flag = 1
    for i in range(n-1):
        flag *= adj_matrix[each[i]][each[i+1]]
    cnt += flag
print(cnt)

Buggy submission (verdict: Runtime Error):
import itertools
n, m = map(int, input().split())
adj_matrix = [[0] * n for _ in range(n)]

for _ in range(m):
    a, b = map(int, input().split())
    adj_matrix[a-1][b-1] = 1
    adj_matrix[b-1][a-1] = 1

cnt = 0
for each in range(itertools.permutations(range(n))):
    if each[0] != 0:
        break
    flag = 1
    for i in range(n-1):
        flag *= adj_matrix[each[i]][each[i+1]]
    cnt += flag
print(cnt)
Problem p03104 (python)

Fixed submission:
import numpy as np
import sys

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

def f(x):
    if x%4 == 0:
        return x
    elif x%4 == 1:
        return x^(x-1)
    elif x%4 == 2:
        return x^1
    else:
        return x^(x-1)^1

print(f(A-1)^f(B))

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

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

L = int(np.ceil(np.log2(B)))
result = 0

for i in range(L+1):
    am = 0
    zen = 2**(i+1)
    han = zen//2

    s = A%zen
    e = B%zen+1

    b = (max(e-han,0) + max(s-han,0) ) %2
    # print(s,e,b)
    result += han*b

print(result)

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

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

def calcs(val, han):
    if val < han:
        am = han
    else:
        am = zen-(val)
    return am

def calce(val, han):
    if val < han:
        am = han
    else:
        am = zen-(val+1)
    return am


L = int(np.ceil(np.log2(B)))
result = 0
for i in range(L+1):
    am = 0

    zen = 2**(i+1)
    han = zen//2
    # if i==0:
        # b = (B-A)%2
    # else:
    b = (calcs(A%zen, han) + calce(B%zen, han))%2

    # print(i, zen, han , "  |  ", A%zen, calcs(A%zen, han), "  |  ", B%zen, calce(B%zen, han))
    # print(b)

    result += han*b

print(result)
Problem p02790 (python)

Fixed submission:
a, b = input().split()
print(max(int(a*int(b)), int(b*int(a))))

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

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

Fixed submission:
A1, A2, A3 = map(int, input().split())
 
print('win' if A1+A2+A3 <= 21 else 'bust')

Buggy submission (verdict: Runtime Error):
A1, A2, A3 = map(input().split(), int)

print('win' if A1+A2+A3 <= 21 else 'bust')
Problem p02847 (python)

Fixed submission:
S = input()
L = ['SAT','FRI','THU','WED','TUE','MON','SUN']
for i,l in enumerate(L):
  if S == l:
    print(i+1)
    break

Buggy submission (verdict: Runtime Error):
import math
A, B, X = map(int, input().split())
L = []
for ln_N in range(17):
    N = math.floor((X - B * ln_N) / A)
    if N <= 0:
        L.append(0)
    else:
        if math.floor(math.log10(N)+1) == ln_N:
            L.append(N)
print(min(1000000000,max(L)))

Buggy submission (verdict: Runtime Error):
L = ['SAT','FRI','THU','WED','TUE','MON','SUN']

for i,l in enumerate(L):
  if S == l:
    print(i+1)
    break
Problem p02859 (python)

Fixed submission:
r = int(input())
print(r*r)

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

S = r * r * math.pi
fraction = S / (1 * 1 * math.pi)

print(fractions)
Problem p02860 (python)

Fixed submission:
N = int(input())
S = input()
if N%2 == 0:
    if S[:int(N/2)] == S[int(N/2):]:
      print('Yes')
    else:
      print('No')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
if N%2 == 0:
    print(S[:int(N/2)] == S[int(N/2):])
else:
	print(false)
Problem p02897 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
if N % 2 == 0:
  print(0.5)
else:
  print((N//2+1)/N
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()))

X = 0
j = A[0]
for i in A:
  X += B[i-1]
  if i == j+1:
    X+= C[j-1]
  j = i
print(X)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
plug = 1
cnt = 0
while plug < B:
  plug += A - 1
  cnt += 1
print(cnt)
Problem p02933 (python)

Fixed submission:
a = int(input())
s = input()
print(s if a >= 3200 else 'red')

Buggy submission (verdict: Runtime Error):
a = int(input())
s = input()
print(s if a >= 3200 else 'red)
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 p03317 (python)

Fixed submission:
n, k = [ int(i) for i in input().split(' ') ]
xs = [ int(x) for x in input().split(' ') ]
i0 = xs.index(min(xs))
print(1 + min([ (i + k - 2) // (k - 1) + (n - i - 2) // (k - 1)
  for i in range(max(i0 - k + 1, 0), min(i0, n - k) + 1) ]))

Buggy submission (verdict: Runtime Error):
    n, k = [ int(x) for x in input().split(' ') ]
    xs = [  int(x) for x in input().split(' ') ]
    i0 = xs.index(min(xs))
    print(1 + min([ (i + k - 2) // (k - 1) + (n - i - 2) // (k - 1)
      for i in range(max(i0 - k + 1, 0),  min(i0, n - k) + 1)  ]))
Problem p02594 (python)

Fixed submission:
import sys

X = int(input())

if X >= 30:
  print('Yes')
else:
  print('No')

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

if X >= 30:
  print('yes')
else:
  print('no')
Problem p02595 (python)

Fixed submission:
import sys

N, D = (int(x) for x in input().split())

result = 0
for _ in range(N):
    X, Y = (int(x) for x in input().split())
    if X * X + Y * Y <= D * D:
        result += 1
print(result)

Buggy submission (verdict: Runtime Error):
import sys

N, D = (int(x) for x in input().split())

for _ in range(N):
  x, y = (int(x) for x in input().split())
  if x*x + y*y <= D*D:
    result += 1
    
print(result)

Buggy submission (verdict: Runtime Error):
import sys

N, D = int(input().split())

result = 0
for i in range(N):
  x, y = int(input().split())
  if x*x + y*y <= D*D:
    result += 1
    
print(result)
Problem p02595 (python)

Fixed submission:
N,D = map(int,input().split())
count = 0
for i in range(N):
    X,Y = map(int,input().split())
    if X**2 + Y**2 <= D**2:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
l = [list(map(int,input.split())) for i in range(n)]
N = l[0][0]
D = l[0][1]
count = 0
for i in range(N):
    if l[i+1][0]**2 + l[i+1][1]**2 <= D**2:
        count += 1
print(count)
Problem p03803 (python)

Fixed submission:
a,b = map(int, input().split())
if a == b:
  print("Draw")
else:
  if a == 1:
    print("Alice")
  else:
    if b == 1:
      print("Bob")
    else:
      if a > b:
        print("Alice")
      else:
        print("Bob")

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
if A > B:
  print("Alice")
else if A < B:
  print("Bob")
else:
  print("Draw")
Problem p03834 (python)

Fixed submission:
s = str(input())
print(s.replace(","," "))

Buggy submission (verdict: Runtime Error):
s = map(str,input())
print(s.replace(","," "))
Problem p03835 (python)

Fixed submission:
a,b=list(map(int,input().split()))
count=0
for x in range(a+1):
    for y in range(a+1):
        if b < x+y:
            break
        if b-x-y <= a:
            count+=1
print(count)

Buggy submission (verdict: Runtime Error):
a,b=list(map(int,input().split()))
count=0
for x in range(a+1):
    for y in range(a+1):
        if b < x+y:
            break
        if b-x-y <= z:
            count+=1
print(count)
Problem p02595 (python)

Fixed submission:
N,D = map(int,input().split())
answer = 0
for i in range(N):  
    x,y = map(int,input().split())
    if(D**2 >= x**2+y**2):
        answer += 1
print(answer)

Buggy submission (verdict: Runtime Error):
N,D = map(int(),input().split())
answer = 0
for i in range(N):  
    x,y = map(int(),input().split())
    if(D**2 >= x**2+y**2):
        answer += 1
print(answer)
Problem p02699 (python)

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

Buggy submission (verdict: Runtime Error):
s,w = map(inr, input().split())
 
if w <= s:
  print("unsafe")
else:
  print("safe")

Buggy submission (verdict: Runtime Error):
s,w = map(inr, input().split())

if w >= s:
  print("unsafe")
else:
  print("safe")