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

Fixed submission:
nums = list( map( int, input().split() ) ) 
nums.sort()

if nums[0]+nums[1]==nums[2]:
  print("Yes")
else :
  print("No")

Buggy submission (verdict: Runtime Error):
nums = map( int, input().split() )
nums.sort()

if num[0]+num[1]==num[2]:
  print("Yes")
else :
  print("No")

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

sorted = list.sort()

if sorted[0]+sorted[1]==sorted[2] :
  print( "Yes" )
else : 
  print( "No" )

Buggy submission (verdict: Runtime Error):
num = list( map( int, input().split() ) )
[ a, b, c ] = num.sort()
 
if a + b == c:
  print( "Yes" )
else :
  print( "No" )

Buggy submission (verdict: Runtime Error):
num = list( map( int, input().split() ) )
[ a, b, c ] = sort( num )
 
if a + b == c:
  print( "Yes" )
else :
  print( "No" )

Buggy submission (verdict: Runtime Error):
num = list( map( int, input().split() ) )
[ a, b, c ] = sort( list )

if a + b == c:
  print( "Yes" )
else :
  print( "No" )
Problem p03962 (python)

Fixed submission:
cols = set( map( int, input().split() ) )
 
print( len( cols ) )

Buggy submission (verdict: Runtime Error):
cols = map( int, input().split() )
cols set = set( cols )

print( len( cols set ) )

Buggy submission (verdict: Runtime Error):
cols = list( int, input().split() )

num col = cols.unique();

print( num col )
Problem p03998 (python)

Fixed submission:
s = [ str( input() ) for x in range(3) ]
flag = 0
t = 0
while flag == 0 :
   if len( s[t] ) != 0 : 
      tnext = s[t][0]
      s[t] = s[t][1:]
      t = ord( tnext ) - ord( "a" )
   else :
      flag = 1
      print( chr( ord("A")+ t ) )

Buggy submission (verdict: Runtime Error):
s = [ str( input() ) for x in range(3) ]
flag = 0
t = 0
while flag == 0
   if len( s[t] ) != 0
      t = s[t][0]
      s[t] = s[t][1:]
   else :
      print( char( ord("A")+ t ) )
Problem p04011 (python)

Fixed submission:
N = int( input() )
K = int( input() )
X = int( input() )
Y = int( input() )
 
if N < K + 1 :
   tot = N * X
else : 
   tot = K * X + ( N - K ) * Y
  
print( tot )

Buggy submission (verdict: Runtime Error):
[N,K,X,Y] = list( int, input().split() )

if N < K+1 : 
   tot = N * X
else : 
   tot = N * K + ( N - K ) * Y
    
print( tot )
Problem p04029 (python)

Fixed submission:
a = int( input() )

sol = a * ( a + 1 ) // 2 

print( sol )

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

sol = a * (a + 1) / 2

print( sol )
Problem p04043 (python)

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

a.sort()

if a == [5,5,7] : 
  print( "YES" )
else :
  print( "NO" )

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

in.sort()

if in=[5,5,7] : 
  print( 'Yes' )
else : 
  print( 'No' )

Buggy submission (verdict: Runtime Error):
number1 = input("First number: ") 
number2 = input("\nSecond number: ") 
number3 = input("\nSecond number: ") 
  
if ( (number1==5&number1==7&number1==5) |
     (number1==7&number1==5&number1==5) |
     (number1==5&number1==5&number1==7) ) : 
    print("Yes") 
else: 
    print("No" )
Problem p03160 (python)

Fixed submission:
N = int(input())
h_array = list(map(int, input().split()))

dp = [10 ** 5 for i in range(N)]

for i in range(N):
    if i == 0:
        dp[0] = 0
    elif i == 1:
        dp[1] = dp[0] + abs(h_array[1] - h_array[0])
    else:
        dp[i] = min(dp[i - 1] + abs(h_array[i] - h_array[i - 1]), dp[i - 2] + abs(h_array[i] - h_array[i - 2]))
print(dp[N - 1])

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
h_array = np.array(list(map(int, input().split()))).reshape(-1)


def cost_diff(num, span, given_array):
    diff_val = np.abs(given_array[num] - given_array[num - span])
    return diff_val


dp = [[] for i in range(N)]
diff_ini = cost_diff(1, 1, h_array)

for i in range(N):
    if i == 0:
        dp[0].append(0)
    elif i == 1:
        dp[1].append(min(dp[0] + diff_ini))
    else:
        tmp_1 = dp[i - 1] + cost_diff(i, 1, h_array)
        tmp_2 = dp[i - 2] + cost_diff(i, 2, h_array)
        tmp = np.min(tmp_1, tmp_2)
        dp[i].append(tmp)
print(dp[N - 1][0])
Problem p03086 (python)

Fixed submission:
S=input()
judge=''
L=len(S)
for index in range(L):
    moji=S[index]
    if (moji=='A') or (moji=='G') or (moji=='T') or (moji=='C'):
        judge+='X'
    else:
        judge+='W'
#print(judge)
num_keeper=[]
num=0
for index in range(L):
    J=judge[index]
    if (index==0) and (J=='X'):
        num=1
    elif J=='W':
        num_keeper.append(num)
        num=0
    elif (index==L-1) and (J=='X'):
        num+=1
        num_keeper.append(num)
    else:
        num+=1
if len(num_keeper)==0:
    num_keeper.append(L)
print(max(num_keeper))

Buggy submission (verdict: Runtime Error):
S=input()
judge=''
L=len(S)
for index in range(L):
    moji=S[index]
    if (moji=='A') or (moji=='G') or (moji=='T') or (moji=='C'):
        judge+='X'
    else:
        judge+='W'
#print(judge)
num_keeper=[]
num=0
for index in range(L):
    J=judge[index]
    if index==0 and J=='X':
        num=1
    elif J=='W':
        num_keeper.append(num)
        num=0
    else:
        num+=1
    #print(num)
print(max(num_keeper))
Problem p03106 (python)

Fixed submission:
a,b,k=map(int,input().split())
yakusuu_array=[]
if a==b:
    max_gcd=a
else:
    for l in  reversed(range(min(a,b)+1)):
        if (a%l==0) and (b%l==0):
            max_gcd=l
            break        
if k==1:
    print(max_gcd)
else:
    for i in range(1,max_gcd):
        if max_gcd % i == 0:
            yakusuu_array.append(i)

    #print(max_gcd)
    #print(yakusuu_array)
    print(yakusuu_array[-(k-1)])

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
yakusuu_array=[]
if a==b:
    max_gcd=a
else:
    for l in  reversed(range(min(a,b))):
        if max(a,b)%l==0:
            max_gcd=l
            break        
if k==1:
    print(max_gcd)
else:
    for i in range(1,max_gcd):
        if max_gcd % i == 0:
            yakusuu_array.append(i)

    print(yakusuu_array[-(k-1)])

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
import math
max_gcd=math.gcd(a, b)
yakusuu_array=[]
if k==1:
    print(max_gcd)
else:
    for i in range(1,max_gcd):
        if max_gcd % i == 0:
            yakusuu_array.append(i)

    print(yakusuu_array[-(k-1)])
Problem p03150 (python)

Fixed submission:
import re

S=input()

if re.match("keyence",S) or re.match("^(.*)(keyence)$",S) or re.match("^k(.*)(eyence)$",S) or re.match("^(ke)(.*)(yence)$",S) or re.match("^(key)(.*)(ence)$",S) or re.match("^(keye)(.*)(nce)$",S) or re.match("^(keyen)(.*)(ce)$",S) or re.match("^(keyenc)(.*)(e)$",S)  or re.match("^(keyence)(.*)$",S):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
import re

if re.match("keyence",S) or re.match("^(.*)(keyence)$",S) or re.match("^k(.*)(eyence)$",S) or re.match("^(ke)(.*)(yence)$",S) or re.match("^(key)(.*)(ence)$",S) or re.match("^(keye)(.*)(nce)$",S) or re.match("^(keyen)(.*)(ce)$",S) or re.match("^(keyenc)(.*)(e)$",S)  or re.match("^(keyence)(.*)$",S):
    print("YES")
else:
    print("NO")
Problem p03193 (python)

Fixed submission:
a =[]
N,H,W = map(int, input().split())
for i in range(N):
    a.append(list(map(int, input().split())))

num =0
for i in range(N):
    if a[i][0]>=H:
        if a[i][1] >= W:
            num +=1
print(num)

Buggy submission (verdict: Runtime Error):
N,H,W = map(int, input().split())
for i in range(N):
    a.append(list(map(int, input().split())))

num =0
a =[]
for i in range(N):
    if a[i][0]>=H:
        if a[i][1] >= W:
            num +=1
print(num)

Buggy submission (verdict: Runtime Error):
N,H,W = map(int, input().split())
for i in range(N):
    a.append(list(map(int, input().split())))

num =0
for i in range(N):
    if a[i][0]>=H:
        if a[i][1] >= W:
            num +=1
print(num)

Buggy submission (verdict: Runtime Error):
N,H,W = map(int, raw_input().split())
for i in range(N):
    a.append(list(map(int, input().split())))

num =0
for i in range(N):
    if a[i][0]>=H:
        if a[i][1] >= W:
            num +=1
print(num)

Buggy submission (verdict: Runtime Error):
N,H,W = map(int, raw_input().split())
a = []
a = []
for i in range(N):
    a.append(list(map(int, input().split())))

num =0
for i in range(N):
    if a[i][0]>=H:
        if a[i][1] >= W:
            num +=1
print(num)
Problem p03262 (python)

Fixed submission:
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return(a)

N,X=map(int,input().split())
x_list=list(map(int,input().split()))

#x_list.append(X)
x_list_new=sorted(x_list)
x_list_new_dif=[abs(x_list_new[i]-X) for i in range(len(x_list_new))]

for i in range(len(x_list_new_dif)):
    if i==0:
        skip=x_list_new_dif[0]
    else:
        skip=gcd(skip,x_list_new_dif[i])
print(skip)

Buggy submission (verdict: Runtime Error):
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return(a)

N,X=map(int,input().split())
x_list=list(map(int,input().split()))

#x_list.append(X)
#x_list_new=sorted(x_list)
x_list_new_dif=[abs(x_list_new[i]-X) for i in range(len(x_list_new))]

for i in range(len(x_list_new_dif)):
    if i==0:
        skip=x_list_new_dif[0]
    else:
        skip=gcd(skip,x_list_new_dif[i])
print(skip)
Problem p03549 (python)

Fixed submission:
N,M=list(map(int,input().split()))

ans=(1900*M+100*(N-M))*(2**M)
print(ans)

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

ans=(1900M+100(N-M))*2^M
print(ans)

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

ans=1900M+100(N-M)*2^M
print(ans)

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

ans=1900M+100(N-M)*2^M
Problem p02882 (python)

Fixed submission:
import math

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

S = a*b
I = x/a

if I > S/2:
  print(math.degrees(math.atan(2*(S-I)/a**2)))
else:
  print(90-math.degrees(math.atan(2*I/b**2)))

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

S = a*b
I = x/a

if I > S/2:
  print(math.degrees(math.atan(2*(S-I)/a**2)))
else:
  print(90-math.degrees(math.atan(2*I/b**2)))
Problem p02960 (python)

Fixed submission:
import numpy as np

s = input()
p = np.array([0]*13)
p[0] = 1

amari = [[0]*13 for _ in range(13)]
for j in range(10):
  for i in range(13):
    amari[i][(i*10+j)%13] += 1
M = np.array(amari)

for si in range(len(s)):
  a = np.array([0]*13)
  if s[si] == '?':
    a = np.dot(p,M)
  else:
    c = int(s[si])
    for i in range(13):
      a[(i*10+c)%13] += p[i]
  p = np.mod(a,1000000007)
print(p[5])

Buggy submission (verdict: Runtime Error):
def main():
  M=10**9+7
  r=tuple(tuple((j-k)*9%13for j in range(10))for k in range(13))
  d=[1]+[0]*12
  for c in input():
    d = if c>'9' [sum(d[j]for j in k)%M for k in r] else [d[(int(c)-k)*9%13]for k in range(13)]
  print(d[5])
main()
Problem p02972 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = [0 for n in range(N+1)]
x = []

for n in range(N):
  i = N-n
  # print(i)
  BB = B[::i]
  if (sum(BB))%2 == A[i-1]:
    B[i] = 0
  else:
    B[i] = 1
    # print(B)
  if B[i] == 1:
    x.append(str(i))
  
if len(x) == 0:
  print(0)
else:
  print(len(x))
  print(' '.join(x))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = [0]*(N+1)
ans = []
 
for n in range(N):
  i = N-n
  BB = B[::i]
  if (sum(BB))%2 != A[i-1]:
    B[i] = 1
    ans.append(str(i))
  
print(len(x))
print(' '.join(ans))
Problem p02784 (python)

Fixed submission:
H, N = map(int, input().split())
A = (map(int, input().split()))
for i in A:
    H -= i
 
if H > 0:
    print('No')
else:
    print('Yes')

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

for i in A:
    H -= i

if H > 0:
    print('No')
else
    print('Yes')
Problem p02761 (python)

Fixed submission:
N, M = input().split()
N = int(N)
M = int(M)
S = []
C = []
A = []
zero_flag = False
for m in range(M):
  s, c = input().split()
  s = int(s)
  c = int(c)
  S.append(s)
  C.append(c)
  if s == 2 and c == 0 and N == 2:
    A.append('0')
  elif s == 2 and c == 0 and N == 3:
    A.append('00')
  elif s == 3 and c == 0 and N == 3:
    A.append('0') 
  else:
  	A.append(str((10**(N-(s-1)-1)) * c))
  if s == 1 and c == 0 and N != 1:
    zero_flag = True

flag = False
for a1 in A:
  for a2 in A:
    if a1 != a2 and len(a1) == len(a2):
      if a1 != a2:
        flag = True

if zero_flag:
  print(-1)
elif flag:
  print(-1)
else:
  ans = list(set(A))
  sum_ans = 0
  for a in ans:
    sum_ans += int(a)
  if sum_ans < (10**(N-1)) and N != 1:
  	sum_ans = sum_ans + (10**(N-1)) 
  print(sum_ans)

Buggy submission (verdict: Runtime Error):
N, M = input().split()
N = int(N)
M = int(M)
S = []
C = []
A = []
zero_flag = False
for m in range(M):
  s, c = input().split()
  s = int(s)
  c = int(c)
  S.append(s)
  C.append(c)
  if s == 2 and c == 0 and N == 2:
    A.append('0')
  elif s == 2 and c == 0 and N == 3:
    A.append('00')
  elif s == 3 and c == 0 and N == 3:
    A.append('0') 
  else:
  	A.append(str((10**(N-(s-1)-1)) * c))
  if s == 1 and c == 0 and N != 2:
    zero_flag = True
    
flag = False
for a1 in A:
  for a2 in A:
    if a1 != a2 and len(a1) == len(a2):
      if a1 != a2:
        flag = True

if zero_flag:
  print('-1')
elif flag:
  print('-1')
else:
  ans = list(set(A))
  sum_ans = 0
  for a in ans:
    sum_ans += int(a)
  if sum_ans < (10**(N-(s-1)-1)):
  	sum_ans = sum_ans + (10**(N-1)) 
  print(sum_ans)

Buggy submission (verdict: Runtime Error):
N, M = input().split()
N = int(N)
M = int(M)
S = []
C = []
A = []
zero_flag = False
for m in range(M):
  s, c = input().split()
  s = int(s)
  c = int(c)
  S.append(s)
  C.append(c)
  if s == 2 and c == 0 and N == 2:
    A.append('0')
  elif s == 2 and c == 0 and N == 3:
    A.append('00')
  elif s == 3 and c == 0 and N == 3:
    A.append('0') 
  else:
  	A.append(str((10**(N-(s-1)-1)) * c))
  if s == 1 and c == 0 and N != 2:
    zero_flag = True
    
flag = False
for a1 in A:
  for a2 in A:
    if a1 != a2 and len(a1) == len(a2):
      if a1 != a2:
        flag = True

if zero_flag:
  print('-1')
elif flag:
  print('-1')
else:
  ans = list(set(A))
  sum_ans = 0
  for a in ans:
    sum_ans += int(a)
  if sum_ans < (10**(N-(s-1)-1)):
  	sum_ans = sum_ans + (10**(N-1)) 
  print(sum_ans)
Problem p02765 (python)

Fixed submission:
N, R = map(int, input().split(' '))
if N < 10:
    L =  R+100*(10-N)
    print('{}'.format(L))

else:
    print('{}'.format(R))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split(' '))
#K進数で表そう
l = []
while N >= K:
    a = N % K
    N = N // K
    l.append(a)


print(len(l) + 1)

Buggy submission (verdict: Runtime Error):
N, R = map(int, input().split(' '))
if N < 9:
    L =  R+100*(10-N)
    print('{}'format(L))

else:
    print('{}'.format(R))
Problem p02761 (python)

Fixed submission:
# n, m = map(int, input().split())
# if (m == 0):
#     print('1' + '0' * (n - 1))
#     exit()
# dic = {}
# for i in range(m):
#     s, c = map(int, input().split())
#     try:
#         _ = dic[s]
#     except KeyError:
#         if (s == 1 and c == 0):
#             print(-1)
#             exit()
#         dic[s] = c
#     else:
#         if (dic[s] != c):
#             print(-1)
#             exit()

# ans = '0' * n
# for k, v in dic.items():
#     ans = ans[:k - 1] + str(v) + ans[k:]

# try:
#     digit1 = dic[1]
# except KeyError:
#     digit1 = 1

# if (digit1 == 0):
#     ans = '1' + ans[1:]

# print(ans)
n, m = map(int, input().split())
if (n == 1 and m == 0):
    print(0)
    exit()
if (m == 0):
    print('1' + '0' * (n - 1))
    exit()
dic = {}
for i in range(m):
    s, c = map(int, input().split())
    try:
        _ = dic[s]
    except KeyError:
        if (s == 1 and c == 0 and n >= 2):
            print(-1)
            exit()
        dic[s] = c
    else:
        if (dic[s] != c):
            print(-1)
            exit()

ok = False
if (n == 1):
    for k, v in dic.items():
        print(v)
        exit()
else:
    for i in range(10 ** (n - 1), 10 ** n):
        for k, v in dic.items():
            if (str(i)[k - 1] == str(v)):
                ok = True
            else:
                ok = False
                break
        else:
            if (ok):
                print(i)
                exit()

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
# S = [None] * m
# C = [None] * m
dic = {}
for i in range(m):
    s, c = map(int, input().split())
    try:
        _ = dic[s]
    except KeyError:
        dic[s] = c
    else:
        if (dic[s] != c):
            print(-1)
            exit()

ans = '0' * n
for k, v in dic.items():
    ans = ans[:k - 1] + str(v) + ans[k:]

try:
    digit1 = dic[1]
except KeyError:
    digit1 = 1

if (digit1 == 0 and ans[0] == '0'):
    print(-1)
    exit()
elif (dic[1] == 0):
    ans = '1' + ans[1:]

print(ans)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
# S = [None] * m
# C = [None] * m
dic = {}
for i in range(m):
    s, c = map(int, input().split())
    try:
        _ = dic[s]
    except KeyError:
        dic[s] = c
    else:
        if (dic[s] != c):
            print(-1)
            exit()

ans = '0' * n
for k, v in dic.items():
    ans = ans[:k - 1] + str(v) + ans[k:]

if (dic[1] == 0 and ans[0] == '0'):
    print(-1)
    exit()
elif (dic[1] == 0):
    ans = '1' + ans[1:]

print(ans)
Problem p02866 (python)

Fixed submission:
# N = int(input())
# D = list(map(int, input().split()))
# count = [0] * N
# ans = 1
# if (D[0] != 0 or count[0] >= 2):
#     print(0)
#     exit()
# for d in D:
#     count[d] += 1
# for i in range(N):
#     if (i > 0):
#         ans *= (count[i - 1] ** count[i]) % 998244353
#         ans %= 998244353

# print(ans)


# from collections import Counter
N = int(input())
D = list(map(int, input().split()))
MOD = 998244353

# 厳密にはmax(D)+1の長さがあれば正常系は通るが、余分に取っておく
count = [0] * N
for d in D:
    count[d] += 1

def calc():
    if D[0] != 0 or count[0] >= 2:
        return 0
    ret = 1
    for i in range(N):
        if i > 0:
            ret *= (count[i-1] ** count[i]) % MOD
            ret %= MOD
    return ret


print(calc())

Buggy submission (verdict: Runtime Error):
N = int(input())
D = list(map(int, input().split()))
count = [0] * (N)
ans = 1
if (D[0] != 0):
    print(0)
    exit()
for d in D:
    count[d] += 1
for i in range(1, N):
    ans *= (count[i] ** count[i + 1]) % 998244353

print(ans % 998244353)
Problem p03001 (python)

Fixed submission:
import sys
input = sys.stdin.readline
W, H, x, y = map(int, input().split())
S = W * H * 0.5
if (x != 0 and y/x == H/W and W % 2 == 0):
  print(S, 1)
else:
  print(S, 0)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
W, H, x, y = map(int, input().split())
S = W * H * 0.5
if (y/x == H/W):
  print(S, 1)
else:
  print(S, 0)
Problem p03061 (python)

Fixed submission:
# -*- coding: utf-8 -*-
import sys
from functools import reduce
import sys
input = sys.stdin.readline
n = int(input())
A = list(map(int, input().split()))

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


L = [0] + [None] * (n - 1)
R = [0] + [None] * (n - 1)
for i in range(1, n):
	L[i] = gcd(L[i - 1], A[i - 1])
	R[i] = gcd(R[i - 1], A[-i])

M = [None] * n
R = R[::-1]
for i in range(n):
	M[i] = gcd(L[i], R[i])

print(max(M))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
n = int(input())
A = list(map(int, input().split()))


def gcd_list(numbers):
    return reduce(math.gcd, numbers)


ans = 0
for i in range(n):
    gcd = gcd_list(A[0:i] + A[i + 1:])
    if (ans < gcd):
        ans = gcd

print(ans)
Problem p03069 (python)

Fixed submission:
n = int(input())
S = list(input())
ans = S.count('.')
c = ans
for i in range(n):
    if (S[i] == '#'):
        c += 1
    else:
        c -= 1
    ans = min(ans, c)


print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input())
cd = 0
cs = 0
ans = 0

if (s[0] == '#'):
  for i in range(n):
    if (s[i] == '.'):
      break
    elif (s[i] == '#'):
      cs += 1

for i in range(cs, n):
  if (s[i] == '.'):
      cd += 1
  elif (s[i] == '#'):
    break

if (cs < cd):
  ans += cs
  s[0:cs + cd] = ''

s = s[::-1]

if (s[0] == '.'):
  for i in range(n):
    if (s[i] == '#'):
      break
    elif (s[i] == '.'):
      cd += 1

for i in range(cd, n):
  if (s[i] == '#'):
      cs += 1
  elif (s[i] == '.'):
    break

if (cd < cs):
  ans += cd
  s[0:cd + cs] = ''


ans1 = s.count('.')
ans2 = s.count('#')
print(min([ans1, ans2]) + ans)
Problem p03076 (python)

Fixed submission:
A = [int(input()) for _ in range(5)]
B = [a%10 for a in A]
C = [10 - b for b in B]
while (10 in C):
  C.remove(10)

if (len(C)):
  C.remove(max(C))
print(sum(A) + sum(C))

Buggy submission (verdict: Runtime Error):
A = [int(input()) for _ in range(5)]
B = [a%10 for a in A]
C = [10 - b for b in B]
while (10 in C):
  C.remove(10)
C.remove(max(C))
print(sum(A) + sum(C))

Buggy submission (verdict: Runtime Error):
A = [int(input()) for _ in range(5)]
B = [a%10 for a in A]
C = [10 - b for b in B]
while (10 in C):
  C.remove(10)
print(sum(A) + sum(C) - max(C))
Problem p03101 (python)

Fixed submission:
H, W = map(int, input().split())
h, w = map(int, input().split())
ans = H * W - (h * W + w * H - h * w) 
print(ans)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
h, w = map(int, input().split())
ans = h * W + w * H - h * w 
print(ans)H, W = map(int, input().split())
h, w = map(int, input().split())
ans = H * W - (h * W + w * H - h * w) 
print(ans)
Problem p03206 (python)

Fixed submission:
str = "Christmas"
for i in range(25-int(input())):
    str += " Eve"
print(str)

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


def pi(n):
    return 2**(n+1)-1


def ai(n):
    return 2**(n+2) - 3


def f(n, x):
    if (x <= 1) or (n <= 0):
        return 0
    elif (1 < x) and (x <= 1 + ai(n-1)):
        return f(n - 1, x - 1)
    elif x == 2 + ai(n - 1):
        return pi(n - 1) + 1
    elif (2 + ai(n - 1) < x) and (x <= 2 + 2 * ai(n - 1)):
        return pi(n-1) + 1 + f(n-1, x-2-ai(n-1))
    elif x >= ai(n):
        return pi(n)


print(f(n, x))

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

Buggy submission (verdict: Runtime Error):
p=[int(input()) for i in range(int(input()))]
print(sum(p)-max(p)//2)
Problem p03210 (python)

Fixed submission:
n = input()
if (n == '3') or (n == '5') or (n == '7'):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
if (input() == '3') or (input() == '5') or (input() == '7'):
  print("YES")
else:
  print("NO")n = input()
if (n == '3') or (n == '5') or (n == '7'):
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
if (input() == '3') or (input() == '5') or (input() == '7'):
  print("YES")
else:
  print("NO")
Problem p03359 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = map(int, input())
if (a <= b):
  print(a)
else:
  print(a - 1)
Problem p03423 (python)

Fixed submission:
n = int(input())
print(n//3)

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

Buggy submission (verdict: Runtime Error):
  n = int(input())
  print((n - n  % 3)//3)

Buggy submission (verdict: Runtime Error):
n = int()  n = int(input())
  print((n - n  % 3)//3)