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

Fixed submission:
s = list(input())
t = list(input())

ls = len(s)
lt = len(t)
match = -1

for i in range(ls-lt+1):
    for j in range(lt):
        if s[i+j] == t[j] or s[i+j] == '?':
            pass
            #continueはここで処理が終わってしまう
        else:
            break
            
        if j == lt - 1:
            match = i
        
for i in range(ls):
    if s[i] == '?':
        s[i] = 'a'
        
for i in range(lt):
    s[match+i] = t[i]
        
if match < 0:
    print("UNRESTORABLE")
else:
    print(''.join(s))

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

flag = True
s_len = len(s)
t_len = len(t)
max_ha = 0
l = []
max_save = 0
save = 0
count = 0

for i in range(s_len):
    if s[i] == '?':
        s[i] = 'a'
        count += 1
        max_ha += 1
        max_save = i
        if count == t_len and flag:
            save = i - count + 1
            flag = False
    elif count < t_len and s[i] == t[count]:
        l.append([max_ha, max_save])
        max_ha = 0
        count += 1
        if count == t_len and flag:
            save = i - count + 1
            flag = False
    else:
        l.append([max_ha, max_save])
        max_ha = 0
        count = 0

max_ha, max_save = max(l)        
        
if t_len < max_ha:
    for j in range(t_len):
        s[max_save-j] = t[t_len-j-1]
else:
    for j in range(t_len):
        s[j+save] = t[j]

if flag:
    print("UNRESTORABLE")
else:
    print(s)

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

flag = True
s_len = len(s)
t_len = len(t)
save = 0
count = 0

for i in range(s_len):
    if s[i] == '?':
        s[i] = 'a'
        count += 1
        if count == t_len and flag:
            save = i - count + 1
            flag = False
    elif count < t_len and s[i] == t[count]:
        count += 1
        if count == t_len and flag:
            save = i - count + 1
            flag = False
    else:
        count = 0
        
for j in range(t_len):
    s[j+save] = t[j]

if flag:
    print("UNRESTORABLE")
else:
    print(s)

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

flag = True
s_len = len(s)
t_len = len(t)
save = 0
count = 0

for i in range(s_len):
    if s[i] == '?':
        s[i] = 'a'
        count += 1
        if count == t_len and flag:
            save = i - count + 1
            flag = False
    elif s[i] == t[count]:
        count += 1
        if count == t_len and flag:
            save = i - count + 1
            flag = False
    else:
        count = 0
        
for j in range(t_len):
    s[j+save] = t[j]

if flag:
    print("UNRESTORABLE")
else:
    print(s)
Problem p04001 (python)

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

def part_sum(cur, i, res):
    if i < n-1:
        part_sum(cur+s[i], i+1, res)
        part_sum(cur+s[i]+"+", i+1, res)
    else:
        cur += s[i]
        res.append(sum(list(map(int, cur.split("+")))) )
    return res
  
res = part_sum("", 0, [])
print(sum(res))

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

res = 0

def part_sum(cur, i):
  if i != n:
    res += part_sum(cur+s[i], i+1)
    res += part_sum(cur+s[i]+"+", i+1)
  else:
    cur += s[i]
    return sum(list(map(int, cur.split("+")))) 
  
part_sum("", 0)
print(res)

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

res = 0

def part_sum(cur, i):
  if i != n:
    part_sum(cur+s[i], i+1)
    part_sum(cur+s[i]+"+", i+1)
  else:
    cur += s[i]
    res += sum(list(map(int, cur.split("+")))) 
  
part_sum("", 0)
print(res)

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

res = 0

def part_sum(cur, i):
  if i != n:
    part_sum(cur+s[i], i+1)
    part_sum(cur+s[i]+"+", i+1)
  else:
    cur += s[i]
    res += sum(list(map(int, cur.split("+")))) 
  
part_sum([], 0)
print(res)

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

res = 0

def part_sum(cur, i):
  if i != n:
    part_sum(cur+s[i], i+1)
    part_sum(cur+"+"+s[i], i+1)
  else:
    cur += s[i]
    res += sum(list(map(int, res.split("+")))) 
  
part_sum([], 0)
print(res)
Problem p03573 (python)

Fixed submission:
A,B,C = [int(i) for i in input().split()]

if(A==B):
    print(C)
elif(A==C):
    print(B)
else :
    print(A)

Buggy submission (verdict: Runtime Error):
import copy

def set(adjacent,edge):
    for x in edge:
        adjacent[x[0]].append(x[1])
        adjacent[x[1]].append(x[0])

    
def search(goal,path):
    n = path[len(path) - 1]
    if n == goal:
        print(path)
    else:
        for x in adjacent[n]:
            if x not in path:
                path.append(x)
                search(goal, path)
                path.pop()

def search_loop_node(adjacent,start,path,node_loops):
    n = path[len(path)-1]
    for x in adjacent[n]:
        if x == start and len(path) >=2 and path[-2] != start :
            path.append(x)
            node_loops.append(copy.deepcopy(path))
            path.pop()
        elif x not in path:
            path.append(x)
            search_loop_node(adjacent,start, path,node_loops)
            path.pop()

def main():
    #入力
    N, M = [int(i) for i in input().split()]
    edge = []
    for i in range(M):
        a,b = [int(i) for i in input().split()]
        edge.append([a,b])

    #辺の生成
    adjacent=[ [] for i in range(N+1)]
    loops=[]
    set(adjacent,edge)
    #ループの検索
    for i in range(N):
        search_loop_node(adjacent,i,[i],loops)
    #ループに属する辺(橋でない辺)の検索
    not_bridge = []
    for loop in loops:
        pre_node = loop[0]
        for node in loop:
            if pre_node < node and [pre_node, node] not in not_bridge:
                not_bridge.append([pre_node,node])
            pre_node = node
    #答えは全体の辺の数からループでないものを引いた数
    print(M-len(not_bridge))
    
if __name__ == '__main__':
    main()
Problem p02812 (python)

Fixed submission:
n = int(input())
a = list(input())
ans = 0
for i in range(n-2):
  if a[i]=='A' and a[i+1]=='B' and a[i+2]=='C':
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input())
ans = 0
for i in range(n-2):
  if a[i]=='A' and a[i+1]=='B' and a[i+2]=='C':
    ans+=1
print(ans)
Problem p02952 (python)

Fixed submission:
n = input()
l = len(n)
y = 0
if l >= 2:
    for i in range(1, l, 2):
        y += 9 * 10 ** (i-1)
    if l % 2 == 1:
        y += int(n) - int('9'*(l-1))
else: y = int(n)
print(y)

Buggy submission (verdict: Runtime Error):
n = input()
l = len(n)
y = 0
for i in range(1, l, 2):
  y += 9 * 10 ** (i-1)
if l % 2 == 1:
  y += int(n) - int('9'*(l-1))
print(y)
Problem p02971 (python)

Fixed submission:
n = int(input())
a = [int(input()) for _ in range(n)]
a1 = sorted(a)
st = a1[-1]
nd = a1[-2]
for i in a:
  if i == st:
    print(nd)
  else: print(st)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for _ in range(n)]
a1 = a.sorted()
st = a1[-1]
nd = a1[-2]
for i in a:
  if i = st:
    print(nd)
  else: print(st)
Problem p02885 (python)

Fixed submission:
a, b = map(int, input().split())
print(max(a-b*2, 0))

Buggy submission (verdict: Runtime Error):
a,b=map(int, input())
print(max(a-b*2,0))
Problem p02957 (python)

Fixed submission:
A, B = map(int, input().split())
if (A + B) % 2 == 0:
    print((A+B)//2)
else:
    print('IMPOSSIBLE')

Buggy submission (verdict: Runtime Error):
S = input()[::-1]
MOD = 10**9+7
dp = (1,0,0,0,0,0,0,0,0,0,0,0,0)
p = 1
for i, s in enumerate(S):
    nx = [0,]*13
    if s == '?':
        for k in range(10):
            q = (k*p)%13
            for j, d in enumerate(dp):
                nx[(j+q)%13] += d
    else:
        q = (int(s)*p)%13
        for j, d in enumerate(dp):
            nx[(j+q)%13] += d
    dp = (n % MOD for n in nx)
    p = (10*p)%13
print(dp[5])
Problem p02960 (python)

Fixed submission:
S = input()[::-1]
MOD = 10**9+7
dp = [1,0,0,0,0,0,0,0,0,0,0,0,0]
p = 1
for i, s in enumerate(S):
    nx = [0,]*13
    if s == '?':
        for k in range(10):
            q = (k*p)%13
            for j, d in enumerate(dp):
                nx[(j+q)%13] += d
    else:
        q = (int(s)*p)%13
        for j, d in enumerate(dp):
            nx[(j+q)%13] += d
    dp = [n % MOD for n in nx]
    p = (10*p)%13
print(dp[5])

Buggy submission (verdict: Runtime Error):
S = input()
list_s = list(reversed(list(S)))
small_s = int(S.replace('?', '0'))
L = 0
t = []
for i, s in enumerate(list_s):
    if s == '?':
        L += 1
        t.append(i)

count = 0
d = small_s % 13
for l in range(10**L):
    list_l = list(reversed(list(str(l))))
    temp = d
    for i, a in enumerate(list_l):
        temp += int(a)*(10**t[i])
    if temp % 13 == 5:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
S = input()
list_s = list(reversed(list(S)))
small_s = int(S.replace('?', '0'))
L = 0
t = []
for i, s in enumerate(list_s):
    if s == '?':
        L += 1
        t.append(i)

count = 0
d = small_s % 13
for l in range(10**L):
    list_l = list(reversed(list(str(l))))
    temp = d
    for i, a in enumerate(list_l):
        temp += int(a)*(10**t[i])
    if temp % 13 == 5:
        count += 1
print(count)
Problem p03337 (python)

Fixed submission:
a, b = map(int, input().split())
print(max(a+b, a-b, a*b))

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))
r = 0
for i in range(n):
    p, x = 0, 0
    for j in range(i, n):
        p += A[j]
        x ^= A[j]
        if p == x:
            r += 1
        else:
            break
print(r)
Problem p03372 (python)

Fixed submission:
n, c = map(int, input().split())
X = []
V = []
right = []
rightleft = []
calsum = 0
for i in range(n):
    x, v = map(int, input().split())
    X.append(x)
    V.append(v)
    calsum += v
    right.append(calsum-x)
    rightleft.append(calsum-2*x)

left = []
leftright = []
calsum = 0
for i in range(n):
    calsum += V[n-i-1]
    left.append(calsum - (c-X[n-i-1]))
    leftright.append(calsum - 2*(c-X[n-i-1]))

m = 0
M = 0
for i in range(0, n-1):
    m = max(m, left[i])
    M = max(M, m + rightleft[n-i-2])

mm = 0
MM = 0
for i in range(0, n-1):
    mm = max(mm, right[i])
    MM = max(MM, mm + leftright[n-i-2])

print(max(max(right), max(left), M, MM, 0))

Buggy submission (verdict: Runtime Error):
n, c = map(int, input().split())
X = [0 for _ in range(n)]
V = [0 for _ in range(n)]
right = [0 for _ in range(n)]
left = [0 for _ in range(n)]
rl = [0 for _ in range(n)]
lr = [0 for _ in range(n)]
rlm = [0 for _ in range(n)]
lrm = [0 for _ in range(n)]

calsum = 0
for i in range(n):
    x, v = map(int, input().split())
    X[i] = x
    V[i] = v
    calsum += v
    right[i] = calsum-x
    rl[i] = calsum-2*x

calsum = 0
for i in range(n):
    calsum += V[n-i-1]
    left[i] = calsum - (c-X[n-i-1])
    lr[i] = calsum - 2*(c-X[n-i-1])


m = 0
for i in range(0, n-1):
    m = max(m, left[i])
    rlm[i] = m + rl[n-i-2]

m = 0
for i in range(0, n-1):
    m = max(m, right[i])
    lrm[i] = m + lr[n-i-2]

print(max(0, max(right), max(left), max(rlm), max(lrm))

Buggy submission (verdict: Runtime Error):
n, c = map(int, input().split())
X = []
V = []
right = []
rightleft = []
calsum = 0
for i in range(n):
    x, v = map(int, input().split())
    X.append(x)
    V.append(v)
    calsum += v
    right.append(calsum-x)
    rightleft.append(calsum-2*x)

left = []
leftright = []
calsum = 0
results = []
for i in range(n):
    calsum += V[n-i-1]
    left.append(calsum - (c-X[n-i-1]))
    leftright.append(calsum - 2*(c-X[n-i-1]))

rl = []
for i, v in enumerate(rightleft):
    l = list(map(lambda x: x+v, left[:n-i-1]))
    if len(l) > 0:
        rl.append(max(l))

lr = []
for i, v in enumerate(leftright):
    l = list(map(lambda x: x+v, right[:n-i-1]))
    if len(l) > 0:
        lr.append(max(l))

print(max(*right, *left, *rl, *lr, 0))
Problem p02814 (python)

Fixed submission:
N, M = list(map(int, input().split()))
ahs = list(map(lambda x:int(x)//2, input().split()))

odd = sum([ah % 2 for ah in ahs])
if odd!=0 and N-odd!=0:
    print(0)
else:
    from fractions import gcd
    from functools import reduce

    def lcm_base(x, y):
        return (x * y) // gcd(x, y)

    def lcm_list(numbers):
        return reduce(lcm_base, numbers, 1)

    lcm = lcm_list(ahs)

    result = True
    for ah in ahs:
        if (lcm // ah) % 2 == 0:
            result = False
            break

    if result == False:
        print(0)
    else:
        print((M//lcm-1)//2 + 1)

Buggy submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))
ahs = list(map(lambda x:int(x)//2, input().split()))

from fraction import gcd
from functools import reduce

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

lcm = lcm_list(ahs)

result = True
for ah in ahs:
    if (lcm // ah) % 2 == 0:
        result = False
        break

if result == False:
    print(0)
else:
    print((M//lcm-1)//2 + 1)
Problem p02830 (python)

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

result = []
for s, t in zip(S, T):
    result.append(s)
    result.append(t)
    
print(''.join(result))

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

result = []
for s, t in S, T:
    result.append(s)
    result.append(t)
    
print(''.join(result))
Problem p02983 (python)

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

import numpy as np
if L+2019<=R:
    ms = np.arange(2019)
else:
    ms = np.unique(np.arange(L, R+1) % 2019)

Ms = ms.reshape(-1,1)*ms.reshape(1,-1)
Ms = Ms % 2019
Ms += np.eye(Ms.shape[0], dtype=int)*2019
print(np.min(Ms))

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())

import numpy as np
ms = np.array(np.unique(np.arange(L, R+1) % 2019))

Ms = ms.reshape(-1,1)*ms.reshape(1,-1)
Ms = Ms % 2019
Ms += np.eye(Ms.shape[0], dtype=int)*2019
print(np.min(Ms))
Problem p02995 (python)

Fixed submission:
A, B, C, D = map(int, input().split())

import fractions
CD = C * D // fractions.gcd(C, D)

# C, D, C*Dで割り切れるものの個数
div_C = B//C - (A//C + (-1 if A%C==0 else 0))  # 40//6 - 10//6 -> 6 - 1 = 5
div_D = B//D - (A//D + (-1 if A%D==0 else 0))  # 40//8 - 10//8 -> 5 - 1 = 4
div_CD = B//(CD) - max(0, (A//(CD) + (-1 if A%(CD)==0 else 0)))
print(B-A+1 - div_C - div_D + div_CD)

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

import math
CD = C * D // math.gcd(C, D)

# C, D, C*Dで割り切れるものの個数
div_C = B//C - (A//C + (-1 if A%C==0 else 0))  # 40//6 - 10//6 -> 6 - 1 = 5
div_D = B//D - (A//D + (-1 if A%D==0 else 0))  # 40//8 - 10//8 -> 5 - 1 = 4
div_CD = B//(CD) - max(0, (A//(CD) + (-1 if A%(CD)==0 else 0)))
print(B-A+1 - div_C - div_D + div_CD)
Problem p03000 (python)

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

count = 0
position = 0
for i in range(N):
    if X<position:
        break
    else:
        count += 1
        position += Ls[i]

if X<position:
    pass
else:
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
Ls = map(int, input().split())

count = 0
position = 0
for i in range(N):
    if X<position:
        break
    else:
        count += 1
        position += Ls[i]

print(count)
Problem p03043 (python)

Fixed submission:
N, K = map(int, input().split())
# N ,K = 100000, 5

def min_v(x, k):
    v=1.0
    while v>x/k:
        v /= 2
    return v

V = 0
for n in range(1, N+1):
    V += min_v(n, K)

print('{:.16f}'.format(V/N))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input())
# N ,K = 100000, 5

def min_v(x, k):
    v=1.0
    while v>x/k:
        v /= 2
    return v

V = 0
for n in range(1, N+1):
    V += min_v(n, K)

print('{:.16f}'.format(V/N))
Problem p03060 (python)

Fixed submission:
N = int(input())
V = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]
 
N = []
for i, v in enumerate(V):
    N.append(V[i]-C[i])

N.sort(reverse=True)
 
result = 0
for n in N:
    if 0<n:
        result += n
    else:
        break

print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
V = map(int, input().split())
C = map(int, input().split())

N = []
for i, v in enumerate(V):
    N.append(V[i]-C[i])

N.sort(reverse=True)

result = 0
for n in N:
    if 0<n:
        result += n
    else:
        break

print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
V = map(int, input().split())
C = map(int, input().split())

N = []
for i, v in enumerate(V):
    N.append(V[i]-C[i])

N.sort(reverse=True)

result = 0
for n in N:
    if 0<n:
        result += n
    else:
        break

print(result)
Problem p03067 (python)

Fixed submission:
A, B, C = map(int, input().split())
print('Yes' if A<C<B or B<C<A else 'No')

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input())
print('Yes' if A<C<B or B<C<A else 'No')
Problem p03069 (python)

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

count = [0]*(len(S)+1)
count[0] = S.count('.')
for i in range(1, len(S)+1):
    count[i] = count[i-1] + (1 if S[i-1]=='#' else 0) - (1 if S[i-1]=='.' else 0)

print(min(count))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
 
count[0] = S.count('.')
for i in range(1, len(S)+1):
    count[i] = count[i-1] + (1 if S[i-1]=='#' else 0) - (1 if S[i-1]=='.' else 0)

print(min(count))

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

count[0] = S.count('.')
for i in range(1, len(S)+1):
    count[i] = count[i-1] + (1 if S[i-1]=='#' else 0) - (1 if S[i-1]=='.' else 0)

print(min(count))

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

count[0] = S.count('.')
for i in range(1, len(S)+1):
    count[i] = count[i-1] + (1 if S[i-1]=='#' else 0) - (1 if S[i-1]=='.' else 0)

print(min(count))
Problem p03071 (python)

Fixed submission:
a,b=map(int,input().split())
print(max(a+b,2*a-1,2*b-1))

Buggy submission (verdict: Runtime Error):
n = int(input())
nums = list(map(int, input().split()))
count = 0

for i in range(len(nums)):
    flag = True
    for j in range(i):
        if nums[j] > nums[i]:
            flag=  False
    if flag:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
    a,b=map(int,input().split())
    print(max(a+b,2*a-1,2*b-1))

Buggy submission (verdict: Runtime Error):
a,b = int(input()), int(input())
print(max(a + b, a + a - 1, b + b - 1))

Buggy submission (verdict: Runtime Error):
  A = 5
  B = 3
  total = 0
  if A < B:
    total += B
    if A < B - 1:
      total += B - 1
    else:
      total += A
  elif B < A:
    total += A
    if B < A - 1:
      total += A - 1 
    else:
      total += B
  else:
    total = A + B 
  print(total)

Buggy submission (verdict: Runtime Error):
  A = 5
  B = 3
  total = 0
  if A < B:
    total += B
    if A < B - 1:
      total += B - 1
    else:
      total += A
  elif B < A:
    total += A
    if B < A - 1:
      total += A - 1 
    else:
      total += B
  else:
    total = A + B 
  return total

Buggy submission (verdict: Runtime Error):
  A = 5
  B = 3
  total = 0
  if A < B:
    total += B
    if A < B - 1:
      total += B - 1
    else:
      total += A
  elif:
    total += A
    if B < A - 1:
      total += A - 1 
    else:
      total += B
  else:
    total = A + B 
  return total

Buggy submission (verdict: Runtime Error):
  total = 0
  if A < B:
    total += B
    if A < B - 1:
      total += B - 1
    else:
      total += A
  elif:
    total += A
    if B < A - 1:
      total += A - 1 
    else:
      total += B
  else:
    total = A + B
Problem p04012 (python)

Fixed submission:
W = input()
W_list = set(list(s for s in W))
ans = True 
for s in W_list:
    if W.count(s) % 2 != 0:
        ans = False
        break


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

Buggy submission (verdict: Runtime Error):
W = input()
W_list = set(list(s for s in W))
ans = True 
for s in W_list:
    if W.count(s) % 2 != 0
        False
        break

if ans:
    print("Yes")
else 
    print("No")
Problem p02909 (python)

Fixed submission:
S=str(input())

if S=='Sunny':
  print('Cloudy')

elif S=='Cloudy':
  print('Rainy')
  
else:
  print('Sunny')

Buggy submission (verdict: Runtime Error):
S=str(input())
if S='Sunny':
  print(Cloudy)

elif S='Cloudy':
  print(Rainy)

else:
  print(Sunny)
Problem p02783 (python)

Fixed submission:
h,a = input().split()
result = int(h)
times=0
while result > 0:
    result-=int(a)
    times+=1
print(times)

Buggy submission (verdict: Runtime Error):
enemmyCountN,killerTimeK = map(int,input().split())
enemyHp = input().split()

intEnemyHp = [int(i) for i in enemyHp]
intEnemyHp.sort()

resultEnemyCount = enemmyCountN - killerTimeK
countNormal = 0

if killerTimeK >= enemmyCountN:
    print(0)

else:
    for i in range(resultEnemyCount):
        countNormal += intEnemyHp[i]
    print(countNormal)

Buggy submission (verdict: Runtime Error):
enemmyCountN,killerTimeK = map(int,input().split())
enemyHp = input().split()

enemyHp.sort()

resultEnemyCount = enemmyCountN - killerTimeK
countNormal = 0


for i in range(resultEnemyCount):
    countNormal += int(enemyHp[i])

print(countNormal)

Buggy submission (verdict: Runtime Error):
H,N = map(int,input().split())
A = input().split()
if H - (int(sorted(A)[-1]) + int(sorted(A)[-2])) <= 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
H,N = map(int,input().split())
A = input().split()
if H - (int(sorted(A)[-1]) + int(sorted(A)[-2])) > 0:
    print("Yes")
else:
    print("No")
Problem p02784 (python)

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

A = input().split()

result = 0

for i in range(N):
    result += int(A[i])

if H - result <= 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
h,n = input().split()
a = input().split()
value = int(sorted(a)[-1]) + int(sorted(a)[-2])
result = 'yes' if value >= int(h) else 'no'
print(result)
Problem p02755 (python)

Fixed submission:
import numpy as np

a, b = list(map(int, input().split()))
minXa = int(np.ceil(a / 0.08))
minXb = b * 10
maxXa = int(np.ceil((a+1) / 0.08))
maxXb = (b+1) * 10

ansX = 9999
ansY = 9999
for x in range(minXa, maxXa):
    if(int(x*0.1) == b):
        ansX = x
        break

for y in range(minXb, maxXb):
    if(int(y*0.08) == a):
        ansY = y
        break

        
if(ansX == 9999 and ansY == 9999):
    print(-1)
else:
    print(min(ansX, ansY))

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

a, b = list(map(int, input().split()))
minXa = int(np.ceil(a / 0.08))
minXb = b * 10
maxXa = int(np.ceil((a+1) / 0.08))
maxXb = (b+1) * 10

ansX = 9999
ansY = 9999
for x in range(minXa, maxXa):
    if(int(x*0.1) == xb):
        ansX = x
        break

for y in range(minXb, maxXb):
    if(int(y*0.08) == a):
        ansY = y
        break

        
if(ansX == 9999 and ansY == 9999):
    print(-1)
else:
    print(min(ansX, ansY))
Problem p02911 (python)

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

players = [0 for n in range(N)]
for q in range(Q):
  players[int(input())-1] += 1

for n in range(N):
  if(K - (Q - players[n]) > 0):
    print("Yes")
  else:
    print("No")

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

players = [0 for n in range(N)]
for q in range(Q):
  players[int(input())-1] += 1

for q in range(Q):
  if(K - (Q - players[q]) > 0):
    print("YES")
  else:
    print("NO")
Problem p02923 (python)

Fixed submission:
import collections

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

if(N == 1):
    print(0)
else:
    point = 0
    step_candidates = collections.Counter()
    for n in range(N-1):
        if(H_list[n] < H_list[n+1]):
            step_candidates[point] = n - point
            point = n+1
    if(point != N - 1):
        step_candidates[point] = N - 1 - point

    print(step_candidates.most_common()[0][1])

Buggy submission (verdict: Runtime Error):
import collections

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

import collections
point = 0
step_candidates = collections.Counter()
for n in range(N-1):
    if(H_list[n] < H_list[n+1]):
        step_candidates[point] = n - point
        point = n+1
if(point != N - 1):
    step_candidates[point] = N - 1 - point

print(step_candidates.most_common()[0][1])