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

Fixed submission:
n, m = map(int, input().split())
T1 = [[] for i in range(n)]
T2 = [[] for i in range(m)]
for i in range(n):
    a = list(input())
    T1[i] = a
for i in range(m):
    a = list(input())
    T2[i] = a

flag = False
for i in range(n - m + 1):
    for j in range(n - m + 1):
        l = 0
        if T1[i][j: j + m] == T2[l]:
            k = i
            while k < n - m + 1 and l < m:
                if T1[k][j:j + m] != T2[l]:
                    break
                k += 1
                l += 1
                if l == m:
                    flag = True


if flag:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
T1 = [[] for i in range(n)]
T2 = [[] for i in range(m)]
for i in range(n):
    a = list(input())
    T1[i] = a
for i in range(m):
    a = list(input())
    T2[i] = a

flag = False
for i in range(n - m + 1):
    for j in range(n - m + 1):
        if T1[i][j: j + m] == T2[0]:
            k = i
            l = 0
            while k < n - m + 1:
                if T1[k][j:j + m] != T2[l]:
                    break
                k += 1
                l += 1
                if l == m:
                    flag = True


if flag:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
T1 = [[] for i in range(n)]
T2 = [[] for i in range(m)]
for i in range(n):
    a = list(input())
    T1[i] = a
for i in range(m):
    a = list(input())
    T2[i] = a

flag = False
for i in range(n - m):
    for j in range(n - m):
        if T1[i][j: j + m] == T2[0]:
            k = i
            l = 0
            while k < n - m + 1:
                if T1[k][j:j + m] != T2[l]:
                    break
                k += 1
                l += 1
                if k == i + m:
                    flag = True


if flag:
    print("Yes")
else:
    print("No")
Problem p03822 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
N = int(input())
G = [[] for i in range(N + 1)]
for i in range(1, N):
    a = int(input())
    G[a - 1].append(i)


def dfs(v):
    if len(G[v]) == 0:
        return 0
    D = []
    for w in G[v]:
        D.append(dfs(w))

    D = sorted(D, reverse=True)

    num = 0
    for i in range(len(D)):
        num = max(num, D[i] + i + 1)

    return num


print(dfs(0))

Buggy submission (verdict: Runtime Error):
N = int(input())
G = [[] for i in range(N + 1)]
for i in range(1, N):
    a = int(input())
    G[a - 1].append(i)


def dfs(v):
    D = []
    for w in G[v]:
        D.append(dfs(w))

    D = sorted(D, reverse=True)

    num = 0
    for i in range(len(D)):
        num = max(num, D[i] + i + 1)

    return num


print(dfs(0))
Problem p02933 (python)

Fixed submission:
a = int(input())

s = input()

if(a >= 3200):
  print(s)

else:
  print("red")

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)

def addc(p,b):
  for i in e[p]:
    if(i == b):
      continue
    c[i] += c[p]
    addc(i,p)

n,q = map(int,input().split())

e = [ [] for i in range(n + 1)]
c = [0 for i in range(n + 1)]

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

for i in range(q):
  p,x = map(int,input().split())
  c[p] += x

addc(1,-1)

c.pop(0)

print(*c)
Problem p03135 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#1 <= T,X <= 100
T, X = map(float, input().split())
# 文字列の入力
#s = input()
t = T / X
# 出力
print(t)
#print("{} {}".format(a+b+c, s))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

# 整数の入力
N = int(input())
# スペース区切りの整数の入力
#b, c = map(int, input().split())
l = list(map(int, input().split()))
max = max(l)
#for i in l:
#    print(i)

num = 0
for i in l:
    num=i+num
num = num-max
print(num)
print(max)
if num >= max:
    print("Yes")
else:
    print("No")
# 文字列の入力
#s = input()
# 出力
#print("{} {}".format(a+b+c, s))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

# 整数の入力
N = int(input())
# スペース区切りの整数の入力
#b, c = map(int, input().split())
l = list(map(int, input().split()))
max = max(l)
#for i in l:
#    print(i)

num = 0
for i in l:
    num=i
num = num-max
if num >= max:
    print("Yes")
else:
    print("No")
# 文字列の入力
#s = input()
# 出力
#print("{} {}".format(a+b+c, s))
Problem p02836 (python)

Fixed submission:
a=input()
b=len(a)
i=0
j=0
while i <= b//2-1 :
	if a[i] != a[b-i-1]: 
		j+=1
		i+=1
	else:
		i+=1
print(j)

Buggy submission (verdict: Runtime Error):
a=input()
b=len(a)
i=0
j=0
while i <= b//2 :
	if a[i] != a[b-i-1]:
	j +=1
else:
	print(j)

Buggy submission (verdict: Runtime Error):
a=input()
b=len(a)
i=0
j=0
while i <= b//2 :
	if a[i] != a[(b-i-1)]
	j +=1
else
print(j)

Buggy submission (verdict: Runtime Error):
a=input()
b=len(a)
i=0
j=0
while i <= b//2
	if a[i] != a[b-i]
	j +=1
else
	print(j)
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 or b > 9:
	print("-1")
else:
	print(a*b)
Problem p02881 (python)

Fixed submission:
n = int(input())

divisors = []
for i in range(1, int(n**0.5)+1):
    if n % i == 0:
        divisors.append(i)
        if i != n // i:
            divisors.append(n//i)

times = 10**12

for j in range(len(divisors)):
    x = divisors[j]
    y = n // x
    time = (x -1) + (y - 1)
    if time < times:
      times = time
print(times)

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

divisors = []
for i in range(1, int(n**0.5)+1):
    if n % i == 0:
        divisors.append(i)
        if i != n // i:
            divisors.append(n//i)

times = 10**12

for j in range(0, len(divisors), 2):
	time = (divisors[j] - 1) + (divisors[j+1] - 1)
	if time < times:
		times = time
print(times)
Problem p02860 (python)

Fixed submission:
N = int(input())
S = input()

if N % 2 == 1:
    print("No")
    exit()

if S[0:int(N/2)] == S[int(N/2):]:
    print("Yes")
else:
    print("No")

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

if N % 2 == 1:
    print("No")
    exit()

if S[0:N/2] == S[N/2:]:
    print("Yes")
else:
    print("No")
Problem p03075 (python)

Fixed submission:
a=int(input())
input()
input()
input()
e=int(input())
k=int(input())
print("Yay!" * (e-a <= k) or ":(")

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,k=map(int,input().split())
print("Yay!" * (e-a > k) or ":(")
Problem p02847 (python)

Fixed submission:
s = input()
a = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
i = 0
for num,day in enumerate(a):
  if s == day:
    i = 7 - num

print(i)

Buggy submission (verdict: Runtime Error):
s = input()
week = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
i = 0
for num,day in enumerate(weeK):
  if s == day:
    i = 7 - num
print(i)
Problem p02847 (python)

Fixed submission:
S = input()

if S == "SUN":
    print('7')

if S == "MON":
    print('6')
    
if S == "TUE":
    print('5')
    
if S == "WED":
    print('4')
    
if S == "THU":
    print('3')
    
if S == "FRI":
    print('2')
    
if S == "SAT":
    print('1')

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

if S == SUN:
    print('7')

if S == MON:
    print('6')
    
if S == TUE:
    print('5')
    
if S == WED:
    print('4')
    
if S == THU:
    print('3')
    
if S == FRI:
    print('2')
    
if S == SAT:
    print('1')
Problem p02859 (python)

Fixed submission:
s = int(input())

print(s*s)

Buggy submission (verdict: Runtime Error):
print(input()**2)

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

print(int(x*x))

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

print(x*x)
Problem p02847 (python)

Fixed submission:
week_list = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
week_list.reverse()

print(week_list.index(input()) + 1)

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

print(rweek_list.index(input()) + 1)
Problem p02859 (python)

Fixed submission:
print(int(input()) ** 2)

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

if S[:N//2] == S[N//2:]:
 print('Yes')
else:
 print('No')
Problem p02836 (python)

Fixed submission:
S=input()
S=list(S)

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

print(count)

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

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

print(count)
Problem p03775 (python)

Fixed submission:
import math

n = int(input())
l = []
for i in range(1, int(math.sqrt(n)) + 1):
    if n % i == 0:
        a = len(str(int(n / i)))
        b = len(str(int(i)))
        l.append(max(a, b))

print(min(l))

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
l = []
for i in range(1, int(math.sqrt(n))):
    if n % i == 0:
        a = len(str(int(n / i)))
        b = len(str(int(i)))
        l.append(max(a, b))

print(min(l))
Problem p02836 (python)

Fixed submission:
s = input()
n = len(s)
cost = 0
for i in range(n // 2):
    cost += (s[i] != s[n - i - 1])
print(cost)

Buggy submission (verdict: Runtime Error):
s = input()
n = len(s)
cost = 0
for i in range(n // 2):
    cost += (s[i] != s[n - i])
print(cost)
Problem p02859 (python)

Fixed submission:
print(int(input()) ** 2)

Buggy submission (verdict: Runtime Error):
def all_you_can_eat(n, t, a, b):
    dp = [[0 for _ in range(2)] for _ in range(t)]
    for x in range(n):
        for i in reversed(range(t)):
            if i + a[x] < t:
                dp[i + a[x]][0] = max(dp[i + a[x]][0], dp[i][0] + b[x])
                dp[i + a[x]][1] = max(dp[i + a[x]][1], dp[i][1] + b[x])
            dp[i][1] = max(dp[i][1], dp[i][0] + b[x])
    return dp[t-1][1]


def solve():
    n, t = map(int, input().split())
    a = [0 for _ in range(n)]
    b = [0 for _ in range(n)]
    for i in range(n):
        a[i], b[i] = map(int, input().split())

    print(all_you_can_eat(n, t, a, b))


if __name__ == "__main__":
    solve()
Problem p02863 (python)

Fixed submission:
import numpy as np


def solve():


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

    A = []
    B = []

    for _ in range(N):
        A_temp, B_temp = map(int, input().split())
        A.append(A_temp)
        B.append(B_temp)

    A = np.array(A, np.int)
    B = np.array(B, np.int)

    idx = np.argsort(A)
    A = A[idx]
    B = B[idx]

    dp = np.zeros((N, T), np.int)

    for i in range(N - 1):
        dp[i + 1, :A[i]] = dp[i, :A[i]]
        dp[i + 1, A[i]:] = np.maximum(dp[i, A[i]:], dp[i, :-A[i]] + B[i])

    print(np.max(dp[:, -1] + B))


if __name__ == "__main__":
    solve()

Buggy submission (verdict: Runtime Error):
def all_you_can_eat(n, t, a, b):
    dp = [[0 for _ in range(2)] for _ in range(t)]
    for x in range(n):
        for i in reversed(range(t)):
            if i + a[x] < t:
                dp[i + a[x]][0] = max(dp[i + a[x]][0], dp[i][0] + b[x])
                dp[i + a[x]][1] = max(dp[i + a[x]][1], dp[i][1] + b[x])
            dp[i][1] = max(dp[i][1], dp[i][0] + b[x])
    return dp[t-1][1]


def solve():
    n, t = map(int, input().split())
    a = []
    b = []
    for i in range(n):
        a[i], b[i] = map(int, input().split())

    print(all_you_can_eat(n, t, a, b))


if __name__ == "__main__":
    solve()
Problem p02859 (python)

Fixed submission:
print(int(input())**2)

Buggy submission (verdict: Runtime Error):
return int(input())**2
Problem p02951 (python)

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

if ans < 0:
  print(0)
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().sprit())
ans = c-(a-b)

if ans < 0:
  print(0)
else:
  print(ans)
Problem p03053 (python)

Fixed submission:
from collections import deque

H,W = map(int,input().split()) 
A = [[0]*W for _ in range(H)]
M = 0
queue = deque()
for i in range(H):
  s = input()
  for j in range(W):
    if s[j]== '#':
      queue.append([i,j,0])
      A[i][j] = '#'
while queue:
  i,j,cost = queue.popleft()
  M=max(M,cost)
  if i+1 < H and A[i+1][j] != '#':
    queue.append([i+1,j,cost+1])
    A[i+1][j] = '#'
  if i-1 >= 0 and A[i-1][j] != '#':
    queue.append([i-1,j,cost+1])
    A[i-1][j] = '#'
  if j+1 < W and A[i][j+1] != '#':
    queue.append([i,j+1,cost+1])
    A[i][j+1] = '#'
  if j-1 >= 0 and A[i][j-1] != '#':
    queue.append([i,j-1,cost+1])
    A[i][j-1] = '#'
print(M)

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split()) 
A = [[0]*H for _ in range(W)]
M = 0
queue = []
for i in range(H):
  s = input()
  for j in range(W):
    if s[j]== '#':
      queue.append([i,j,0])
      A[i][j] = '#'
while queue:
  i,j,cost = queue.pop(0)
  M=max(M,cost)
  if i+1 < H and A[i+1][j] != '#':
    queue.append([i+1,j,cost+1])
    A[i+1][j] = '#'
  if i-1 >= 0 and A[i-1][j] != '#':
    queue.append([i-1,j,cost+1])
    A[i-1][j] = '#'
  if j+1 < W and A[i][j+1] != '#':
    queue.append([i,j+1,cost+1])
    A[i][j+1] = '#'
  if j-1 >= 0 and A[i][j-1] != '#':
    queue.append([i,j-1,cost+1])
    A[i][j-1] = '#'
print(M)

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split()) 
A = [[0]*H for _ in range(W)]
M = 0
queue = []
for i in range(H):
  s = input()
  for j in range(W):
    if s[j]== '#':
      queue.append([i,j,0])
      A[i][j] = '#'
while queue:
  i,j,cost = queue.pop(0)
  M=max(M,cost)
  if i+1 < H and A[i+1][j] != '#':
    queue.append([i+1,j,cost+1])
    A[i+1][j] = '#'
  if i-1 >= 0 and A[i-1][j] != '#':
    queue.append([i-1,j,cost+1])
    A[i-1][j] = '#'
  if j+1 < W and A[i][j+1] != '#':
    queue.append([i,j+1,cost+1])
    A[i][j+1] = '#'
  if j-1 >= 0 and A[i][j-1] != '#':
    queue.append([i,j-1,cost+1])
    A[i][j-1] = '#'
print(M)

Buggy submission (verdict: Runtime Error):
H,W = map(int,input().split()) 
A = [0]*H
M = 0
queue = []
for i in range(H):
  A[i] = input()
  for j in range(W):
    if A[i][j] == '#':
      queue.append([i,j,0])
while queue:
  i,j,cost = queue.pop(0)
  if i+1 < H and A[i+1][j] != '#':
    queue.append([i+1,j,cost+1])
    A[i+1][j] = '#'
  if i-1 >= 0 and A[i-1][j] != '#':
    queue.append([i-1,j,cost+1])
    A[i-1][j] = '#'
  if j+1 < W and A[i][j+1] != '#':
    queue.append([i,j+1,cost+1])
    A[i][j+1] = '#'
  if j-1 >= 0 and A[i][j-1] != '#':
    queue.append([i,j-1,cost+1])
    A[i][j-1] = '#'
print(M)

Buggy submission (verdict: Runtime Error):
import sys

H,W = map(int,input().split())    
A = [0]*H
for i in range(H):
  A[i] = input()

def L1(x1,y1,x2,y2):
  return abs(x1-x2)+abs(y1-y2)

b_ij = []
for i in range(H):
  for j in range(W):
    if A[i][j] == '#':
      b_ij.append({'x': i, 'y': j})
l = len(b_ij)
m_list = []
for i in range(H):
  for j in range(W):
    if A[i][j] == '.':
      m = sys.maxsize
      for k in range(l):
        m = min(m,L1(b_ij[k].get('x'),b_ij[k].get('y'),i,j))
      m_list.append(m)
print(max(m_list))
Problem p03104 (python)

Fixed submission:
def solver(N):
  if N % 2 == 1:
    return oddodd(N)
  else:
    return (N+1) ^ oddodd(N+1)

def oddodd(N):
  return 1 if (N+1)/2 % 2 == 1 else 0 

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

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

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

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

def solver(N)
  if N % 2 == 1:
    return oddodd(N)
  else:
    return N+1 ^ oddodd(N+1)

def oddodd(N)
  return 1 if (N+1)/2 % 2 == 1 else 0

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
b = format(B, "b")
d_num = len(b)
a = [0]*(B-A + 1)
a[-1] = b
digit_list = [0]*d_num
for i in range(B-A):
  a[i] = format(A + i,"0"+str(d_num) + "b")
for i in range(len(a)):
    digit_list = map(sum,zip(digit_list,[int(c) for c in a[i]])) 
result = [1 if digit % 2 != 0 else 0 for digit in digit_list]
print(int(''.join(map(str,result)),2))

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
b = format(B, "b")
d_num = len(b)
a = [0]*(B-A + 1)
a[-1] = b
digit_list = [0]*d_num
for i in range(B-A):
  a[i] = format(A + i,"0"+str(d_num) + "b")
for i in range(len(a)):
  for digit in a[i]:
    digit_list[i]+=int(digit) 
result = [1 if digit % 2 != 0 else 0 for digit in digit_list]
print(int(''.join(map(str,result)),2))
Problem p02873 (python)

Fixed submission:
def main():
  s = input().rstrip('\n')
  n = len(s)
  dp = [0] * (1 + n)
  for i,c in enumerate(s):
    if c == '<':
      dp[i+1] = dp[i] + 1
  for i in range(n-1, -1, -1):
    if s[i] == '>':
      dp[i] = max(dp[i], dp[i+1] + 1)
  return sum(dp)

print(main())

Buggy submission (verdict: Runtime Error):
import itertools
f = lambda n:n*(n+1)//2

def sol():
  res = 0
  while q:
    x0 = q.popleft()
    x1 = q.popleft()
    res += f(max(x0, x1)) + f(min(x0, x1)-1)
    return res

s = input()

q = collections.deque()
for k, g in itertools.groupby(s):
  q.append(len(list(g)))
if len(q) % 2:
  q.append(1)

print(sol())

Buggy submission (verdict: Runtime Error):
import itertools
f = lambda n:n*(n+1)//2

def sol():
    res = 0
    while q:
        x0 = q.popleft()
        x1 = q.popleft()
        res += f(max(x0, x1)) + f(min(x0, x1) -1)
    return res

s = input().rstrip("\n")

q = collections.deque()
for k, g in itertools.groupby(s):
    q.append(len(list(g)))
if len(q) % 2:
    q.append(1)

print(sol())

Buggy submission (verdict: Runtime Error):
import itertools
f = lambda n:sum(i for i in range(n+1))

def sol():
    res = 0
    while q:
        x0 = q.popleft()
        x1 = q.popleft()
        res += f(max(x0, x1)) + f(min(x0, x1) -1)
    return res

s = input().rstrip("\n")

q = collections.deque()
for k, g in itertools.groupby(s):
    q.append(len(list(g)))
if len(q) % 2:
    q.append(1)

print(sol())

Buggy submission (verdict: Runtime Error):
import itertools
f = lambda n:sum(i for i in range(n+1))

def sol():
    res = 0
    while q:
        x0 = q.popleft()
        x1 = q.popleft()
        res += f(max(x0, x1)) + f(min(x0, x1) -1)
    return res

s = input()

q = collections.deque()
for k, g in itertools.groupby(s):
    q.append(len(list(g)))
if len(q) % 2:
    q.append(1)

print(sol())
Problem p02847 (python)

Fixed submission:
# coding: utf-8
# Here your code !
data = input()

if data == "SUN":
    print(7)
elif data == "MON":
    print(6)
elif data == "TUE":
    print(5)
elif data == "WED":
    print(4)
elif data == "THU":
    print(3)
elif data == "FRI":
    print(2)
elif data == "SAT":
    print(1)

Buggy submission (verdict: Runtime Error):
# coding: utf-8
# Here your code !
data = input()

if data == "SUN":
    print(7)
elif data == "MON"
    print(6)
elif data == "TUE"
    print(5)
elif data == "WED"
    print(4)
elif data == "THU"
    print(3)
elif data == "FRI"
    print(2)
elif data == "SAT"
    print(1)
Problem p03745 (python)

Fixed submission:

n = int(input())
a_ = list(map(int, input().split(' ')))
a = [-1]
i = 0
while  i < n:
    if a[-1] != a_[i]:
        a.append(a_[i])
    i += 1
a = a[1:]
n = len(a)

ret = 1

i = 0
while i < n-2:
    if (a[i] > a[i+1] and a[i+1] < a[i+2]) or (a[i] < a[i+1] and a[i+1] > a[i+2]):
        ret += 1
        i += 2
    else:
        i += 1
        
print(ret)

Buggy submission (verdict: Runtime Error):
n = int(input())
a_ = list(map(int, input().split(' ')))
a = [-1]
i = 0
while  i < n:
    if a[-1] != a_[i]:
        a.append(a_[i])
    i += 1
a = a[1:]

ret = 1

i = 0
while i < n-2:
    if (a[i] > a[i+1] and a[i+1] < a[i+2]) or (a[i] < a[i+1] and a[i+1] > a[i+2]):
        ret += 1
        i += 2
    else:
        i += 1
        
print(ret)
Problem p03767 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split(' ')))
a = sorted(a)
ret = sum(a[n::2])
print(ret)

Buggy submission (verdict: Runtime Error):
10
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
Problem p03805 (python)

Fixed submission:
n,m = map(int,input().split(' '))

bar = [[] for _ in range(n)]

for i in range(m):
    a,b = map(lambda x:int(x)-1,input().split(' '))
    bar[a].append(b)
    bar[b].append(a)

result = 0

def search(root=[0]):
    global result
    if len(root) >= n:
        result += 1
        return
    nxt = set(bar[root[-1]])
    nxt = nxt - set(root)
    for nxt_ in nxt:
        search(root+[nxt_])

search()
print(result)

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

bar = [[] for _ in range(m)]

for i in range(n):
    a,b = map(lambda x:int(x)-1,input().split(' '))
    bar[a].append(b)
    bar[b].append(a) 


result = 0

def search(root=[0]):
    global result
    if len(root) >= n:
        result += 1
        return
    nxt = set(bar[root[-1]])
    nxt = nxt - set(root)
    for nxt_ in nxt:
        search(root+[nxt_])

search()
print(result)

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

bar = [[] for _ in range(m)]

for i in range(n):
    a,b = map(lambda x:int(x)-1,input().split(' '))
    bar[a].append(b)
    bar[b].append(a) 


result = 0

def search(root=[0]):
    global result
    if len(root) >= n:
        result += 1
    nxt = set(bar[root[-1]])
    nxt = nxt - set(root)
    for nxt_ in nxt:
        search(root+[nxt_])

search()
print(result)
Problem p02933 (python)

Fixed submission:
a,s = [input() for i in range(2)]
if int(a) >= 3200:
    print(s)
else:
    print('red')

Buggy submission (verdict: Runtime Error):
a,s = input().split() 
if int(a) >= 3200:
    print(s)
else:
    print('red')
Problem p02951 (python)

Fixed submission:
A,B,C = map(int,input().split())
X = C - A + B
if X < 0:
    X = 0
print(X)

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
x = C - A + B
if X < 0:
    X = 0
print(X)

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
x = C - A + B
if X < 0:X = 0
print(X)

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
x = C-A+B
if X < 0:
X = 0
print(X)

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
x = C-A+B
print(X)
if X < 0
print(0)

Buggy submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
x = C-A+B
print(X)
if X < 0
print(X)

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

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

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

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

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

Buggy submission (verdict: Runtime Error):
A,B,C=input()
print(C-A+B)

Buggy submission (verdict: Runtime Error):
A,B,C=(int,input().split()))
print(C-A+B)
Problem p03834 (python)

Fixed submission:
s,t,u=map(str,input().split(','))
print(s,t,u)

Buggy submission (verdict: Runtime Error):
s,t,u=map(int,input().split(','))
print(s,t,u)

Buggy submission (verdict: Runtime Error):
s,t,u=map(int,input().split(''))
print(s,t,u)
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):
n = int(input())
ans = "No"

for x in range(1,10):
	if n/x in [1,2,3,4,5,6,7,8,9]:
		ans = "Yes"

print(ans)