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

Fixed submission:
char = input()
if char.islower():
  print('a')
else:
  print('A')

Buggy submission (verdict: Runtime Error):
n, k = [int(j) for j in input().split(' ')]
p = input().split(' ')
 
p.sort()
sum = 0
 
for i in range(0,k):
  sum+=int(p[i])
  
return sum
Problem p02723 (python)

Fixed submission:
s = input()
 
if s[2] == s[3] and s[4] == s[5]:
    print('Yes')
else :
    print('No')

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

if s[2] == s[3] && s[4] == s[5] :
  print('Yes')
else
  print('No')

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

if(s[2] == s[3] && s[4] == s[5])　print('Yes')
else print('No')
Problem p02729 (python)

Fixed submission:
n, m = map(int, input().split())
 
result = 0
 
if n != 0: 
  result += n*(n-1)/2
 
if m != 0:
  result += m*(m-1)/2
 
print(int(result))

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

result = 0

if n != 0: 
  result += n*(n-1)/2

if m != 0:
  result += m*(m-1)/2

print(result)
Problem p02933 (python)

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

if n < 3200 :
  print('red')
else :
  print(s)

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

if n < 3200:
  print('red')
else :
  print(s)
Problem p02627 (python)

Fixed submission:
a = input().strip()

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

Buggy submission (verdict: Runtime Error):
a = input().strip()
if a <= z:
  print('a')
else:
  print('A')
Problem p02659 (python)

Fixed submission:
a,b=map(int,input().replace('.', '').split())
print(a*b//100)

Buggy submission (verdict: Runtime Error):
a, b = input().split()
print(int(A) * int(float(B)*1000)//1000)

Buggy submission (verdict: Runtime Error):
a, b = input().split()
print(int(A) * int(float(B)*1000//1000))

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

print (int(a*b))

Buggy submission (verdict: Runtime Error):

n = int(input())
An = list(map(int, input().split()))

j = 100000000000000000

ans = 1


for i in range(n):
    ans = ans * An[i]

if ans <= j:
    print(ans)
    quit()
else :
    print('-1')
    quit()
Problem p02627 (python)

Fixed submission:
α = input()

if α.isupper() == True :
  print("A")
if α.islower() == True :
  print("a")

Buggy submission (verdict: Runtime Error):
if α.isupper() = True :
  print("A")
else:
  print("B")
Problem p02627 (python)

Fixed submission:
alpha = str(input())

if  (alpha.islower() == True):
  print('a')
else:
  print('A')

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

total = sum(A)
dic = {}
for i in range(q):
  b, c = map(int, input().split())
  b_count = A.count(b)
  c_count = A.count(c)
  dic[c] = c_count + b_count
  if b in dic:
    b_count = dic[b]
  diff = c - b
  total += b_count*diff
  print(total)
Problem p02723 (python)

Fixed submission:
S = input()
if S[2] == S[3] and S[4] == S[5]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
S = input('Enter something: ')
if S[2] == S[3] and S[4] == s[5]:
    print('Yes')
else:
    print('No')
Problem p02627 (python)

Fixed submission:
import re
txt=input()
x = re.search("[A-Z]", txt)
if(x):
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
num = int(input())
strng = ""
while num >= 1 :
    kalan = num % 26
    if(kalan==0):
      strng = "z" +strng
    else:
    	strng = chr(96+kalan)+strng
    num = num // 26
print(strng)

Buggy submission (verdict: Runtime Error):
num = int(input())
strng = ""
while num >= 1 :
    kalan = num % 26
    strng = chr(97+kalan-1)+strng
    num = num // 26
print(strng)
Problem p02627 (python)

Fixed submission:

S = input()
if(S.isupper()):
    print('A')
else:
    print('a')

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

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

p.sort()
print(sum(p[0:K]))

Buggy submission (verdict: Runtime Error):
S = input()
if(S.isupper()):
    printf('A')
else:
    printf('a')
Problem p02873 (python)

Fixed submission:
S = str(input())
a = []
ans = 0

def sumn(x):
    y = x * (x+1)//2
    return y
    
cnt = 1

if len(S) == 1:
    ans = 1
    print(ans)
else:
    for i in range(len(S)-1):
        if S[i+1] == S[i]:
            cnt += 1
            if i+1 == len(S)-1:
                a.append(cnt)
        
        else:
            a.append(cnt)
            cnt = 1
            if i+1 == len(S)-1:
                a.append(cnt)
            
    if S[0] == '<':
        for i in range(len(a)):
            if i % 2 == 0:
                ans += sumn(a[i])
            else:
                if a[i] > a[i-1]:
                    ans += (sumn(a[i]) - a[i-1])
                else:
                    ans += sumn(a[i]-1)
    else:
        for i in range(len(a)):
            if i == 0:
                ans += sumn(a[i])
            elif i % 2 == 1:
                ans += sumn(a[i])
            else:
                if a[i] > a[i-1]:
                    ans += (sumn(a[i]) - a[i-1])
                else:
                    ans += sumn(a[i]-1)
    print(ans)

Buggy submission (verdict: Runtime Error):
S = str(input())
a = []
ans = 0

def sumn(x):
    y = x * (x+1)//2
    return y
    
cnt = 1

if len(S) == 1:
    ans = 1
    print(ans)
else:
    for i in range(len(S)-1):
        if S[i+1] == S[i]:
            cnt += 1
            if i+1 == len(S)-1:
                a.append(cnt)
        
        else:
            a.append(cnt)
            cnt = 1
            if i+1 == len(S)-1:
                a.append(cnt)
            
    if S[0] == '<':
        for i in range(len(a)):
            if i % 2 == 0:
                ans += sumn(a[i])
            else:
                if a[i] > a[i-1]:
                    ans += (sumn(a[i]) - a[i-1])
                else:
                    ans += sumn(a[i]-1)
    else:
        if i == 0:
            ans += sumn(a[i])
        elif i % 2 == 1:
            ans += sumn(a[i])
        else:
            if a[i] > a[i-1]:
                ans += (sumn(a[i]) - a[i-1])
            else:
                ans += sumn(a[i]-1)
    print(ans)
Problem p02984 (python)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
s = 0

for i in range(N):
    s = A[i]-s
    
s = s//2
ans = [s*2]
for i in range(1,N):
    s = A[i-1] - s
    ans.append(s*2)
    
for i in range(N):
    print(ans[i], end = " ")

Buggy submission (verdict: Runtime Error):
import sympy
N = int(input())
A = [int(i) for i in input().split()]
ans = [x*2]

x = sympy.Symbol('x')
s = x
for i in range(1, N):
    s = A[i-1]-s
    ans.append(s*2)
    
sol = sympy.solve(A[N-1]-s-x)[0]
for i in range(N):
    ans[i] = ans[i].subs(x, sol)
    print(ans[i], end = " ")

Buggy submission (verdict: Runtime Error):
import sympy
N = int(input())
A = [int(i) for i in input().split()]
ans = [x*2]

x = sympy.Symbol('x')
s = x
for i in range(1, N):
    s = A[i-1]-s
    ans.append(s*2)
    
sol = sympy.solve(A[N-1]-s-x)[0]
for i in range(N):
    ans[i] = str(ans[i].subs(x, sol))
print(' '.join(ans))

Buggy submission (verdict: Runtime Error):
import sympy
N = int(input())
A = [int(i) for i in input().split()]
ans = [x*2]

x = sympy.Symbol('x')
s = x
for i in range(1, N):
    s = A[i-1]-s
    ans.append(s*2)
    
sol = sympy.solve(A[N-1]-s-x)[0]
for i in range(N):
    ans[i] = ans[i].subs(x, sol)
print(ans)
Problem p02990 (python)

Fixed submission:
N, K = map(int, input().split())
s = 10**9+7
x = N-K+1
y = 1
for i in range(1, K+1):
    print(x*y%s)
    x = x * (N-K+1-i) // (i+1)
    y = y * (K-i) // i

Buggy submission (verdict: Runtime Error):
import math
N, K = map(int, input().split())
s = 10**9+7
for i in range(1, K+1):
    ans1 = (math.factorial(N-K+1)) // (math.factorial(i)) //(math.factorial(N-K-i+1))
    ans2 = (math.factorial(K-1)) // (math.factorial(i-1)) // (math.factorial(K-i))
    print(ans1 % s * ans2 % s)

Buggy submission (verdict: Runtime Error):
import math
N, K = map(int, input().split())
for i in range(1, K+1):
    ans1 = math.factorial(N-K+1) // math.factorial(i) // math.factorial(N-K-i+1)
    ans2 = math.factorial(K-1) // math.factorial(i-1) // math.factorial(K-i)
    print(ans1*ans2 % (10**9 + 7))

Buggy submission (verdict: Runtime Error):
import math
N, K = map(int, input().split())
for i in range(1, K+1):
    ans1 = math.factorial(N-K+1) // math.factorial(i) // math.factorial(N-K-i+1)
    ans2 = math.factorial(K-1) // math.factorial(i-1) // math.factorial(K-i)
    print(ans1*ans2)
Problem p02627 (python)

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

Buggy submission (verdict: Runtime Error):
a = input()
 
if str.isupper(a):
  print('A')
else :
  ptint('a')

Buggy submission (verdict: Runtime Error):
a = input()
 
if str.isupper(a):
  print("A")
else :
  ptint("a")

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

if str.isupper(a) == ture :
  print("A")
else :
  ptint("a")
Problem p03011 (python)

Fixed submission:
P,Q,R = map(int,input().split())

Ans1 = P + Q
Ans2 = Q + R
Ans3 = R + P

if(Ans1 > Ans2):
	Ans1 = Ans2

if(Ans1 > Ans3):
	Ans1 = Ans3

print (Ans1)

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

Ans1 = P + Q
Ans2 = Q + R
Ans3 = R + P

if(Ans1 > Ans2):
	Ans1 = Ans2

if(Ans1 > Ans3):
	Ans1 = Ans3

print (Ans1)

Buggy submission (verdict: Runtime Error):
P = int(input())
Q = int(input())
R = int(input())
 
Ans1 = P + Q
Ans2 = Q + R
Ans3 = R + P
 
if(Ans1 > Ans2):
	Ans1 = Ans2
 
if(Ans1 > Ans3):
	Ans1 = Ans3
 
print (Ans1)

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

Ans1 = P + Q
Ans2 = Q + R
Ans3 = R + P

if(Ans1 > Ans2):
	Ans1 = Ans2

if(Ans1 > Ans3):
	Ans1 = Ans3

print Ans1
Problem p02627 (python)

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

Buggy submission (verdict: Runtime Error):
if(input().isupper()):
  print('A')
else if(input().islower()):
  print('a')

Buggy submission (verdict: Runtime Error):
if(input().isupper()):
  print('A')
elif(input().islower()):
  print('a')
Problem p02933 (python)

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

Buggy submission (verdict: Runtime Error):
N=int(input())
v=[int(i) for i in input().split()]
v.sort()
 
res = v[0]
for i in range(1,N):
    res = (res+v[i])/2
print(res)

Buggy submission (verdict: Runtime Error):
a = int(input())
s= input()
if a>=3200:
  print(s)
else if:
  s = "red"
  print(s)

Buggy submission (verdict: Runtime Error):
a = int(input())
s = int(input())
if a>=3200:
  print(s)
else if:
  s = "red"
  print(s)
Problem p02935 (python)

Fixed submission:
N=int(input())
v=[int(i) for i in input().split()]
v.sort()
 
res = v[0]
for i in range(1,N):
    res = (res+v[i])/2
print(res)

Buggy submission (verdict: Runtime Error):
N=int(input())
v=[int(i) for i in input().split()]
v.sort()
 
res = v[0]
for i in range(1,N+1):
    res = (res+v[i])/2
print(res)
Problem p03834 (python)

Fixed submission:
a, b, c = input().split(",")
print(a, b, c)

Buggy submission (verdict: Runtime Error):
A,B,C =map(str, input().split(,))
print(A,B,C)
Problem p02627 (python)

Fixed submission:
s=input()
if s.isupper():
    print("A")
else:
    print("a")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=list(map(int,input().split()))
s=0
l.sort()
x=l[:m]
   
print(sum(x))
Problem p02729 (python)

Fixed submission:
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
input_line = input().split()

N = int(input_line[0])
M = int(input_line[1])
counter = 0 
if N > 1:
    counter += combinations_count(N,2) 
if M > 1:
    counter += combinations_count(M,2)
        
print(counter)

Buggy submission (verdict: Runtime Error):
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
input_line = input().split()

N = int(input_line[0])
M = int(input_line[1])
counter = 0 
if N != 0:
    counter += combinations_count(N,2) 
if M != 0:
    counter += combinations_count(M,2)
        
print(counter)

Buggy submission (verdict: Runtime Error):
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
import math
input_line = input().split()

N = int(input_line[0])
M = int(input_line[1])
counter = 0 
counter += combinations_count(N,2) 
counter += combinations_count(M,2)
        
print(counter)

Buggy submission (verdict: Runtime Error):
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
import math
input_line = input().split()

N = int(input_line[0])
M = int(input_line[1])
counter = 0 
counter += combinations_count(N,2) 
counter += combinations_count(M,2)
        
print(counter)

Buggy submission (verdict: Runtime Error):
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
import math
input_line = input().split()

N = int(input_line[0])
M = int(input_line[1])
counter = 0 

counter = math.factorial(N) / math.factorial(N - 2)* math.factorial(2) + math.factorial(M) / math.factorial(M - 2)* math.factorial(2)
        
print(combinations_count(N,2)+ combinations_count(M,2))
Problem p02753 (python)

Fixed submission:
input_line = input()

if input_line == "AAA" or input_line == "BBB":
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
N, A, B = map(int, input().split()) 
ans = N // (A + B) * A
rem = N % (A + B)
ans += min(rem, A)
print(ans)
Problem p02676 (python)

Fixed submission:
K = int(input())
S = input()
SS = (int(len(S)))
if SS-K <= 0:
  print(S)
else:
  print((S[:K-SS])+('.'*3))

Buggy submission (verdict: Runtime Error):
K = int(input())
S = input()
SS = (int(len(S)))
if S <= 0:
  print(s)
else:
print(S[:SS-K])+print('.',K)
Problem p02627 (python)

Fixed submission:
a = input()
b = a.isupper()
if b == True:
    print("A")
else:
    print("a")

Buggy submission (verdict: Runtime Error):
a = input(α)
b = a.isupper()
print(b)
if b == True:
    print("A")
else:
    print("a")
Problem p02659 (python)

Fixed submission:
s = input().split()
 
num = int(s[0])
 
#num
 
num2 = int(s[1].replace('.', ''))
 
#num2
ans = (num*num2)//100
 
print(ans)

Buggy submission (verdict: Runtime Error):
s = input().split()
 
num = int(s[0])
 
#num
 
num2 = int(s[1]*100)
 
#num2
ans = num*num2//100

print(ans)
Problem p02831 (python)

Fixed submission:
# import math
import fractions

a, b = map(int, input().split())


def lcm(x, y):
    # return (x * y) // math.gcd(x, y)
    return (x * y) // fractions.gcd(x, y)


print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
import math

a, b = map(int, input().split())


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


print(lcm(a, b))
Problem p02627 (python)

Fixed submission:
alpha = input()
if alpha.isupper() == True:
    print("A")
else :
    print("a")

Buggy submission (verdict: Runtime Error):
alpha = input()
if alpha.isupper() == True:
    print(aplha.lower())
else :
    print(alpha.upper())
Problem p02699 (python)

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

if S <= W :
  print('unsafe')
else:
  print('safe')

Buggy submission (verdict: Runtime Error):
s_str = input()
# print(s_str)
# print(type(s_str))
# print()

# s_len = len(s_str)
# print(s_len)
# print(type(s_len))
# print()

list = []
for i in range(len(s_str)-1):
  s_new = s_str[i]
  # print('i=' + str(i))
  for j in range(i, len(s_str)):
    # print(s_new)
    if int(s_new) % 2019 == 0:
      # print('2019 * n number.')
      list.append(s_new)
    j = j + 1
    if j == len(s_str):
      break
    else:
      s_new = s_new + s_str[j]
  # print()
  i = i + 1

# print()
# print(list)
print(len(list))
Problem p02627 (python)

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

Buggy submission (verdict: Runtime Error):
n=int(input())
if n.islower():
  print('a')
else:
  print('A')
Problem p02693 (python)

Fixed submission:
n=int(input())
f=0
a,b=map(int,input().split())
for i in range(a,b+1):
  if i%n==0:
    print('OK')
    f=1
    break
if f==0:
  print('NG')

Buggy submission (verdict: Runtime Error):
n=int(input())
f=1
a,b=map(int,input().split())
for i in range(a,b+1):
  if i%n==0:
    print('yes')
    f=1
    break
if f==0:
  print('no)
Problem p02699 (python)

Fixed submission:
n,m=map(int,input().split())
print('unsafe' if m>=n else 'safe')

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
while 1:
    c-=b
    if a<=0  or c<=0:
        break
    a -= d
    if a<=0  or c<=0:
        break
print('Yes' if a>0 else 'No')
Problem p02627 (python)

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

Buggy submission (verdict: Runtime Error):
a = input()
if a.isupper() = True:
  print 'A'
else:
  print 'a'

Buggy submission (verdict: Runtime Error):
α = input()
if α.isupper() = True:
  print 'A'
else:
  print 'a'
Problem p02629 (python)

Fixed submission:
n=int(input())
s = ""
cons = 96

if n%26:
    s+=chr(cons + n%26)
else:
    n-=1
    s+="z"
n = n//26

while n:
    if n%26:
        s+=chr(cons + n%26)
    else:
        n-=1
        s+="z"
    n = n//26
    
print(s[::-1])

Buggy submission (verdict: Runtime Error):
s="abcdefghijklmnopqrstuvwxyz"
m=""
while n:		
  # print(r)
  if(n%26==0):
    m+='z'
    else:
      m+=s[(n%26)-1]
      n=(n//26)
      # reverse
      m=m[::-1]
      print(m)

Buggy submission (verdict: Runtime Error):
s="abcdefghijklmnopqrstuvwxyz"
	m=""
	while n:		
		# print(r)
		if(n%26==0):
			m+='z'
		else:
			m+=s[(n%26)-1]
		n=(n//26)
	# reverse
	m=m[::-1]
	print(m)
Problem p02711 (python)

Fixed submission:
n = str(input())
if n.count("7") >= 1:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = str(input())
if n.count(7) >= 1:
    print("Yes")
else:
    print("No")
Problem p02729 (python)

Fixed submission:
n, m = map(int, input().split())
print((n * ~-n // 2) + (m* ~-m // 2))#n * ~-n == n*(n-1)

Buggy submission (verdict: Runtime Error):
even, odd = map(int,input().split())
print((even*~-even // 2) + (odd*=~-odd // 2))

Buggy submission (verdict: Runtime Error):
even, odd = map(int,input().split())
print((even*~-n // 2) + (odd*=~-odd // 2))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb
list = input().rstrip().split(" ")
gusu = int(list[0])
kisu = int(list[1])
#奇数奇数の場合
kiki = int(comb(kisu, 2, exact=True))
#偶数偶数の場合
gugu = int(comb(gusu, 2, exact=True))
print(kiki + gugu)

Buggy submission (verdict: Runtime Error):
list = input().rstrip().split(" ")
kisu = int(list[1])
gusu = int(list[0])
#奇数奇数の場合
kiki = kisu * (kisu - 1
#偶数偶数の場合
Problem p02790 (python)

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

l = ['{}'.format(a)*b, '{}'.format(b)*a]
l.sort()
print(l[0])

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
A = list(str(a) * b)
B = list(str(b) * a)
if A[0] >= b[0]:
    print(str(a)*b)
else:
    print(str(b)*a)
Problem p02847 (python)

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

Buggy submission (verdict: Runtime Error):
s = input()
if s == "SUN":
    print("7")
elif S == "MON":
    print("6")
elif S == "TUE":
    print("5")
elif S == "WED":
    print("4")
elif S == "THU":
    print("3")
elif S == "FRI":
    print("2")
elif S == "SAT":
    print("1")
Problem p02879 (python)

Fixed submission:
a, b = map(int, input().split())
if a<=9 and b<=9:
    print(a*b)
else:
    print("-1")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a<=9 and b<=:
    print(a*b)
else:
    print("-1")
Problem p03272 (python)

Fixed submission:
n,i = input().split()
print(int(n)-int(i)+1)

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

for i in range(h)[::-1]:
    if "#" not in a[i]:
        del a[i]
        h -= 1

n = []
for j in range(w):
    m = ["".join(t[j] for t in a)]
    if "#" in m[0]:
        n += m

for k in range(h):
    print("".join(u[k] for u in n))
Problem p02987 (python)

Fixed submission:
import collections as coll
 
s = list(input().rstrip())
c = coll.Counter(s)
 
if len(c.keys()) != 2:
  print("No")
 
else:
  if c.most_common()[0][1] != 2:
    print("No")
  else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
import collections
 
s = list(input().rstrip())
c = coll.Counter(s)
 
if len(c.keys()) != 2:
  print("No")
 
else:
  if c.most_common()[0][1] != 2:
    print("No")
  else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
import collections

s = list(input().rstrip())
c = colc.Counter(s)

if len(c.keys()) != 2:
  print("No")

else:
  if c.most_common()[0][1] != 2:
    print("No")
  else:
    print("Yes")
Problem p02711 (python)

Fixed submission:
number = input()
  
if '7' in number:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
number = int(input())
  
if 7 in number:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
number = input()
  
if 7 in number:
	print("Yes")
else:
	print("No")
Problem p02951 (python)

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

Buggy submission (verdict: Runtime Error):
 a, b, c = map( int, imput().split())
if b + c<= a:
  print(0)
else:
  print(b+ c -a)
Problem p02773 (python)

Fixed submission:
import sys
from collections import defaultdict

N = int(sys.stdin.readline())
A = defaultdict(int)
for _ in range(N):
    s = sys.stdin.readline().strip()
    A[s] += 1

max_cnt = max(A.values())
ans = []
for key in A:
    if A[key] == max_cnt:
        ans.append(key)
ans.sort()
[print(s) for s in ans]

Buggy submission (verdict: Runtime Error):
N = int(input())
cnt_s = {}
for _ in range(N):
  s = input()
  if s in cnt_s:
    cnt_s[s] += 1
  else:
    cnt_s[s] - 1
  
max_cnt = max(cnt_s.values())

ans = []
for key, value in cnt_s.items():
  if value == max_cnt:
    ans.append(key)
  
[print(s) for s in sorted(ans)]
Problem p02912 (python)

Fixed submission:
import heapq

N,M = map(int,input().split())
A = []
for a in map(int,input().split()):
  heapq.heappush(A,-a)

cnt = 0
while cnt < M:
  a = heapq.heappop(A)
  heapq.heappush(A,-((-a)//2))
  cnt += 1
print(-sum(A))

Buggy submission (verdict: Runtime Error):
import bisect
import copy

N,M = map(int,input().split())
A = sorted(list(map(int,input().split())))
A2 = copy.deepcopy(A[N-M:])

for _ in range(M):
  tmp_a = int(A2[-1]/2)
  if A2[-2] <= tmp_a:
    A2[-1] = tmp_a
  else:
    del A2[-1]
    A2.insert(bisect.bisect_left(A2,tmp_a),tmp_a)
print(sum(A[:N-M])+sum(A2))

Buggy submission (verdict: Runtime Error):
import bisect
import copy

N,M = map(int,input().split())
A = sorted(list(map(int,input().split())))
A2 = copy.deepcopy(A[N-M:])

for _ in range(M):
  tmp_a = int(A2[-1]/2)
  del A2[-1]
  if A2 <= tmp_a: A2.append(tmp_a)
  else: A2.insert(bisect.bisect_left(A2,tmp_a),tmp_a)
print(sum(A[:N-M])+sum(A2))
Problem p02933 (python)

Fixed submission:
import sys
a = int(sys.stdin.readline())
if a >= 3200:
  print(sys.stdin.readline())
else:
  print('red')

Buggy submission (verdict: Runtime Error):
import sys

def add_count(addnum, relations, counters, nodelist):
  new_nodelist = []
  for node in nodelist:
    if node not in relations:
      continue
    else:
      new_nodelist = new_nodelist + relations[node]
      for child in relations[node]:
        counters[child-1] += addnum
  
  if len(new_nodelist) == 0:
    return counters
  else:
    return add_count(addnum, relations, counters, new_nodelist)

N, Q = map(int, sys.stdin.readline().split())
alist = list(list(map(int, sys.stdin.readline().split())) for i in range(N-1))
qlist = list(list(map(int, sys.stdin.readline().split())) for i in range(Q))

counters = [0 for i in range(N)]
relations = {}
for a in alist:
  if a[0] not in relations:
    relations[a[0]] = [a[1]]
  else:
    relations[a[0]].append(a[1])
    
for q in qlist:
  counters[q[0]-1] += q[1]
  counters = add_count(q[1], relations, counters, [q[0]])

print(' '.join(map(str,counters)))