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

Fixed submission:
n,m = map(int,input().split())
ali = [int(input()) for _ in range(m)]
dif = []
cap = 0
for num in ali:
  dif.append(num-cap)
  cap = num
dif.append(n-cap+1)
dif[0] += 1
ref = [0,0,1,1]
a,b = 1,1
for i in range(100000):
  a,b = b,a+b 
  ref.append(b)
ans = 1
for num in dif:
  ans *= (ref[num] % 1000000007)
print(ans % 1000000007)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
ali = [int(input()) for _ in range(m)]
dif = []
cap = 0
for num in ali:
  dif.append(num-cap)
  cap = num
dif.append(n-cap+1)
dif[0] += 1
ref = [0,0,1,1]
a,b = 1,1
for i in range(5000):
  a,b = b,a+b
  ref.append(b)
ans = 1
for num in dif:
  ans *= ref[num]
print(ans % 1000000007)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
ali = [int(input()) for _ in range(m)]
dif = []
cap = 0
for num in ali:
  dif.append(num-cap)
  cap = num
dif.append(n-cap+1)
dif[0] += 1
ref = [0,0,1,1]
a,b = 1,1
if m <= 10000:
  nnn = 1000
else:
  nnn = 100000
for i in range(nnn):
  a,b = b,a+b 
  ref.append(b)
ans = 1
for num in dif:
  ans *= (ref[num] % 1000000007)
print(ans % 1000000007)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
ali = [int(input()) for _ in range(m)]
dif = []
cap = 0
for num in ali:
  dif.append(num-cap)
  cap = num
dif.append(n-cap+1)
dif[0] += 1
ref = [0,0,1,1]
a,b = 1,1
if m <= 10000:
  nnn = 1000
else:
  nnn = 100000
for i in range(nnn):
  a,b = b,a+b 
  ref.append(b)
ans = 1
for num in dif:
  ans *= (ref[num] % 1000000007)
print(ans % 1000000007)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
ali = [int(input()) for _ in range(m)]
dif = []
cap = 0
for num in ali:
  dif.append(num-cap)
  cap = num
dif.append(n-cap+1)
dif[0] += 1
ref = [0,0,1,1]
a,b = 1,1
if m <= 10000:
  nnn = 1000
else:
  nnn = 20000
for i in range(nnn):
  a,b = b,a+b
  ref.append(b)
ans = 1
for num in dif:
  ans *= ref[num]
print(ans % 1000000007)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
ali = [int(input()) for _ in range(m)]
dif = []
cap = 0
for num in ali:
  dif.append(num-cap)
  cap = num
dif.append(n-cap+1)
dif[0] += 1
ref = [0,0,1,1]
a,b = 1,1
for i in range(5000):
  a,b = b,a+b
  ref.append(b)
ans = 1
for num in dif:
  ans *= ref[num]
print(ans % 1000000007)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
ali = [int(input()) for _ in range(m)]
dif = []
cap = 0
for num in ali:
  dif.append(num-cap)
  cap = num
dif.append(n-cap+1)
dif[0] += 1
ref = [0,0,1,1]
a,b = 1,1
for i in range(1000):
  a,b = b,a+b
  ref.append(b)
ans = 1
for num in dif:
  ans *= ref[num]
print(ans % 1000000007)
Problem p03045 (python)

Fixed submission:
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.root = [-1]*(n+1)
		self.rank = [0]*(n+1)

	def find(self, x):
		if(self.root[x] < 0):
			return x
		else:
			self.root[x] = self.find(self.root[x])
			return self.root[x]
			
	def unite(self, x, y):
		x = self.find(x)
		y = self.find(y)
		if(x == y):
			return 0
		elif(self.rank[x] > self.rank[y]):
			self.root[x] += self.root[y]
			self.root[y] = x
		else:
			self.root[y] += self.root[x]
			self.root[x] = y
			if(self.rank[x] == self.rank[y]):
				self.rank[y] += 1
	
	def f(self, x):
		return self.root[x] < 0
		
n,m,*l=map(int,open(0).read().split())
uf=UnionFind(n)
for i,j in zip(l[::3],l[1::3]):
	uf.unite(i,j)
print(sum(uf.f(i) for i in range(1,n+1)))

Buggy submission (verdict: Runtime Error):
from functools import lru_cache
import sys
sys.setrecursionlimit(200000)

n,m,*l=map(int,open(0).read().split())
graph=[[]*n for _ in range(n)]
unvis=[True]*n

@lru_cache(maxsize=None)
def dfs(x):
	for y in graph[x]:
		if unvis[y]:
			unvis[y]=False
			dfs(y)
			
for i,j in zip(l[::3],l[1::3]):
	graph[i-1].append(j-1)
	graph[j-1].append(i-1)

ans=0
for x in range(n):
	if unvis[x]:
		unvis[x]=False
		dfs(x)
		ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
def input(): return sys.stdin.readline().strip()
n,m = map(int,input().split())
s = [input().split() for i in range(m)]
li = [[s[0][0],s[0][1]]]
del s[0]
for item in s:
  num_1 = item[0]
  num_2 = item[1]
  for group in li:
    if num_1 in group and num_2 in group:
      flag=0
      pass
      break
    elif num_1 in group:
      group.append(num_2)
      flag=0
      break
    elif num_2 in group:
      group.append(num_1)
      flag=0
      break
    else:
      flag = 1
  if flag:
    li.append([num_1,num_2])
count = 0
for j in li:
  count += len(j)-1
print(n-count)
Problem p03295 (python)

Fixed submission:
def solve():
	n,m,*t=map(int,open(0).read().split())
	r=sorted([(b,a)for a,b in zip(*[iter(t)]*2)])
	c=bef=0
	for b,a in r:
		if a>bef:
			c+=1
			bef=b-1
	print(c)
if __name__=="__main__":solve()

Buggy submission (verdict: Runtime Error):
class BIT():
	def __init__(self, n):
		self.n = n
		self.bit = [0]*(n+1)
	
	def getsum(self, k):
		ret = 0
		while k:
			ret += self.bit[k]
			k -= k&-k
		return ret
		
	def p_sum(self, i, j):
		return self.getsum(j)-self.getsum(i-1)
		
	def add(self, k, x):
		while k <= n:
			self.bit[k] += x
			k += k&-k

n,m,*t=map(int,open(0).read().split())
q=sorted([(a,b) for a,b in zip(*[iter(t)]*2)],key=lambda x:x[1]-x[0])
bit=BIT(n-1)
c=0
for a,b in q:
	if bit.p_sum(a,b-1)==0:
		bit.add(a,1)
		bit.add(b-1,1)
		c+=1
print(c)
Problem p03307 (python)

Fixed submission:
n=int(input());print(n*(n%2+1))

Buggy submission (verdict: Runtime Error):
n,*l=map(int,open(0).read().split())
a=sum(l[i]-i-1for i in range(n))//n
f=lambda x:sum(abs(l[i]-i-1-x)for i in range(n))
print(min(f(a-1),f(a),f(a+1)))
Problem p03332 (python)

Fixed submission:
N, A, B, K = map(int, input().split())
mod = 998244353
m = N

fac = [1] * (m + 1)
inv = [1] * (m + 1)
for i in range(1, m + 1):
	fac[i] = fac[i - 1] * i % mod
inv[-1] = pow(fac[-1], mod - 2, mod)
for i in range(m - 1, -1, -1):
	inv[i] = inv[i + 1] * (i + 1) % mod

def cmb(n, r):
	assert n >= r >= 0
	return fac[n] * inv[n - r] * inv[r] % mod

ans = 0
for r in range(N + 1):
	if (K - A * r) % B == 0:
		b = (K - A * r) // B
		if 0 <= b <= N:
			ans += cmb(N, r) * cmb(N, (K - A * r) // B)
			ans %= mod
print(ans)

Buggy submission (verdict: Runtime Error):
def mod_cmb(n, r, mod=10 ** 9 + 7):
	assert n >= r >= 0

	def ex_euclid(x, y):
		a, b = 1, 0
		while y != 0:
			a, b = b, (a - x // y * b)
			x, y = y, x % y
		return a

	p = q = 1
	for i in range(n - r + 1, n + 1):
		p *= i
		p %= mod
	for i in range(2, r + 1):
		q *= i
		q %= mod
	p *= ex_euclid(q, mod)
	p %= mod
	return p

N, A, B, K = map(int, input().split())
mod = 998244353
ans = 0
for r in range(N + 1):
	if (K - A * r) % B == 0:
		ans += mod_cmb(N, r, mod) * mod_cmb(N, (K - A * r) // B, mod)
		ans %= mod
print(ans)

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

def cmb(n, r):
	if n < r: return 0
	if r == 0 or n - r == 0: return 1
	r = min(n - r, r)
	u = reduce(mul, range(n, n - r, -1))
	d = reduce(mul, range(1, r + 1))
	return u // d % mod

N, A, B, K = map(int, input().split())
mod = 998244353
ans = 0
for r in range(N + 1):
	if (K - A * r) % B == 0:
		ans += cmb(N, r) * cmb(N, (K - A * r) // B)
		ans %= mod
print(ans)
Problem p03426 (python)

Fixed submission:
h,w,d,*l=map(int,open(0).read().split())
s=h*w
x=[0]*(s+1)
y=[0]*(s+1)
for i,a in enumerate(l[:s]):
	x[a]=i//w
	y[a]=i%w
ref=[0]*(s+1)
for i in range(d+1,s+1):
	ref[i]=ref[i-d]+abs(x[i]-x[i-d])+abs(y[i]-y[i-d])
for l,r in zip(l[s+1::2],l[s+2::2]):
	print(ref[r]-ref[l])

Buggy submission (verdict: Runtime Error):
h,w,d,*l=map(int,open(0).read().split())
s=h*w+1;x=[0]*s;y=[0]*s;k=[0]*s
for i,a in enumerate(l[:s]):x[a]=i//w;y[a]=i%w
for i in range(d+1,s-1):k[i]=k[i-d]+abs(x[i]-x[i-d])+abs(y[i]-y[i-d])
for l,r in zip(l[s::2],l[s+1::2]):print(k[r]-k[l])
Problem p03250 (python)

Fixed submission:
if __name__ == '__main__':
    A, B, C = list(map(int, input().split()))
    if A >= B and A >= C:
        print(10*A+B+C)
    elif B >= A and B>=C:
        print(B*10+A+C)
    else:
        print(C*10+A+B)

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    S = list(input())
    T = list(input())

    letter = []
    for i in range(len(S)):
        letter.append(T[i])                                                                                                                                                     
        if S[i] == T[i]:
            continue
        else:
            if S[i] in letter:
                break
            else:
                s = S[i]
                for j in range(len(S)):
                    if S[j] == s:
                        S[j] = T[i]
                    elif S[j] == T[i]:
                        S[j] = s

    if S == T:
        print('Yes')
    else:
        print('No')
Problem p03252 (python)

Fixed submission:
if __name__ == '__main__':
    S = list(input())
    T = list(input())

    start = [-1 for i in range(26)]
    stop = [-1 for i in range(26)]

    fail = False
    for i in range(len(S)):
        a = ord(S[i]) - ord('a')
        b = ord(T[i]) - ord('a')

        if start[a] != -1 or stop[b] != -1:
            if start[a] != b or stop[b] != a:
                print('No')
                fail = True
                break
        else:
            start[a] = b
            stop[b] = a

    if not fail:
        print('Yes')

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    S = list(input())
    T = list(input())

    letter = []
    for i in range(len(S)):
        letter.append(T[i])                                                                                                                                                     if S[i] == T[i]:
            continue
        else:
            if S[i] in letter:
                break
            else:
                s = S[i]
                for j in range(len(S)):
                    if S[j] == s:
                        S[j] = T[i]
                    elif S[j] == T[i]:
                        S[j] = s

    if S == T:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    S = list(input())
    T = list(input())

    letter = []
    for i in range(len(S)):
        letter.append(T[i])                                                                                                                                                     if S[i] == T[i]:
            continue
        else:
            if S[i] in letter:
                break
            else:
                s = S[i]
                for j in range(len(S)):
                    if S[j] == s:
                        S[j] = T[i]
                    elif S[j] == T[i]:
                        S[j] = s

    if S == T:
        print('Yes')
    else:
        print('No')
Problem p02627 (python)

Fixed submission:
N = input()
print('A' if N.isupper() else 'a')

Buggy submission (verdict: Runtime Error):
M = int(input())
if M == M.upper():
  print("A")
else:
  print("a")
Problem p02627 (python)

Fixed submission:
n = input()
if n.isupper() == True:
  print('A')
else:
  print('a')

Buggy submission (verdict: Runtime Error):
import re
if len(re.finall('[A-Z]', input()) == 0:
       print('a')
else:
       print('A')
Problem p02682 (python)

Fixed submission:
a,b,c,d = input().split()
if int(d) < int(a):
    print(int(d))
elif int(d) < int(a) + int(b):
    print(int(a) + (int(d) - int(a))* 0)
else:
    res = int(a) - (int(d)-(int(a)+ int(b)))
    print(res)

Buggy submission (verdict: Runtime Error):
a,b,c,d = input().split()
if int(d) < int(a):
    print(int(d))
elif int(d) < int(a) + int(b):
    print(int(a) + (int(d) - int(a))* 0)
else:
    res = int(a) - (int(d)-(int(a)+ int(b)))
    print(res)
~
Problem p02723 (python)

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

Buggy submission (verdict: Runtime Error):
test = input()
for test in 6
 print(test)
Problem p02627 (python)

Fixed submission:
a = input()

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

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

if x.islower():
	an = x.upper()
else:
    an = x.lower()

 print(an)
Problem p02629 (python)

Fixed submission:
n = int(input())
name = ""
 
while(True):
  i = n % 26
  c = "zabcdefghijklmnopqrstuvwxyz"[i]
  name = c + name
  
  if(i==0):
    i=26
  n = int((n-i) / 26)
  if(n==0):
    break
    
print(name)

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

while(True):
  i = n % 26
  n = "abcdefghijklmnopqrstuvwxyz"[i]
  name = n + name
  
  n = (n-i) / 26
  if(n==0):
    break
    
print(name)
Problem p02835 (python)

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

Buggy submission (verdict: Runtime Error):
a =list( map(int, input.split()) )
a = sum(a)
if(a>=22):
  print("bust")
else:
  print("win")

Buggy submission (verdict: Runtime Error):
a =list( map(int, input.split()) )
a = sum(a)
if(a>=22):
  print("bust")
else:
  print("win")
Problem p02836 (python)

Fixed submission:
s = input()
cnt = 0

while(True):
  if(len(s)<=1):
    break
 
  if(s[0] != s[-1]):
    cnt+=1
  s = s[1:-1]
 
  
print(cnt)

Buggy submission (verdict: Runtime Error):
s = input()
cnt = 0
white(True):
  if(len(s)<=1):
    break

  if(s[0] != s[-1]):
    cnt+=1
  s = s[1:-1]

  
print(cnt)
Problem p02627 (python)

Fixed submission:
a = input()

if a.isupper():
    print('A')
else:
    print('a')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# スペース区切りの整数の入力
b, c = map(int, input().split())
# 文字列の入力
s = input()
# 出力
print("{} {}".format(a+b+c, s))
Problem p02693 (python)

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

if b%k == 0: 
  print("OK")
else:
  tmp = b//k
  tmp *= k
  if tmp>=a:
    print("OK")
  else:
    print("NG")

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

if b%k == 0: 
  print(“OK”)
else:
  tmp = b//k
  tmp *= k
  if tmp>=a:
    print("OK")
  else:
    print("NG")
Problem p02699 (python)

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

if s>w: print('safe')
else: print('unsafe')

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

if a <=b:print(“unsafe”)
else:print(“safe”)

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

if a <=b; print(“unsafe”)
else; print(“safe”)
Problem p02836 (python)

Fixed submission:
s = input()
sr = s[::-1]

ans = 0

for i in range(len(s)//2):
  if s[i] != sr[i]:
    ans += 1
    
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
sr = s[::-1]

ans = 0

for i in range(s//2):
  if s[i] != sr[i]:
    ans += 1
    
print(ans)
Problem p03013 (python)

Fixed submission:
N,M = map(int,input().split())
a = set([int(input()) for _ in range(M)])
mod = 10**9+7
dp=[0]*(N+1)
dp[0]=1


for i in range(N):
  if i+1 not in a:
    dp[i+1]+=dp[i]
    dp[i+1] %= mod
  if i+2 <= N and i+2 not in a:
    dp[i+2]+=dp[i]
    dp[i+2]%=mod
  
print(dp[-1])

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
a = [int(input()) for _ in range(M)]

dp = [0]*(N+1)
dp[0]=1
if 1 not in a:dp[1] = 1

for i in range(2,N+1):
  if i in a: continue
  dp[i] =dp[i-1]+dp[i-2]
  print(dp)
print(dp[-1])

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
a = [int(input()) for _ in range(M)]

dp = [0]*(N+1)
if 1 in a: continue
else: dp[1]=1

for i in range(1,N):
  if i in a: continue
  dp[i+1] = dp[i]+dp[i-1]
  
print(dp[-1])
Problem p03207 (python)

Fixed submission:
N= int(input())

price = [int(input()) for i in range(N)]

total = sum(price)-max(price)/2
print(int(total))

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

price = [int(input()) for i in range(N)]
price.sort()

total = sum(price)-price(-1)/2
print(int(total))
Problem p03835 (python)

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

ans=[1 for x in range(K+1) for y in range(K+1) if 0<=S-x-y <= K]

print(len(ans))

Buggy submission (verdict: Runtime Error):
k, s = map(int, input().split())

ans = 0
num = max(k, s)

for i in range(num+1):
  for j in range(num+1):
    res = S - (i+j)
    if res >= 0:
      ans += res+1
      
print(ans)

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

ans=[1 for x in (K+1) for y in (K+1) if 0<=S-x-y <= K]

print(len(ans))

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

ans=[1 for x in (K+1) for y in (K+1) if K-x-y <= K]

print(len(ans))
Problem p02897 (python)

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

Buggy submission (verdict: Runtime Error):
N, A = int(input()), list(map(int, input().split()))
X=[]
for i in range(1, N+1):
  P = A.index(i) + 1
  X.append(P)
print(' '.join([str(x) for x in X]))

Buggy submission (verdict: Runtime Error):
N, A = int(input()), list(map(int, input().split()))
X = []
for i in range(N):
	P = -1
	for j in range(N):
		if (P == -1 or A[j] > A[P]): P = j
	X.append(P + 1)
	A[P] = 0
X.reverse()
print(' '.join([str(x) for x in X]))

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

Fixed submission:
print('A' if ord('A') <= ord(input()) <= ord('Z') else 'a')

Buggy submission (verdict: Runtime Error):
c = input()
print('A' if ord('A') <= ord(A) <= ord('Z') else 'a')
Problem p03631 (python)

Fixed submission:
N = str(input())
if N == N[::-1]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = str(input())
if N == N[::-1]
	print('Yes')
else
	print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
T = [int(input()) for i in range(N)]


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


def lcm(a, b):
    return a * b // gcd(a, b)


if N == 1:
    print(T[0])
    exit()

now = lcm(T[0], T[1])
for i in range(1, N):
    now = lcm(now, T[i])

print(now)
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=int(input())
b=int(input())
c=int(input())
if a+b+c >=22:
	print('bust')
else:
	print('win')

Buggy submission (verdict: Runtime Error):
a1=int(input())
a2=int(input())
a3=int(input())
if a1+a2+a3 >=22:
	print('bust')
else:
	print('win')
Problem p03785 (python)

Fixed submission:
def main() -> None:
    n, c, k = map(int, input().split())
    t = [int(input()) for _ in range(n)]
    ans = wait_start = wait_people = 0

    for ti in sorted(t):
        if ti - wait_start > k or wait_people == c:
            wait_people = 0
        wait_people += 1

        if wait_people == 1:
            wait_start = ti
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)

    val n = sc.nextInt()
    val c = sc.nextInt()
    val k = sc.nextInt()
    val t = Array(n) { sc.nextInt() }

    var ans = 0
    var waitStart = 0
    var waitPeople = 0

    for (ti in t.sorted()) {
        if (ti - waitStart > k || waitPeople == c) {
            waitPeople = 0
        }
        waitPeople++

        if (waitPeople == 1) {
            waitStart = ti
            ans++
        }
    }
    println(ans)
}
Problem p02723 (python)

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

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

s.split()
    if s[2] == s[3] and s[4] == s[5]:
        print("Yes")
    else:
        print("No")
Problem p03053 (python)

Fixed submission:
import array
import itertools
from collections import defaultdict, deque


def log(s):
    # print("| " + str(s), file=sys.stderr)
    pass


def output(x):
    print(x, flush=True)


def input_ints():
    return map(int, input().split())


def solve():
    def fill(queue):
        footsteps = [[None] * width for _ in range(height)]

        for x, y in queue:
            footsteps[y][x] = 0

        s = 0
        while queue:
            queue2 = deque()
            s += 1
            while queue:
                x, y = queue.popleft()

                if x > 0 and footsteps[y][x - 1] is None:
                    queue2.append((x - 1, y))
                    footsteps[y][x - 1] = s
                if x < width - 1 and footsteps[y][x + 1] is None:
                    queue2.append((x + 1, y))
                    footsteps[y][x + 1] = s
                if y > 0 and footsteps[y - 1][x] is None:
                    queue2.append((x, y - 1))
                    footsteps[y - 1][x] = s
                if y < height - 1 and footsteps[y + 1][x] is None:
                    queue2.append((x, y + 1))
                    footsteps[y + 1][x] = s

            queue = queue2

        return s - 1

    height, width = tuple(input_ints())
    field = [input() for _ in range(height)]
    queue = deque()

    for y, line in enumerate(field):
        for x, c in enumerate(line):
            if c == '#':
                queue.append((x, y))
    # queue.append((10, 10))


    return fill(queue)


def main():
    print(solve())


main()

Buggy submission (verdict: Runtime Error):
import array
import itertools
from collections import defaultdict, deque


def log(s):
    # print("| " + str(s), file=sys.stderr)
    pass


def output(x):
    print(x, flush=True)


def input_ints():
    return map(int, input().split())


def solve():
    def fill(queue):
        footsteps = [[None] * width for _ in range(height)]
        for p, s in queue:
            footsteps[p[1]][p[0]] = -1

        while queue:
            p, s = queue.popleft()
            x, y = p
            footsteps[y][x] = s

            if x > 0 and footsteps[y][x - 1] is None:
                queue.append(((x - 1, y), s + 1))
                footsteps[y][x - 1] = -1
            if x < width - 1 and footsteps[y][x + 1] is None:
                queue.append(((x + 1, y), s + 1))
                footsteps[y][x + 1] = -1
            if y > 0 and footsteps[y - 1][x] is None:
                queue.append(((x, y - 1), s + 1))
                footsteps[y - 1][x] = -1
            if y < height - 1 and footsteps[y + 1][x] is None:
                queue.append(((x, y + 1), s + 1))
                footsteps[y + 1][x] = -1

        return s

    height, width = tuple(input_ints())
    # field = [input() for _ in range(height)]
    queue = deque()

    # for y, line in enumerate(field):
    #     for x, c in enumerate(line):
    #         if c == '#':
    #             queue.append(((x, y), 0))
    queue.append(((10, 10), 0))

    return fill(queue)


def main():
    print(solve())


main()
Problem p02659 (python)

Fixed submission:
#A,B = 664706138336385, 9.79
A, B = input().split()
A = int(A)
B = float(B)
B_ = round(B*100)
C = A*B_
C_ = str(C)
if C < 100:
    print(0)
else:
    print(C_[:-2])

Buggy submission (verdict: Runtime Error):
A, B = input().split()
A = int(A)
B = float(B)
B_ = round(B*100)
C = A*B_
C_ = str(C)
if C < 100:
    print(0)
else:
    print(C[:-2])

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
B_ = int(B*100)
C = str(A*B_)
D = C[:-2]
E = C[-2:]
D,E
if E == '00':
    print(D)
else:
    print(D+'.'+E)
Problem p03805 (python)

Fixed submission:
N, M = map(int, input().split())
p = [list(map(int, input().split())) for i in range(M)]
import itertools
v = list(map(list, itertools.permutations(range(2,N+1), N-1)))
cnt = 0
for i in range(len(v)):
    vit = True
    v_i = [1]+v[i]
    for j in range(N-1):
        if sorted(v_i[j:j+2]) not in p:
            vit = False
    if vit:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
import itertools
N, M = map(int, input().split())
p = [list(map(int, input().split())) for i in range(M)]
v = list(map(list, itertools.permutations(range(2,N+1), N-1)))
cnt = 0
for i in range(len(v)):
	vit = True
    v_i = [1]+v[i]
    for j in range(N-1):
        if sorted(v_i[j:j+2]) not in p:
            vit = False
    if vit:
        cnt += 1
print(cnt)