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

Fixed submission:
N = int(input())
ans_lis = [[0] * 9 for i in range(9)]
for i in range(1,N+1):
  t = str(i)
  mae = int(t[0])
  ushiro = int(t[-1])
  if ushiro == 0:
    continue
  ans_lis[mae-1][ushiro-1] += 1
ans = 0
for i in range(9):
  for j in range(9):
    ans += ans_lis[i][j] * ans_lis[j][i]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans_lis = [[0　for k in range(9)] for i in range(9)]
for i in range(1,N+1):
  t = str(i)
  mae = int(t[0])
  ushiro = int(t[-1])
  if ushiro == 0:
    continue
  ans_lis[mae-1][ushiro-1] += 1
ans = 0
for i in range(9):
  for j in range(9):
    ans += ans_lis[i][j] * ans_lis[j][i]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans_lis = [[0] * 9 for i in range(9)]
for i in range(1,N+1):
  t = str(i)
  mae = int(t[0])
  ushiro = int(t[-1])
  if usiro == 0:
    continue
  ans_lis[mae-1][ushiro-1] += 1
ans = 0
for i in range(9):
  for j in range(9):
    ans += ans_lis[i][j] * ans_lis[j][i]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans_lis = [[0　for k in range(9)] for i in range(9)]
for i in range(1,N+1):
  t = str(i)
  mae = int(t[0])
  ushiro = int(t[-1])
  ans_lis[mae-1][ushiro-1] += 1
ans = 0
for i in range(9):
  for j in range(9):
    ans += ans_lis[i][j] * ans_lis[j][i]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans_lis = [[0　for _ in range(9)] for  i in range(9)]
for i in range(1,N+1):
  t = str(i)
  mae = int(t[0])
  ushiro = int(t[-1])
  ans_lis[mae-1][ushiro-1] += 1
ans = 0
for i in range(9):
  for j in range(9):
    ans += ans_lis[i][j] * ans_lis[j][i]
print(ans)
Problem p02819 (python)

Fixed submission:
import math
X = int(input())
def isPrime(N):
  for i in range(2, math.ceil(math.sqrt(X))):
    if N % i == 0:
      return False
  return True
while isPrime(X) == False:
  X += 1
print(X)

Buggy submission (verdict: Runtime Error):
X = int(input())
def isPrime(N):
  for i in range(2, ceil(N ** (1/2)):
    if N % i == 0:
      return False
  return True
while isPrime(X) == False:
  X += 1
print(X)

Buggy submission (verdict: Runtime Error):
X = int(input())
def sosu(n):
  for i in range(0,n//2):
    if X % i == 0:
      return False
    return True
if sosu(X) == True :
  print(X)
else:
  while sosu(X) == False:
    X += 1
  print(X)
Problem p02832 (python)

Fixed submission:
N = int(input())
a = list(map(int,input().split()))
k = 0
for i in range(N):
  if a[i] == k + 1 :
    k += 1
if k == 0:
  print(-1)
else:
  print(N-k)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))
k = 0
for i in range(N):
  if a[i] = k + 1 :
    k += 1
if k == 0:
  print(-1)
else:
  print(N-k)
Problem p02860 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
n = N // 2
if S[:n] == S[n:]:
    print('Yes')
else:s
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
if N%2 == 1:
  print('No')
else:
  for i in range(N/2):
    if S[i] != S[N/2 + i]:
      print('No')
      break
  print('Yes')

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
if N%2 = 1:
  print('No')
else:
  for i in range(N//2):
    if S[i] != S[N//2 + i]:
      print('No')
      break
  print('Yes')
Problem p02862 (python)

Fixed submission:
X, Y = map(int, input().split())
import math
mod = pow(10,9) + 7
a = 2*Y -X
b = 2*X -Y
if a % 3 == 0 and b % 3 == 0 and a >= 0 and b >= 0:
  k = a // 3
  l = b // 3
  c = max(k, l)
  d = min(k, l)
  bunshi = 1
  bunbo = 1
  for i in range(c+1,c+d+1):
    bunshi = bunshi * i % mod
  for i in range(1,d+1):
    bunbo = bunbo * i % mod
  ans = bunshi * pow(bunbo, mod-2, mod) % mod
  print(ans)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split())
import math
a = 2*Y -X
b = 2*X -Y
if a % 3 == 0 and b % 3 == 0 and a > 0 and b > 0:
  k = a // 3
  l = b // 3
  c = max(k, l)
  d = min(k, l)
  sita = math.factorial(d)
  ue = 1
  for i in range(c + 1, c + d + 1):
    ue * = i
  total = ue // sita
  print(total % (7 + 10 ** 9))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split())
import math
a = 2*Y -X
b = 2*X -Y
if a % 3 == 0 and b % 3 == 0:
  k = a // 3
  l = b // 3
  ue = math.factorial(k+l)
  sita_1 = math.factorial(k)
  sita_2 = math.factorial(l)
  total = ue // (sita_1 * sita_2)
  print(total % (7 + 10 ** 9))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split())
import math
if (2 * Y - X ) % 3 == 0 and (2 * X -  Y) % 3 == 0:
  k = (2 * Y - X) // 3
  l = (2 * X - Y) // 3
  ue = math.factorial(k+l)
  sita_1 = math.factorial(k)
  sita_2 = math.factorial(l)
  total = ue //(sita_1 * sita_2)
  print(total % (7 + 10 ** 9))
else:
  print(0)
Problem p02873 (python)

Fixed submission:
s = input()
N = len(s) + 1
l = [0]*N #からのリストN個
for i in range(N-1):
  if s[i] == '<':
    l[i+1] = l[i] + 1
for k in range(N-2,-1,-1):#後ろから逆順で一ずつ降る
  if s[k] == '>':
    l[k] = max(l[k], l[k+1] + 1)
print(sum(l))

Buggy submission (verdict: Runtime Error):
S = input()
kei = 0
k = []
l = []
if S[0] == '<':
  k.append(0)
for i in range(len(S)-1):
  if S[i] == '>' and S[i+1] == '<':
    k.append(i+1)
  elif S[i] == '<' and S[i+1] == '>':
    l.append(i+1)
if S[len(S)] == '>':
  k.append(len(S)+1)
def summ(m):
  s = 0
  if m != 0:
    for j in range(1,m+1):
      s += j
  return s
for p in range(len(k)-1):
  if k[p+1] - l[p] > l[p] - k[p]:
    kei += summ(k[p+1] - l[p]) + summ(l[p]-k[p] - 1)
  else:
    kei += summ(k[p+1] - l[p] - 1) + summ(l[p]-k[p])
print(kei)
Problem p02881 (python)

Fixed submission:
N = int(input())
a = 1
while a * a <= N:
  if N % a == 0:
    k = a
  a += 1
b = N //k
print(b + k - 2)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = 1
while a * a <= N:
  if N % a = 0:
    k = a
  a += 1
b = N //k
print(b + k - 2)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = 1
while a * a <= N:
  if N % a = 0:
    k = a
  a += 1
print(k + (N // k) - 2)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = 1
while a * a <= N:
  if N % a = 0:
    k = a
  a += 1
print(k + (N/k) - 2)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = 1
while a * a <= N:
  if N % a = 0:
    k = a
  a += 1
print(k + (N//k) -2)

Buggy submission (verdict: Runtime Error):
N = int(input())
a = 2
while a * a <= N:
  if N % a = 0:
    k = a
  a += 1
print(k + N//k -2)
Problem p02912 (python)

Fixed submission:
#標準入力からソートまで
N, M = map(int, input().split())
A = list(map(lambda x : int(x) * (-1), input().split()))
#Aの中で一番でかいのをdiscountしてまた並び替え
#優先度付きqueuemを使う
import heapq
heapq.heapify(A)
for i in range(M):
    tmp = (-1) * heapq.heappop(A) // 2
    heapq.heappush(A, tmp * (-1))
print(-sum(A))

Buggy submission (verdict: Runtime Error):
#標準入力からソートまで
import numpy as np
N, M = map(int, input().split())
A = list(map(lambda x : int(x) * (-1), input().split()))
#Aの中で一番でかいのをdiscountしてまた並び替え
#優先度付きqueuemを使う
import heapq
heapq.heapify(A)
for i in range(M):
    tmp = (-1) * heapq.heapop(A) // 2
    heapq.heappush(A, tmp * (-1))
print(-sum(A))

Buggy submission (verdict: Runtime Error):
#標準入力からソートまで
import numpy as np
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
#Aの中で一番でかいのをdiscountしてまた並び替え
import bisect
for i in range(M):
    tmp = A.pop(N-1) // 2
    if A[N-2] <= tmp:
        A.append(tmp)
    else:
        bisect.insort_left(A, tmp)
print(sum(A))

Buggy submission (verdict: Runtime Error):
#標準入力からソートまで
import numpy as np
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
A = np.array(A)
#Aの中で一番でかいのをdiscountしてまた並び替え
import bisect
for i in range(M):
    tmp = A.pop(N-1) // 2
    if A[N-2] <= tmp:
        A.append(tmp)
    else:
        bisect.insort_left(A, tmp)
print(sum(A))
Problem p02990 (python)

Fixed submission:
N, K = map(int, input().split())
mod = 10 ** 9 + 7
for i in range(1, K+1):
    if i > N - K + 1:
        print(0)
    else:
        ans = 1
        tmp = 1
        for j in range(K - i):
            ans = ans * (K - 1 - j )% mod
            tmp = tmp * (K - i - j) % mod
        for k in range(N - K - i + 1):
            ans = ans * (N - K + 1 - k) % mod
            tmp = tmp * (N - K - i + 1 - k) % mod
        ans = ans % mod * pow(tmp, mod - 2, mod) % mod
        print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
mod = 10 ** 9 + 7
for i in range(1, K+1):
    if i > N - K + 1
        print(0)
    else:
        ans = 1
        for j in range(K - i):
            ans = ans * (K - 1 - j )% mod
            ans = ans * pow(K - i - j, mod-2, mod) % mod
        for k in range(N - K - i + 1):
            ans = ans * (N - K + 1 - k) % mod
            ans = ans * pow(N - K - i + 1 - k, mod - 2, mod) % mod
        print(ans)
Problem p03077 (python)

Fixed submission:
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
m = min(a,b,c,d,e)
if n % m == 0:
    print(n//m + 4)
else:
    print(n//m + 5)

Buggy submission (verdict: Runtime Error):
import stdin from sys
n = int(stdin.readline().rstrip())
li = [int(stdin.readline().rstrip()) for _ in range(5)]
m = min(li)
if n % m == 0:
    print(n//m + 4)
else:
    print(n//m + 5)

Buggy submission (verdict: Runtime Error):
import stdin from sys
n = int(stdin.readline().rstrip())
li = [int(stdin.readline().rstrip() for _ in range(5))]
m = min(li)
if n % m == 0:
    print(n//m + 4)
else:
    print(n//m + 5)

Buggy submission (verdict: Runtime Error):
import stdin from sys
n = int(stdin.readline())
li = int(stdin.readlines())
m = min(li)
if n % m == 0:
    print(n//m + 4)
else:
    print(n//m + 5)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
m = min(a,b,c,d,e)
print(ceil(n/m) + 4)
Problem p03107 (python)

Fixed submission:
S = list(input())
a = S.count('0')
b = S.count('1')
ans = 2 * min(a, b)
print(ans)

Buggy submission (verdict: Runtime Error):
S = list(int(input()))
a = S.count(0)
b = S.count(1)
ans = 2 * min(a, b)
print(ans)

Buggy submission (verdict: Runtime Error):
S = list(int(input()))
a = S.counter(0)
b = S.counter(1)
ans = 2 * min(a, b)
print(ans)
Problem p03137 (python)

Fixed submission:
N, M = map(int, input().split())
X = sorted(list(map(int, input().split())))
if N >= M :
  print(0)
else:
  length = [0] * (M-1)
  for i in range(M-1):
    length[i] = (X[i+1]-X[i])
  length.sort()
  print(sum(length[:(M-N)]))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
X = sorted(list(map(int, input().split())))
if N >= M :
  print(0)
else:
  length = [0] * (M-1)
  for i in range(M-1):
    length[i](X[i+1]-X[i])
  length.sort()
  print(sum(length[:(M-N)]))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
X = list(map(int, input().split()))
if N >= M :
  print(0)
else:
  length = [0] * (M-1)
  for i in range(M-1):
    length[i](X[i+1]-X[i])
  length.sort()
  print(sum(length[:(M-N)]))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
X = list(map(int, input().split()))
if N >= M :
  print(0)
else:
  length = [0] * (M-1)
  for i in range(M-1):
    length[i](X[i+1]-X[i])
  length.sort()
  print(sum(length[:M-N]))
Problem p03208 (python)

Fixed submission:
N, K = map(int, input().split())
h = sorted(list(int(input()) for _ in range(N)))
fin = h[K-1] - h[0]
for i in range(1, N-K+1):
  t = h[i+K-1] - h[i]
  if fin > t :
    fin = t
print(fin)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = [(int(input()) for _ in range(N)]
fin = h[K-1] - h[0]
for i in range(1, N-K+1):
  t = h[i+K-1] - h[i]
  if fin > t :
    fin = t
print(fin)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = [(int(input()) for _ in range(N)]
fin = h[K-1] - h[0]
for i in range(1, N-K+1):
  t = h[i+K-1] - h[i]
  if fin > t :
    fin = t
print(fin)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = [(int(input()) for _ in range(N))]
fin = h[K-1] - h[0]
for i in range(1, N-K+1):
  t = h[i+K-1] - h[i]
  if fin > t :
    fin = t
print(fin)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
h = [list(int(input()) for _ in range(N))]
fin = h[K-1] - h[0]
for i in range(1, N-K+1):
  t = h[i+K-1] - h[i]
  if fin > t :
    fin = t
print(fin)
Problem p03745 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
count = 0
up = 0
down = 0
before = A[0]
tmp = 0
for i in range(1,N):
  tmp = A[i]
  if (up == 0) and (down == 0):
    if tmp > before:
      up = 1
      before = tmp
    elif tmp < before:
      down = 1
      before = tmp
    else:
      continue
  elif up == 1:
    if tmp < before:
      count += 1
      up = 0
      before = tmp
    else:
      before = tmp
  elif down == 1:
    if tmp > before:
      count += 1
      down = 0
      before = tmp
    else:
      before = tmp
count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
count = 0
up = 0
down = 0
before = A[0]
tmp = 0
for i in range(1,N):
  tmp = A[i]
  if (up == 0) and (down == 0):
    if tmp > before:
      up = 1
      before = tmp
    elif tmp < before:
      down = 1
      before = tmp
    else:
      continue
  elif up == 1:
    if tmp < before:
      count += 1
      up = 0
      before = tmp
  elif down = 1:
    if tmp > before:
      count += 1
      down = 0
      before = tmp
count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
count = 0
up = 0
down = 0
before = A[0]
tmp = 0
for i in range(1,N):
  tmp = A[i]
  if (up == 0) and (down == 0):
    if tmp > before:
      up = 1
      before = tmp
    elif tmp < before:
      down = 1
      before = tmp
    else:
      continue
  elif up == 1:
    if tmp < before:
      count += 1
      up = 0
      before = tmp
  elif down = 1:
    if tmp > before:
      count += 1
      down = 0
      before = tmp
count += 1
print(count)
Problem p03805 (python)

Fixed submission:
#深さ優先探索
N, M = map(int,input().split())
graph = [[] for j in range(N)]
for i in range(M):
  a, b = map(int,input().split())
  graph[a-1].append(b-1)
  graph[b-1].append(a-1)
judge = [False]*N
judge[0] = True

def dfs(v,judge):#vは今いる場所
  if all(judge):
    return 1
  res = 0
  for nv in graph[v]:#vと隣り合っている場所
    if judge[nv]:#すでに探索済み
      continue #if文の初めに戻る
    judge[nv] = True
    res += dfs(nv,judge)
    judge[nv] = False
  return res
print(dfs(0,judge))

Buggy submission (verdict: Runtime Error):
#深さ優先探索
N, M = map(int,input().split())
graph = [[] for j in range(N)]
for i in range(M):
  a, b = map(int,input().split())
  graph[a-1].append(b-1)
  graph[b-1].append(a-1)
judge = [False]*N

def dfs(v,judge):#vは今いる場所
  if all(judge):
    return 1
  res = 0
  for nv in graph(v):#vと隣り合っている場所
    if judge[nv] == True:#すでに探索済み
      continue #if文の初めに戻る
    judge[nv] = True
    res += dfs(nv,judge)
    judge[nv] = False
  return res
print(dfs(0,judge))
Problem p02699 (python)

Fixed submission:

def main():
    s, w = map(int, input().split())
    if w >= s:
        print('unsafe')
    else:
        print('safe')


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    s, w = map(int, input())
    if w >= s:
        print('unsafe')
    else:
        print('safe')


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    s, w = map(int, input())
    if w >= s:
        print('unsafe')
    else:
        print('safe')


if __name__ == "__main__":
    main()
Problem p02759 (python)

Fixed submission:

def main():
    n = int(input())
    if n % 2 == 1:
        print(n // 2 + 1)
    else:
        print(n // 2)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    n = int(input())
    if n % 2 = 1:
        print(n // 2 + 1)
    else:
        print(n / 2)


if __name__ == "__main__":
    main()
Problem p02987 (python)

Fixed submission:

def main():
    s = input()
    s_ = list(set(s))
    if s.count(s_[0]) == 2 and len(s_) == 2:
        print('Yes')
    else:
        print('No')
   

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    s = input()
    s_ = list(set(s))
    if s.count(s_[0]) == 2 and len(s_) == 2i:
        print('Yes')
    else:
        print('No')
   

if __name__ == "__main__":
    main()
Problem p03803 (python)

Fixed submission:

def main():
    a, b = map(int, input().split())
    if a-2 < 0:
        a = 14

    if b-2 < 0:
        b = 14

    if a-2 > b-2:
        print('Alice')
    elif a-2 < b-2:
        print('Bob')
    else:
        print('Draw')


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):

def main():
    a, b = map(int, input().split())
    if a-2 < 0:
        a = 14

    if b-2 < 0:
        b = 14i

    if a-2 > b-2:
        print('Alice')
    elif a-2 < b-2:
        print('Bob')
    else:
        print('Draw')


if __name__ == "__main__":
    main()
Problem p02594 (python)

Fixed submission:
x = float(input())
if x>=30.0:
    print("Yes")
else: print("No")

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

Fixed submission:
a = list(map(int, input().split()))
b = min(a[0] + a[1], a[1] + a[2], a[2] + a[0])
print(b)

Buggy submission (verdict: Runtime Error):
P = input()
Q = input()
R = input()

a = min(P + Q, Q + R, R + P)
print(a)

Buggy submission (verdict: Runtime Error):
P = int(input())
Q = int(input())
R = int(input())

a = min(P + Q, Q + R, R + P)
print(a)
Problem p02595 (python)

Fixed submission:
N,D=input().split(" ")
count=0
for n in range(int(N)):
  x,y=input().split(" ")
  if pow(pow(int(x),2)+pow(int(y),2),0.5)<=int(D):
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N,D=input().split(" ")
count=0
for n in range(int(N)):
  x,y=input().split(" ")
  if pow(pow(x,2)+pow(y,2),0.5)<=int(D):
    count+=1
print(count)
Problem p02594 (python)

Fixed submission:
X=int(input())
if X<30:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
X=input()
if X<30:
    print("No\n")
else:
    print("Yes\n")

Buggy submission (verdict: Runtime Error):
X=input()
if X<30:
    print("No\n")
else:
    print("Yes\n")

Buggy submission (verdict: Runtime Error):
X=input()
if X<30:
    print("NO\n")
else:
    print("YES\n")
Problem p02754 (python)

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

x = n//(b+r)
x1 = n%(b+r)

if b >= x1:
  b_count = x1
else:
  b_count = b

print(x*b + b_count)

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

s_b = ['b']*b
s_r = ['r']*r
l = []
for i in range(1000):
  l+=(s_b + s_r)

print(l[0:n].count('b'))
Problem p02594 (python)

Fixed submission:
X = input()

X = int(X)

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

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

if X >= 40:
    print('YES')
else:
    print('NO')
Problem p02595 (python)

Fixed submission:
import numpy as np

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

for i in range(N): 
    x,y = input().split()
    x = int(x)
    y = int(y)
    d = np.sqrt(x**2+y**2)

    if d <= D:
        count += 1 

print(count)

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

N = int(input())
D = int(input())
count = 0

for i in range(N): 
    x = int(input())
    y = int(input())
    d = np.sqrt(x**2+y**2)

    if d <= D:
        count += 1 

print(count)
Problem p02682 (python)

Fixed submission:
if __name__ == '__main__':
    A =[]
    B = input()
    A = B.split()

    a = int(A[0])
    b = int(A[1])
    c = int(A[2])
    k = int(A[3])

    if a > k:
        print(k)
    elif (a+b) > k:
        print(a)
    else:
        ans = 2*a-k+b
        print(ans)

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    A = input()
    B = input()
    C = input()
    K = input()

    a = int(A)
    b = int(B)
    c = int(C)
    k = int(K)

    if a > k:
        print(k)
    elif (a+b) > k:
        print(a)
    else:
        ans = 2*a-k+b
        print(ans)

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    A = input()
    B = input()
    C = input()
    K = input()

    if A > K:
        print(K)
    elif A+B >K:
        print(A)
    else:
        print(2*A-K-B)

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    A = input()
    B = input()
    C = input()
    K = input()

    if A > K:
        print(K)
    elif A+B >k:
        print(A)
    else:
        print(2*A-K-B)
Problem p02689 (python)

Fixed submission:
if __name__ == '__main__':

    nm = input()
    nm = nm.split()
    n = int(nm[0])
    m = int(nm[1])

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

    AB = []
    ma = [0]*n
    for i in range(m):
        ab = input()
        ab = ab.split()
        ab = list(map(int,ab))
        ma[ab[0]-1] = max(ma[ab[0]-1],h[ab[1]-1])
        ma[ab[1]-1] = max(ma[ab[1]-1],h[ab[0]-1])

    ans = 0
    for i in range(n):
        if h[i] > ma[i]:
            ans += 1
    print(ans)

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':

    nm = input()
    nm = nm.split()
    n = int(nm[0])
    m = int(nm[1])

    h = input()
    h = h.split()
    h = list(map(int,h))
    print(h)
    AB = []
    for i in range(m):
        ab = input()
        ab = ab.split()
        ab = list(map(int,ab))
        AB.append(ab)

    s = set()
    for i in range(m):
        if h[AB[i][0]] > h[AB[i][0]]:
            s.add(AB[i][0])
        else:
            s.add(AB[i][1])

    print(len(s))
Problem p02847 (python)

Fixed submission:
y = ['SUN','MON','TUE','WED','THU','FRI','SAT']
s = input()
for i, j in enumerate(y):
    if s == j:
        print(7-i)
        exit()

Buggy submission (verdict: Runtime Error):
s = input()
for i, j in enumerate(y):
    if s == j:
        print(7-i)
Problem p02712 (python)

Fixed submission:
n = int(input()) + 1
a = set(range(0, n))
fs = set(range(0, n, 3))
bs = set(range(0, n, 5))
print(sum(a - fs - bs))

Buggy submission (verdict: Runtime Error):
print("Yes" if input().find("7") >= 0 else "No")
n = int(input()) + 1
a = set(range(0, n))
fs = set(range(0, n, 3))
bs = set(range(0, n, 5))
print(sum(a - fs - bs))
Problem p02594 (python)

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

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

Buggy submission (verdict: Runtime Error):
X = input()
 
if 30 =< X :
	print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
X = input()
 
if 30 <= X :
	print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
X=input(
if 30<=X :
	print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
X=input()
 
if 30<=X :
	print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
X=input()
 
if 30<=X :
  print("Yes")
else :
  print("No")

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

Buggy submission (verdict: Runtime Error):
X=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 p02595 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
D = int(input())
an=0
for _ in range(N):
  X, Y= map(int, input().split())
  if X**2+Y**2<=D**2:
    an +=1
print(an)

Buggy submission (verdict: Runtime Error):
N = int(input())
D = int(input())
an=0
for i in range(N):
  X, Y= map(int, input().split())
  if X**2+Y**2<=D**2:
    an +=1
print(an)