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

Fixed submission:
import sys
sys.setrecursionlimit(1000000000)
input = sys.stdin.readline
n= int(input())
bd = [[] for _ in range(n)]
for i in range(n-1):
    a,b,c= map(int,input().split())
    bd[a-1].append((b-1,c))
    bd[b-1].append((a-1,c))
q,k= map(int,input().split())
cost = [0] * n
def dfs(curnode,pre,addcost):
    for abr in bd[curnode]:
        if abr[0]!=pre:
            cost[abr[0]]=addcost+abr[1]
            dfs(abr[0],curnode,addcost+abr[1])
dfs(k-1,-1,0)
for i in range(q):
    x,y= map(int,input().split())
    print(cost[x-1]+cost[y-1])

Buggy submission (verdict: Runtime Error):
n= int(input())
branchdict = {}
for i in range(n-1):
    a,b,c= map(int,input().split())
    branchdict[a-1] = branchdict.get(a-1,[]) + [(b-1,c)]
    branchdict[b-1] = branchdict.get(b-1,[]) + [(a-1,c)]
q,k= map(int,input().split())
cost = [0] * n
def dfs(curnode,pre,addcost):
    cost[curnode]=addcost
    if curnode in branchdict.keys():
        for abr in branchdict[curnode]:
            if abr[0]!=pre:
                dfs(abr[0],curnode,addcost+abr[1])
dfs(k-1,-1,0)
for i in range(q):
    x,y= map(int,input().split())
    print(cost[x-1]+cost[y-1])

Buggy submission (verdict: Runtime Error):
n= int(input())
branchdict = {}
for i in range(n-1):
    a,b,c= map(int,input().split())
    branchdict[a-1] = branchdict.get(a-1,[]) + [(b-1,c)]
    branchdict[b-1] = branchdict.get(b-1,[]) + [(a-1,c)]
q,k= map(int,input().split())
cost = [0] * n
def dfs(curnode,pre,addcost):
    cost[curnode]=addcost
    passedf[curnode]=True
    if curnode in branchdict.keys():
        for abr in branchdict[curnode]:
            if abr[0]!=pre:
                dfs(abr[0],curnode,addcost+abr[1])
dfs(k-1,-1,0)
for i in range(q):
    x,y= map(int,input().split())
    print(cost[x-1]+cost[y-1])

Buggy submission (verdict: Runtime Error):
n= int(input())
branchdict = {}
for i in range(n-1):
    a,b,c= map(int,input().split())
    branchdict[a-1] = branchdict.get(a-1,[]) + [(b-1,c)]
    branchdict[b-1] = branchdict.get(b-1,[]) + [(a-1,c)]
q,k= map(int,input().split())
passedf = [False] * n
cost = [0] * n
def dfs(curnode,addcost):
    cost[curnode]=addcost
    passedf[curnode]=True
    if curnode in branchdict.keys():
        for abr in branchdict[curnode]:
            if not passedf[abr[0]]:dfs(abr[0],addcost+abr[1])
dfs(k-1,0)
for i in range(q):
    x,y= map(int,input().split())
    print(cost[x-1]+cost[y-1])

Buggy submission (verdict: Runtime Error):
n= int(input())
branchdict = {}
for i in range(n-1):
    a,b,c= map(int,input().split())
    branchdict[a-1] = branchdict.get(a-1,[]) + [(b-1,c)]
    branchdict[b-1] = branchdict.get(b-1,[]) + [(a-1,c)]
q,k= map(int,input().split())
passed = set()
cost = [0] * n
def dfs(curnode,addcost):
    cost[curnode]=addcost
    passed.add(curnode)
    for abr in branchdict[curnode]:
        if not abr[0] in passed:dfs(abr[0],addcost+abr[1])
dfs(k-1,0)
for i in range(q):
    x,y= map(int,input().split())
    print(cost[x-1]+cost[y-1])
Problem p03805 (python)

Fixed submission:
N,M = map(int,input().split())
if M == 0:
    print(0)
else:
    l = [[0 for _ in range(N)] for _ in range(N)]
    for _ in range(M):
        a,b = map(int,input().split())
        l[a-1][b-1] = 1
        l[b-1][a-1] = 1
    g = 0
    def dfs(a,route):
        global g
        if len(route) == N:g += 1
        else:
            for i in range(N):
                if a == i:pass
                else:
                    if l[a][i] == 1 and (not i in route):
                        dfs(i,route+[i])
    dfs(0,[0])
print(g)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
if M == 0:
    print(0)
else:
    l = [[0 for _ in range(M)] for _ in range(M)]
    for _ in range(M):
        a,b = map(int,input().split())
        l[a-1][b-1] = 1
        l[b-1][a-1] = 1
    g = 0
    def dfs(a,route):
        global g
        if len(route) == N:g += 1
        else:
            for i in range(N):
                if a == i:pass
                else:
                    if l[a][i] == 1 and (not i in route):
                        dfs(i,route+[i])
    dfs(0,[0])
print(g)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
l = [[0 for _ in range(M)] for _ in range(M)]
for _ in range(M):
    a,b = map(int,input().split())
    l[a-1][b-1] = 1
    l[b-1][a-1] = 1
g = 0
def dfs(a,route):
    global g
    if len(route) == N:g += 1
    else:
        for i in range(N):
            if a == i:pass
            else:
                if l[a][i] == 1 and (not i in route):dfs(i,route+[i])
dfs(0,[0])
print(g)
Problem p02933 (python)

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

if a >= 3200:
    print(s)
else:
    print("red")

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

if a >= 3200:
    print(s)
else:
    print("red")
Problem p02577 (python)

Fixed submission:
N=int(input())
if N%9 == 0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N=int(imput())
if N%9 == 0:
  print("Yes")
else:
  print("No")
Problem p02595 (python)

Fixed submission:
import math

def distance(N, D, point):
    count = 0
    for i in range(N):
        if math.sqrt(points[i][0]**2 + points[i][1]**2) <= D:
            count += 1
    return count


if __name__ == "__main__":
    N, D = map(int, input().split())
    points = []
    for _ in range(N):
        x, y = map(int, input().split())
        points.append([x,y])
    print(distance(N,D,points))

Buggy submission (verdict: Runtime Error):
import math

def distance(N, D, point):
    count = 0
    for i in range(N):
        if math.sqrt(points[i][0]**2 + points[i][1]**2) <= D:
            count += 1
    return count


if __name__ == "__main__":
    N, D = map(int, input().split())
    points = []
    for _ in range(N):
        x, y = map(int, input.split())
        points.append([x,y])
    print(distance(N,D,points))

Buggy submission (verdict: Runtime Error):
def distance(N, D, point):
    count = 0
    for i in range(N):
        if sqrt(points[i][0]**2 + points[i][1]**2) <= D:
            count += 1
    return count


if __name__ == "__main__":
    N, D = map(int, input().split())
    points = []
    for _ in range(N):
        x, y = map(int, input.split())
        points.append([x,y])
    print(distance(N,D,points))
Problem p02707 (python)

Fixed submission:
def management(N,array):
  res = [0]*N
  for i in range(len(array)):
    res[array[i]-1] += 1
  for j in range(len(res)):
    print(res[j])

if __name__ == '__main__':
  N = int(input())
  array = list(map(int,input().split()))
  management(N,array)

Buggy submission (verdict: Runtime Error):
def management(N,array):
	res = []
	for i in range(N):
      res[array[i]] += 1
    for j in range(len(res)):
      print(res[j])
     
    
    
N = int(input())
array = list(map(int,input().split())
managememt(N,array))

Buggy submission (verdict: Runtime Error):
def management(N,array):
	res = []
	for i in range(N):
      res[array[i]] += 1
    for j in range(len(res)):
      print(res[j])
     
    
    
N = int(input())
array = list(map(int,input().split())
mamagememt(N,array))
Problem p03242 (python)

Fixed submission:
s = list(input())
 
for i in range(3):
  if s[i] == "1":
    s[i] = "9"
  else:
    s[i] = "1"

print("".join(s))

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

for i in range(3):
  if s[i] == "1":
    s[i] = "9"
  else:
    s[i] = "1"
Problem p02570 (python)

Fixed submission:
d,t,s = map(int,input().split())

if d > t * s :
    print('No')
else:
    print('Yes')

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

if d > t * s :
    print('No')
else:
    print('Yes')
Problem p02725 (python)

Fixed submission:
K, N = map(int, input().split())
A = list(map(int, input().split()))
ans = min(A[-1]-A[0],K-(A[-1]-A[0]))
for i in range(N-1):
  ans = max(ans,A[i+1]-A[i])
print (K-ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
K, N = map(int, input().split())
A = list(map(int, input().split()))
D = np.zeros((N,N))
for i in range(N-1):
  for j in range(i+1,N):
    a = abs(A[i]-A[j])
    D[i][j] = min(a, K-a)
print (K-np.max(D))

Buggy submission (verdict: Runtime Error):
import numpy as np
K, N = map(int, input().split())
A = list(map(int, input().split()))
D = np.zeros((N,N))
for i in range(N-1):
  for j in range(i+1,N):
    a = abs(A[i]-A[j])
    D[i][j] = min(a, K-a)
    D[j][i] = min(a, K-a)
ans = 10 ** 12
print (int(min(np.sum(D, axis=0))))
Problem p02829 (python)

Fixed submission:
A = int(input())
B = int(input())

if A+B == 3:
  print (3)
elif A+B == 4:
  print (2)
else:
  print (1)

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

if A+B = 3:
  print (3)
elif A+B=4:
  print (2)
else:
  print (1)
Problem p02836 (python)

Fixed submission:
S = input()

ans = 0
for i in range(len(S)//2):
  if S[i] != S[len(S)-i-1]: ans += 1
print (ans)

Buggy submission (verdict: Runtime Error):
//aaaaa
aaaaaa//
Problem p02881 (python)

Fixed submission:
N = int(input())
L = []

for i in range(1,int(N ** 0.5)+1):
  if N % i == 0:
    L.append(i + N // i)
print (min(L)-2)

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

for i in range(1,int(N ** 0.5)):
  if N % i == 0:
    L.append(i + N // i)
print (min(L)-2)
Problem p02912 (python)

Fixed submission:
import heapq
N, M = map(int, input().split())
A = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(A)

while M:
  m = heapq.heappop(A) * (-1)
  heapq.heappush(A, (-1) * (m // 2))
  M -= 1
print (sum(A) * (-1))

Buggy submission (verdict: Runtime Error):
import bisect
import sys
N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))

if N == 1:
  print (int(A[0] // 2 ** M))
  sys.exit()
while M:
  A[-1] //= 2
  if A[-1] < A[-2]:
    d = A[-1]
    b = bisect.bisect(A,d) 
    A[b+1:] = A[b:-1]
    A[b] = d
  M -= 1
print (sum(A))
Problem p02984 (python)

Fixed submission:
import numpy as np

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

X = [0]*N
X[0] = sum(A) - 2 * (sum(A[1:N-1:2]))
for i in range(1, N):
  X[i] = 2 * A[i-1] - X[i-1]
print (' '.join(map(lambda x: str(x), X)))

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

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

if N == 1:
  print (sum(A))
else:
  C = np.zeros((N, N))

  for i in range(N-1):
    C[i][i] = 0.5
    C[i+1][i] = 0.5

  C[0][N-1] = 0.5
  C[N-1][N-1] = 0.5

  Cin = np.linalg.inv(C)
  B = np.dot(A , Cin)

  print (' '.join(map(lambda x: str(int(x)),B)))

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

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

C = np.zeros((N, N))

for i in range(N-1):
  C[i][i] = 0.5
  C[i+1][i] = 0.5

C[0][N-1] = 0.5
C[N-1][N-1] = 0.5

Cin = np.linalg.inv(C)
B = np.dot(A , Cin)

print (int(B[0]), end = "")
for i in range(1,N):
  print ( " " + str(int(B[i])), end = "")
Problem p03104 (python)

Fixed submission:
import sys
import math
A, B = map(int, input().split())

def nXor(n):
  if n % 2 == 0:
    if (n//2) % 2 == 0:
      return 0 ^ n
    else:
      return 1 ^ n
  else:
    if ((n+1)//2) % 2 == 0:
      return 0
    else:
      return 1
n = 0
for i in range(9):
  n = n^i
print (nXor(A-1) ^ nXor(B))

Buggy submission (verdict: Runtime Error):
import sys
import math
A, B = map(int, input().split())
if A == B:
  print (A)
  sys.exit()

def xor(a, b):
  r = ""
  for i in range(len(a)):
    if a[i] == "0" and b[i] == "0" or a[i] == "1" and b[i] == "1":
      r += "0"
    else:
      r += "1"
  return r

S = "0" * 50
def xorn(S, n):
  m = int(math.log2(n))
  b = n - 2 ** m
#  print (S[0:-m-1],1,S[-m-1:-1],m,b)
  S = S[0:-m-1] + "1" + S[-m-1:-1]
  if b == 0:
    return S
  return xorn(S, b)

s = int("0b" + xor(xorn(S, A-1), xorn(S, B)), 0)
print (s+1 if (B-A) % 2 == 1 else s)

Buggy submission (verdict: Runtime Error):
import sys
import math
A, B = map(int, input().split())
if A == B:
  print (A)
  sys.exit()

def xor(a, b):
  r = ""
  for i in range(len(a)):
    if a[i] == "0" and b[i] == "0" or a[i] == "1" and b[i] == "1":
      r += "0"
    else:
      r += "1"
  return r

S = "0" * 50
def xorn(S, n):
  m = int(math.log2(n))
  b = n - 2 ** m
#  print (S[0:-m-1],1,S[-m-1:-1],m,b)
  S = S[0:-m-1] + "1" + S[-m-1:-1]
  if b == 0:
    return S
  return xorn(S, b)

print (int("0b" + xor(xorn(S, A), xorn(S, B)), 0))

Buggy submission (verdict: Runtime Error):
import sys
import math
A, B = map(int, input().split())
if A == B:
  print (A)
  sys.exit()

def xor(a, b):
  r = ""
  for i in range(len(a)):
    if a[i] == "0" and b[i] == "0" or a[i] == "1" and b[i] == "1":
      r += "0"
    else:
      r += "1"
  return r

S = "0" * 40
def xorn(S, n):
  m = int(math.log2(n))
  b = n - 2 ** m
#  print (S[0:-m-1],1,S[-m-1:-1],m,b)
  S = S[0:-m-1] + "1" + S[-m-1:-1]
  if b == 0:
    return S
  return xorn(S, b)

print (int("0b" + xor(xorn(S, A-1), xorn(S, B)), 0))

Buggy submission (verdict: Runtime Error):
import sys
import math
A, B = map(int, input().split())
if A == B:
  print (A)
  sys.exit()

def xor(a, b):
  r = ""
  for i in range(len(a)):
    if a[i] == "0" and b[i] == "0" or a[i] == "1" and b[i] == "1":
      r += "0"
    else:
      r += "1"
  return r

S = "0" * 10
def xorn(S, n):
  m = int(math.log2(n))
  b = n - 2 ** m
#  print (S[0:-m-1],1,S[-m-1:-1],m,b)
  S = S[0:-m-1] + "1" + S[-m-1:-1]
  if b == 0:
    return S
  return xorn(S, b)

print (int("0b" + xor(xorn(S, A-1), xorn(S, B)), 0))
Problem p03137 (python)

Fixed submission:
import sys
N, M = map(int, input().split())
X = sorted(list(map(int, input().split())))

if M == 1:
  print (0)
  sys.exit()
Y = []
for i in range(M-1):
  Y.append(X[i+1]-X[i])
Y = sorted(Y)
for i in range(N-1):
  if len(Y) == 0:
    print (0)
    sys.exit()
  Y.pop()
print (sum(Y))

Buggy submission (verdict: Runtime Error):
import sys
N, M = map(int, input().split())
X = sorted(list(map(int, input().split())))

if M == 1:
  print (0)
  sys.exit()
Y = []
for i in range(M-1):
  Y.append(X[i+1]-X[i])
Y = sorted(Y)
for i in range(N-1):
  Y.pop()
print (sum(Y))
Problem p03634 (python)

Fixed submission:
from collections import defaultdict as dd
from collections import deque
N = int(input())
D =dd(list)
for i in range(N-1):
  a, b, c = map(int, input().split())
  D[a-1].append((b-1, c))
  D[b-1].append((a-1, c))

Q, K = map(int, input().split())
K -= 1
L = [0 for _ in range(N)]
q = deque([])
q.append(K)
while len(q) > 0:
  a = q.pop()
  for b, c in D[a]:
    if L[b] == 0:
      L[b] = L[a] + c
      q.append(b)

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

Buggy submission (verdict: Runtime Error):
from scipy.sparse.csgraph import shortest_path, dijkstra
import numpy as np

N = int(input())
L = np.zeros((N,N))
for i in range(N-1):
  a, b, c = map(int, input().split())
  L[a-1][b-1] = c
  L[b-1][a-1] = c

Q, K = map(int, input().split())
K -= 1
L1 = dijkstra(L, indices = K)
for i in range(Q):
  x, y = map(int, input().split())
  x -= 1
  y -= 1

  print (int(L1[x] + L1[y]))

Buggy submission (verdict: Runtime Error):
import numpy as np
from scipy.sparse.csgraph import floyd_warshall
from scipy.sparse import csr_matrix
N = int(input())
L = np.full((N, N), np.inf)
for i in range(N-1):
  a, b, c = map(int, input().split())
  L[a-1][b-1] = c
  L[b-1][a-1] = c
L = csr_matrix(L)
L = floyd_warshall(L, 0)
print (L)
Q, K = map(int, input().split())
K -= 1
for i in range(Q):
  x, y = map(int, input().split())
  x -= 1
  y -= 1
  print (int(L[x][K] + L[K][y]))

Buggy submission (verdict: Runtime Error):
import numpy as np
from scipy.sparse.csgraph import shortest_path, floyd_warshall
N = int(input())
L = np.full((N, N), np.inf)
for i in range(N-1):
  a, b, c = map(int, input().split())
  L[a-1][b-1] = c
  L[b-1][a-1] = c
L = floyd_warshall(L, 0)
Q, K = map(int, input().split())
K -= 1
for i in range(Q):
  x, y = map(int, input().split())
  x -= 1
  y -= 1
  print (int(L[x][K] + L[K][y]))

Buggy submission (verdict: Runtime Error):
import numpy as np
from scipy.sparse.csgraph import shortest_path
N = int(input())
L = np.full((N, N), np.inf)
for i in range(N-1):
  a, b, c = map(int, input().split())
  L[a-1][b-1] = c
  L[b-1][a-1] = c
L = shortest_path(L)
Q, K = map(int, input().split())
K -= 1
for i in range(Q):
  x, y = map(int, input().split())
  x -= 1
  y -= 1
  print (int(L[x][K] + L[K][y]))
Problem p02682 (python)

Fixed submission:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

a, b, c, k = readmi()
s = min(a, k)
k -= a
if k <= 0:
    print(s)
    exit()
k -= b
if k <= 0:
    print(s)
    exit()
s -= k
print(s)

Buggy submission (verdict: Runtime Error):
a, b, c, k = map(int, input().split())
s = 0
for in range(k):
  if a > 0:
    s += 1
    a -= 1
  elif b > 0:
    b += 0
  else:
    s += -1
print(s)
Problem p03127 (python)

Fixed submission:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import fractions
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *
 
n = int(input())
a = list(map(int, input().split()))
a = deque(sorted(a))
ans = 0
for i in a:
    ans = fractions.gcd(ans, i)
print(ans)

Buggy submission (verdict: Runtime Error):
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *
 
n = int(input())
a = list(map(int, input().split()))
a = deque(sorted(a))
ans = 0
for i in a:
    ans = math.gcd(ans, i)
print(ans)
Problem p02725 (python)

Fixed submission:
k,n = list(map(int,input().split()))
arr = list(map(int,input().split()))
max_d = k-arr[-1] + arr[0]
for i in range(n-1):
  max_d = max(max_d,arr[i+1]-arr[i])
print(k-max_d)

Buggy submission (verdict: Runtime Error):
n,k, = list(map(int,input().split()))
arr = list(map(int,input().split()))
max_d = k-arr[-1] + arr[0]
for i in range(n):
  max_d = max(max_d,arr[i+1]-arr[i])
print(k-max_d)

Buggy submission (verdict: Runtime Error):
n,k = list(map(int,input().split()))
arr = list(map(int,input().split()))
max_d = k-arr[-1] + arr[0]
for i in range(n):
  max_d = max(max_d,arr[i+1]-arr[i])
print(k-max_d)
Problem p03242 (python)

Fixed submission:
n=input()


ans=""

if n[0]=="1":
	ans=ans+"9"
else:
	ans=ans+"1" 

if n[1]=="1":
	ans=ans+"9"
else:
	ans=ans+"1" 

if n[2]=="1":
	ans=ans+"9"
else:
	ans=ans+"1"


print(ans)

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


ans=""

if n[0]=="1":
ans=ans+"9"
else:
ans=ans+"1" 

if n[1]=="1":
ans=ans+"9"
else:
ans=ans+"1" 


if n[2]=="1":
ans=ans+"9"
else:
ans=ans+"1"


print(ans)
Problem p03327 (python)

Fixed submission:
N=int(input())

if 1<=N<=999:
	print("ABC")
elif 999<N<=1998:
 	print("ABD")

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

if =1<N<=999:
	print("ABC")
elif 999<N<=1998:
 	print("ABD")
Problem p02570 (python)

Fixed submission:
D,T,S = map(int,input().split())

if D <= T*S:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
D,T,S = map(int,input().split)

if D <= T*S:
    print("Yes")
else:
    print("No")
Problem p02682 (python)

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

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

if K<=A:
  print(str(K))
elif k<=A+B:
  print(str(A))
else:
  print(str(A-(C-(k-(A+B))))

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

if K<=A:
  print(K)
elif k<=A+B:
  print(A)
else:
  print(A-(C-(k-(A+B)))

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

if K<=A:
  print(K)
elif k<=A+B:
  print(A)
else:
  print(A-(C-(k-(A+B)))
Problem p02711 (python)

Fixed submission:
N = str(input())
if N[0] == "7" or N[1] == "7" or N[2] == "7":
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = str(input())
if str[0] == "7" or str[1] == "7" or str[2] == "7":
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = str(input())
if str[0] == 7 or str[1] == 7 or str[2] == 7:
  print("Yes")
else:
  print("No")
Problem p02712 (python)

Fixed submission:
N = int(input())
 
k = N // 3
l = N // 5
m = N // 15
 
sum = (N * (N + 1) / 2) - (3* k * (k + 1) / 2) - (5* l * (l + 1) / 2) + (15* m * (m + 1) / 2)
print(int(sum))

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

k = N // 3
l = N // 5
m = N // 15

sum = (N * (N + 1) / 2) - (3 * (-1 + 3**k)/2) - (5 * (-1 + 5**l)/4) + (15 * (-1 + 15**k)/14)
print(sum)
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()
print(S[:k-1] + S[K-1].lower() + S[k-2:])
Problem p02753 (python)

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

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

info = np.array(input().split(" "), dtype="int64")
o = info[1] + info[2]
if o == 0:
    print(0)
else:
    q, mod = divmod(info[0], o)
    if mod > info[1]:
        print((q+1)* info[1])
    else:
        print(q*info[1] + mod)

Buggy submission (verdict: Runtime Error):
import numpy as np
s = np.array(list(input()))
if s[0] == s[1] and s[1] == s[2]:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
import numpy as np
s = np.array(list(input()))
if s[0] == s[1] and s[1] == s[2]:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
import numpy as np
s = np.array(input().split())
if s[0] == s[1] and s[1] == s[2]:
    print("No")
else:
    print("Yes")
Problem p02754 (python)

Fixed submission:
inf = input().split()
info = list(map(int, inf))
o = info[1] + info[2]
if o == 0:
    print(0)
else:
    q, mod = divmod(info[0], o)
    if mod > info[1]:
        print((q+1)* info[1])
    else:
        print(q*info[1] + mod)

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

info = np.array(input().split(" "), dtype="int64")
o = info[1] + info[2]
if o == 0:
    print(0)
else:
    q, mod = divmod(info[0], o)
    if mod > info[1]:
        print((q+1)* info[1])
    else:
        print(q*info[1] + mod)
Problem p02777 (python)

Fixed submission:
import numpy as np
 
color = input().split(" ")
count = np.array(input().split(" "), dtype="int64")
choose = input()
 
a = color.index(choose)
count[a] -= 1
print(count[0], end=" ")
print(count[1])

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

color = input().split(" ")
count = np.array(input().split(" "), dtype="int64")
choose = input()

a = color.index(choose)
count[a] -= 1
print(f"{count[0]} {count[1]}")