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

Fixed submission:
t = list(input())
 

for i in range(len(t)):
  if t[i] == '?':
    t[i] = 'D'
    i +=1

t = ''.join(t)
# out = []
# for i in range(len(t)):
#   out += t[i]

print(t)

Buggy submission (verdict: Runtime Error):
t = list(input())
 
i = 0
for i in len(t):
  if t[i] == '?':
    t[i] == 'D'
    
print(t)

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

i = 0
for i in size(t):
  if t[i] == '?':
    t[i] == 'D'
    
print(t)
Problem p02780 (python)

Fixed submission:
input_line=input().split(" ")
N,K=int(input_line[0]),int(input_line[1])
P=input().split(" ")
cumsum=[0]
tol=0
for i in range(N):
    P[i]=(int(P[i])+1)/2
    tol=tol+P[i]
    cumsum.append(tol)
    
k_sum=[]

for i in range(N-K+1):
  k_sum.append(cumsum[i+K]-cumsum[i])  

ans=max(k_sum)
print(ans)

Buggy submission (verdict: Runtime Error):
input_line=input().split(" ")
N,K=int(input_line[0]),int(input_line[1])
P=input().split(" ")
cumsum=[0]
tol=0
for i in range(N):
    P[i]=(int(P[i])+1)/2
    tol=tol+P[i]
    cumsum.append(tol)
    
k_sum=[]

for i in range(K):
  k_sum.append(cumsum[i+K]-cumsum[i])  

ans=max(k_sum)
print(ans)
Problem p02628 (python)

Fixed submission:
N,K = map(int,input().split(' '))
P = list(map(int,input().split(' ')))
if(K==1):
  print(min(P))
else:
  res=[]
  for i in range(K):
    res.append(min(P))
    P.remove(min(P))
  print(sum(res))

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split(' '))
P = list(map(int,input().spllit(' ')))
if(k==1):
  print(min(P))
else:
  res=[]
  for i in range(K):
    res[i].append(min(P))
    P.remove(min(P))
  print(sum(res))
Problem p02657 (python)

Fixed submission:
#!/usr/bin/env python3
import bisect
import collections
import sys

sys.setrecursionlimit(1000000)
ACMOD = 1000000007
INF = 1 << 62



def solve(A: int, B: int):
    print(A*B)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
print(int(input()*int(input()))
Problem p02787 (python)

Fixed submission:
import math
H, N = list(map(int, input().split()))
 
AB = [list(map(int, input().split())) for _ in range(N)]
 
dp = [float('inf')] *(H+1)
dp[H] = 0
for a,b in AB:
    for i in range(H,-1,-1):
        if i <= H - a:
            dp[i] = min(dp[i], dp[i+a] + b)
    dp[0] = min(dp[0], min(dp[:a+1]) + b) # if hp is not just 0
print(dp[0])

Buggy submission (verdict: Runtime Error):

import math
H, N = list(map(int, input().split()))

AB = [list(map(int, input().split())) for _ in range(N)]

dp = [math.inf] *(H+1)
dp[H] = 0
for a,b in AB:
    for i in range(H,-1,-1):
        if i <= H - a:
            dp[i] = min(dp[i], dp[i+a] + b)
        dp[0] = min(dp[0], min(dp[:a+1]) + b) # if hp is not just 0

print(dp[0])

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

AB = [list(map(int, input().split())) for _ in range(N)]

dp = [math.inf] *(H+1)
dp[H] = 0
for a,b in AB:
    for i in range(H,-1,-1):
        if i <= H - a:
            dp[i] = min(dp[i], dp[i+a] + b)
        dp[0] = min(dp[0], min(dp[:a+1]) + b) # if hp is not just 0

print(dp[0])

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

AB = [list(map(int, input().split())) for _ in range(N)]

dp = [math.inf] *(H+1)
dp[H] = 0
for a,b in AB:
    for i in range(H,-1,-1):
        if i <= H - a:
            dp[i] = min(dp[i], dp[i+a] + b)
        dp[0] = min(dp[0], min(dp[:a+1]) + b) # if hp is not just 0

print(dp[0])
Problem p03095 (python)

Fixed submission:
from collections import defaultdict,Counter

N = int(input())
S=  input()

d=  defaultdict(int)
back = 0
front =1
ans = 1
c= Counter(S)

for i in c:
    ans *= c[i]+1
    ans = ans%(10**9+7)


print(ans-1)

Buggy submission (verdict: Runtime Error):
# test for NO is correct 
N,A,B= list(map(int,input().split()))
B1 = A^B


from collections import defaultdict
d = defaultdict(list)
for i in range(2**N):
    bits_total = bin(i)[2:].count('1')
    d[bits_total].append(i)
def count_bits(n):
    return bin(n)[2:].count('1')

def int_to_bin(n):
    return list(reversed(list((map(lambda x:x=='1',bin(n)[2:])))))+[0]*N
def bin_to_int(V):
    ans = 0
    for i,val in enumerate(V):
        ans += val *(2 **i)
    return ans

assert bin_to_int([1])==1
assert bin_to_int([0,1])==2

def movable(i):
    res = set()
    for bit_num in range(N):
        if i>= 2**bit_num and bin(i)[2:][-bit_num-1]=='1':
            res.add(i - 2**bit_num)
        else:
            res.add(i+2**bit_num)
    return res

used = set()
i=0
next = -1
used.add(0)
order = [0]
try:
    while len(used) < 2**N:
        next = max(movable(i) - used)
        used.add(next)
        i=next
        order.append(i)
except:
    print("NO")
    exit()

if count_bits(next)!= count_bits(B1):
    print("NO")
    exit()
raise


def find_all(x):
    res = []
    for bit_num in range(N):
        if x>= 2**bit_num and bin(x)[2:][-bit_num-1]=='1':
            res.append(bit_num)
    return res
a= find_all(B1)
b= find_all(next)

def convert(x,p,q):
    V = int_to_bin(x)
    for i in range(len(p)):
        tmp = V[p[i]]
        V[p[i]]=V[q[i]]
        V[q[i]]= tmp
    return bin_to_int(V)

print("YES")
print(" ".join([str(convert(n,a,b) ^A) for n in order]))
Problem p03231 (python)

Fixed submission:
import math

N, M = list(map(int, input().split()))
S = input()
T = input()
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)

L = N * M // gcd(N, M)

d = dict()

for i in range(N):
    index = 1 + (L // N) * i
    d[index] = S[i]

for j in range(M):
    index = (1 + (L // M) * j)
    if index in d:
        if d[index] != T[j]:
            print(-1)
            exit()
print(L)

Buggy submission (verdict: Runtime Error):
import math

N, M = list(map(int, input().split()))
S = input()
T = input()

L = N * M // math.gcd(N, M)

d = dict()

for i in range(N):
    index = 1 + (L // N) * i
    d[index] = S[i]

for j in range(M):
    index = (1 + (L // M) * j)
    if index in d:
        if d[index] != T[j]:
            print(-1)
            exit()
print(L)

Buggy submission (verdict: Runtime Error):
import math

N, M = list(map(int, input().split()))
S = input()
T = input()

L = N * M // math.gcd(N, M)

d = dict()

for i in range(N):
    index = 1 + (L // N) * i
    d[index] = S[i]

for j in range(M):
    index = (1 + (L // M) * j)
    if index in d:
        if d[index] != T[j]:
            print(-1)
            exit()
print(L)

Buggy submission (verdict: Runtime Error):
import math
N,M= list(map(int,input().split()))
S =input()
T=input()


L = N*M//math.gcd(N,M)

d = dict()

for i in range(N):
    index = 1+(L//N)*i
    d[index] = S[i]

for j in range(M):
    index = (1+(L//M)*j)
    if index in d:
        if d[index]!=T[j]:
            print(-1)
            exit()
print(L)

Buggy submission (verdict: Runtime Error):
import math
N,M= list(map(int,input().split()))
S =input()
T=input()


L = N*M//math.gcd(N,M)

d = dict()

for i in range(N):
    index = 1+(L//N)*i
    d[index] = S[i]

for j in range(M):
    index = (1+(L//M)*j)
    if index in d:
        if d[index]!=T[j]:
            print(-1)
            exit()
print(L)

Buggy submission (verdict: Runtime Error):
import math
N,M= list(map(int,input().split()))
S =input()
T=input()


L = N*M//math.gcd(N,M)

d = dict()

for i in range(N):
    print(1+(L//N)*i)
    index = 1+(L//N)*i
    d[index] = S[i]

for j in range(M):
    index = (1+(L//M)*j)
    if index in d:
        if d[index]!=T[j]:
            print(-1)
            exit()
print(L)
Problem p03240 (python)

Fixed submission:
from collections import defaultdict
N = int(input())
XYH = [list(map(int,input().split())) for _ in range(N)]

Cxy = defaultdict(int)

#-1 NG
# 0 default
#1+ ok
verify =[]
XYH.sort(key=lambda x:-x[2])

for x,y,h in XYH:
    for cx in range(101):
        for cy in range(101):
            val = Cxy[(cx,cy)]
            if val<0:
                continue
            tmp_H = abs(x-cx)+abs(y-cy)+h
            if h==0:
                if tmp_H < Cxy[(cx,cy)]:
                    Cxy[((cx, cy))]=-1
                continue

            if val==0:
                Cxy[(cx,cy)] = tmp_H
            elif val != tmp_H:
                Cxy[(cx, cy)] =-1

def find(d):
    for key in d.keys():
        if d[key] >0:

            return key,d[key]

(X,Y),H = find(Cxy)
print(X,Y,H)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
N = int(input())
XYH = [list(map(int,input().split())) for _ in range(N)]

Cxy = defaultdict(int)

#-1 NG
# 0 default
#1+ ok
verify =[]
XYH.sort(key=lambda x:-x[2])
for x,y,h in XYH:
    for cx in range(101):
        for cy in range(101):
            val = Cxy[(cx,cy)]
            if val<0:
                continue
            tmp_H = abs(x-cx)+abs(y-cy)+h
            if h==0:
                if tmp_H <= Cxy[(cx,cy)]:
                    Cxy[((cx, cy))]=-1
                continue

            if val==0:
                Cxy[(cx,cy)] = tmp_H
            elif val != tmp_H:
                Cxy[(cx, cy)] =-1

def find(d):
    for key in d.keys():
        if d[key] >0:

            return key,d[key]

(X,Y),H = find(Cxy)
print(X,Y,H)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
N = int(input())
XYH = [list(map(int,input().split())) for _ in range(N)]

Cxy = defaultdict(int)

#-1 NG
# 0 default
#1+ ok
for x,y,h in XYH:
    for cx in range(101):
        for cy in range(101):
            val = Cxy[(cx,cy)]
            if val<0:
                continue
            tmp_H = abs(x-cx)+abs(y-cy)+h
            if h==0 and tmp_H<=0:
                continue #????

            if val==0:
                Cxy[(cx,cy)] = tmp_H
            elif val != tmp_H:
                Cxy[(cx, cy)] =-1

def find(d):
    for key in d.keys():
        if d[key] >0:
            return key,d[key]
(X,Y),H = find(Cxy)
print(X,Y,H)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
N = int(input())
XYH = [list(map(int,input().split())) for _ in range(N)]

Cxy = defaultdict(int)

#-1 NG
# 0 default
#1+ ok
for x,y,h in XYH:
    for cx in range(101):
        for cy in range(101):
            val = Cxy[(cx,cy)]
            if val<0:
                continue
            tmp_H = abs(x-cx)+abs(y-cy)+h
            if h==0 and tmp_H<0:
                continue #????

            if val==0:
                Cxy[(cx,cy)] = tmp_H
            elif val != tmp_H:
                Cxy[(cx, cy)] =-1

def find(d):
    for key in d.keys():
        if d[key] >0:
            return key,d[key]
(X,Y),H = find(Cxy)
print(X,Y,H)
Problem p03248 (python)

Fixed submission:
import bisect
s = input()
if s[-1] == "1" or s[0] == "0":
    print(-1)
    exit()

for i in range((len(s) - 1) // 2):
    # print(i,len(s)- i - 2)
    if s[i] != s[len(s) - i -2]:
        print(-1)
        exit()

sd = s[:-1] + '1'
plist = [i for i, v in enumerate(sd) if v == '1']
# print(plist)
for i,v in enumerate(s[:-1]):
    r = bisect.bisect(plist,i)
    print(i+1,plist[r] + 1)

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

def print_index(x,y):
    if y > len(s):
        return
    print(x,y)

def solve(s,index):
    if not s:
        return
    if s[0]=="1":
        print_index(index,index+1)
        return solve(s[1:],index+1)
    else:
        print_index(index,index+1)
        print_index(index,index+2)
        return solve(s[1:],index+1)


(solve(s,1))
Problem p03268 (python)

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

if K==1:
    print(N**3)
    exit()
# if K==2:
#     print( ((N+1)//2)**3 +((N//2)**3))
#     exit()
if not K%2 == 0:
    print((N//K)**3)
    exit()

# print(N/K)
print((N//K)**3 +(int(N/K + 1/2)**3))

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

dprint = lambda *x:x

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 998244353 #出力の制限
__N = 8000
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, __N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )



def kumiawase(p, q):
    # dprint(p,q,cmb(p+q-1,q-1 ,mod))
    return cmb(p+q -1,q-1 ,mod)


def solve(n):
    assert n <= K+1
    # 組み合わせの組
    # abs(n-1)//2 + 偶数分 n//2?
    # 2 ->  1,1
    # 3 -> 1,2
    # 4 -> 1,3 2,2
    # 5 -> 1,4 2,3
    # 6 -> 1,5 2,4 3,3
    # 7  3通り

    # 組のうち片方だけ使用する数 p
    ans = 0
    kumi = (n - 1) // 2
    for p in range(kumi+1):
        # dprint("p",p,"n",n)
        if p>N:
            break
        # 使えるのは p個 + 組に関係ないやつ
        ans += 2**p *cmb(kumi,p,mod)* kumiawase(N - p, p+ (K-kumi*2- int(n%2==0) ) )
        # dprint("anstmp1",ans)
        if n % 2 == 0 and N - p -1 >= 0:
            ans += 2**p *cmb(kumi,p,mod) * kumiawase(N - p -1 , p+ (K-kumi*2- int(n%2==0) ) ) # K==n//2を使用
    # dprint("-------",ans)
    return ans


ans = []
for i in range(2, 2 * K +1):
    if i <= K+1:
        tmp = solve(i)%998244353
        ans.append(tmp)
        print(tmp)
    else:
        print(ans[-i + K])
Problem p03319 (python)

Fixed submission:
import math
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))

assert isinstance(A,list)
a = A.index(1)

print(math.ceil((N-1)/(K-1)))

Buggy submission (verdict: Runtime Error):



def n_snuke(n):
    return n /sum(map(int,str(n)))


# (100o+10x+y)/(o+x+y) > (100o+99)/(o+9+9)
#  100o*18+(10x+y)(o+18) > 100o(x+y) +99(o+x+y)


#
#1 - 10 , 19,29,39,49,59,69,79,89,99

#for i in range(1,1115):
#    print(i,n_snuke(i))


K = int(input())
tmp =0

tmp_list = []
for i in range(K*3):
    tmp = tmp+ 10**(len(str(tmp+1))-1)
    tmp_list.append(tmp)
    #print(tmp,n_snuke(tmp))
r_list = [tmp_list[-1]]
for i in reversed(range(len(tmp_list)-1)):
    if n_snuke(r_list[-1]) >= n_snuke(tmp_list[i]):
        r_list.append(tmp_list[i])

for i in reversed(r_list[-K:]):
    print(i)
Problem p03523 (python)

Fixed submission:


import re


S = input()

if re.fullmatch(r"A?KIHA?BA?RA?",S):
    print("YES")
else:
    print("NO")
exit()

Buggy submission (verdict: Runtime Error):

S = input()

if S[-1]!="A" or S[-1]=="R":
    print("NO")
    exit(0)
i = 0
for s in "AKIHABARA":
    if S[i]==s:
        i+=1
        continue
    elif s=="A":
        continue
    else:
        print("NO")
        exit()

if i>=len(S)-1:
    print("YES")
else:
    print("NO")
Problem p03525 (python)

Fixed submission:
import itertools

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

if any((D+[0,0,12]).count(i) >2 for i in range(0,13)):
    print(0)
    exit(0)


l= [0]
if D.count(12):
    l.append(12)

can_select=[]
for i in range(1,12):
    if (D).count(i) ==2:
        l.append((i))
        l.append((24 - i))

    if D.count(i)==1:
        can_select.append(i)

def change12(v):
    return min(24-v,v)

def get_closest(l):
    min_val =24
    for i in range(len(l)-1):
        min_val= min(change12(l[i+1]-l[i]),min_val)

    return min(change12(l[-1] - l[0]),min_val )

tmp_ans=0
for seed in list(itertools.product(range(2), repeat=len(can_select))):
    tmp_list = list(l)
    for i,val in enumerate(can_select):
        if seed[i]==1:
            tmp_list.append(val)
        else:
            tmp_list.append(24-val)
    tmp_list.sort()
    tmp_ans =max(tmp_ans, get_closest(tmp_list))



print(tmp_ans)

Buggy submission (verdict: Runtime Error):

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

if any((D+[0]).count(i) >2 for i in range(12)):
    print(0)
    exit(0)
raise

def check(i):
    return False

def get_close(l,d=0):
    return
Problem p03584 (python)

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


K_2 = bin(K)[2:]
max_kouho = [K_2,("1"* (len(K_2) -1) if len(K_2)>1 else "0") ]



for i in range(1,len(K_2)-1):
    if K_2[i] == "1"  and K_2.find("0") >-1:
        max_kouho.append(
            (K_2[:i]+"0"+ ("1" * 100) )[:len(K_2)] )
#print(max_kouho)

AB  = [ list(map(int,input().split())) for _ in range(N)]

if K==0:
    ans =0
    for a,b in (AB):
        if a==0:
            ans +=b
    print(ans)
    exit()
dp = {key:0 for key in max_kouho}
for a,b in AB:
    #use
    for key in max_kouho:
        if int(key,2) |a ==int(key,2):
            dp[key]+=b
    #print(bin(a),b,dp)

print(max(dp[key] for key in max_kouho ))

Buggy submission (verdict: Runtime Error):


N , K =  list(map(int,input().split()))
keta = 0
for i in range(1000):
    if 2**i > K:
       keta=i
       break

K_2 = bin(K)[2:]

max_kouho = [K_2,"1"* (len(K_2) -1) ]

for i in range(1,len(K_2)-1):
    if K_2[i] == "1" :
        #print(K_2[:i-1]+"00"+ ("1" * 100)[- (len(K_2)-i-1 if len(K_2)-i-1 > 0 else 100 ):] )
        max_kouho.append(
            (K_2[:i]+"0"+ ("1" * 100) )[:len(K_2)] )
#print(max_kouho)


AB  = [ list(map(int,input().split())) for _ in range(N)]
#ans =0

dp = {key:0 for key in max_kouho}
ans_use_top = 0     # 100111
ans_not_use_top = 0 # 011111
for a,b in AB:
    #use
    for key in max_kouho:
        if int(key,2) |a ==int(key,2):
            dp[key]+=b
    #print(bin(a),b,dp)

print(max(dp[key] for key in max_kouho ))
Problem p03689 (python)

Fixed submission:
H, W, h, w =list(map(int,input().split()))
INF = 10**10
mat = [[1000 for _ in range(H)] for _ in range(W)]

val =-h*w*1000+ 999
for h_new in range(h-1,H,h):
    for w_new in range(w-1,W,w):
        mat[w_new][h_new] = val

if (sum(sum(mat[j][i] for i in range(H)) for j in range(W)))< 0:
    print("No")
else:
    print("Yes")
    for i in range(H):
        for j in range(W):
            print(mat[j][i], end =" ")
        print("")

Buggy submission (verdict: Runtime Error):
H, W, h, w =list(map(int,input().split()))
INF = 10**10
mat = [[1 for _ in range(H)] for _ in range(W)]
for i in range(h):
    for j in range(w):
        mat[i][j] =1
mat[h-1][w-1]  = -h*w

for i in range(H-h+1):
    for j in range(W-w+1):
        _sum = 0
        for p in range(h):
            for q in range(w):
                tmp = mat[j+q][i+p]
                if p==h-1 and q ==w-1: #corner
                    mat[j+q][i+p]=-_sum -1
                    #print(i+p,j+q)
                _sum +=tmp

#print(mat)
if (sum(sum(mat[j][i] for i in range(H)) for j in range(W)))< 0:
    print("No")
else:
    print("Yes")
    for i in range(H):
        for j in range(W):
            print(mat[j][i], end =" ")
        print("")
Problem p03937 (python)

Fixed submission:
H,W=[int(x) for x in input().split()]

A = [list(map(lambda x: x=="#" ,input())) for _ in range(H)]

#print(A)


try:
    for i in range(H):
        for j in range(W):
            if A[i][j]:
                start=i,j
                raise
except:
    pass


def a(i,j):
    if i<H and j<W:
        return A[i][j]
    return False

tmp =start
used = [start]
while True:
    #print(tmp)
    i,j =tmp
    if a(i+1,j):
        tmp = i+1,j
        used.append(tmp)
        continue
    if a(i,j+1):
        tmp = i ,j+1
        used.append(tmp)
    else:
        break

for i in range(H):
    for j in range(W):
        if A[i][j]:
            if (i,j) in used:
                continue
            else:
                #print(i,j)
                print("Impossible")
                exit()
print("Possible")

Buggy submission (verdict: Runtime Error):
N = int(input())
P = [int(x) for x in input().split()]

a = [i* 10**3+1 for i in range(N)]
b= list(reversed(a))



for i in range(N):
    #P[i] =2* i
    p = P[i]-1
    a[p]+=i

print(" ".join(map(str,a)) )
print(" ".join(map(str,b)) )


def check():
    tmp =0
    for i in P:
        i-=1
        print(tmp<a[i]+b[i])
        tmp=a[i]+b[i]

#check()
Problem p02791 (python)

Fixed submission:
import numpy as np
N=int(input())
P=list(map(int,input().split()))

ct=0
min_p=P[0]
for i in range(N):
	if P[i]<=min_p:
		min_p=P[i]
		ct+=1


print(ct)

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

ct=1
for i in range(round(N/2)+1):
	for j in range(i+1):
		if P[i-j]<=P[i+1]:
			break
		elif j==i:
			ct+=1
for i in range(round(N/2)-1,N):
	temp=0
	for j in range(N-i):
		if P[i]>=P[i+j]:
			temp+=1
	if temp==P[i]-1:
		ct+=1
			

print(ct)
Problem p02934 (python)

Fixed submission:
N = int(input())
k = list(map(int,input().split()))
sum = 0
for i in range(N):
  sum += 1/k[i]
print(1/sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
k = list(map(int,input().split()))
sum = 0
for i in k:
  sum += 1/k[i]
print(1/sum)
Problem p02993 (python)

Fixed submission:
n = input()
for i in range(len(n) -1):
  if (n[i] == n[i+1]):
      print("Bad")
      break
else: 
    print("Good")

Buggy submission (verdict: Runtime Error):
n = input()
for i in range(0,len(n)-1,1):
  if (n[i] == n[i+1]):
    print("Bad")
    else:
print("Good")

Buggy submission (verdict: Runtime Error):
n = input()
for i in range(0,len(n)-1,1):
  if (n[i] == n[i+1]):
    print("Bad")
    else:
    print("Good")

Buggy submission (verdict: Runtime Error):
n = input()
for i in range(0,len(n)-1,1):
  if (n[i] ==-n[i+1]):
    print("Bad")
    else:
print("Good")

Buggy submission (verdict: Runtime Error):
n = input()
for i in range(0,len(n)-1,1):
  if (n[i] ==-n[i+1]):
    print("Bad")
    else:
      print("Good")
Problem p02999 (python)

Fixed submission:
X,A = map(int,input().split())
if X <A:
  print("0")
else:
  print("10")

Buggy submission (verdict: Runtime Error):
X,A = map(int,imput().split())
if X <A:
  print("0")
else:
  print("10")

Buggy submission (verdict: Runtime Error):
X,A = map(int,imput().split())
if X <A:
  print("0")
else:
  print("10"
Problem p02645 (python)

Fixed submission:
S = input()
print(S[:3])

Buggy submission (verdict: Runtime Error):
A, V = map(int, input().split())
B, W = map(int, input().split())
T = float(input())
 
if asbs(B - A)  <= abs(T * (V - W)):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A, V = map(int, input().split())
B, W = map(int, input().split())
T = float(input())
 
if abs(B - A)  <= T * (V - W):
    print("Yes")
else:
    print("No")
Problem p03109 (python)

Fixed submission:
input_s = input()
elems = input_s.split('/')
date = [int(elem) for elem in elems]
year, month, day = date
if (year > 2019):
    print('TBD')
elif(year < 2019):
    print('Heisei')
else:
    if(month > 4):
        print('TBD')
    elif(month < 4):
        print('Heisei')
    else:
        print('Heisei')

Buggy submission (verdict: Runtime Error):
input_s = input()
elems = input_s.split('/')
date = [int(elem) for elem in elems]
year, month, day = date
if (year > 2019):
    print('TBD')
elif(year < 2019):
    print('Heisei')
else:
    if(month > 4):
        print('TBD')
    elif(month < 4):
        print('Heisei')
    else:
        print('Heisei')
Problem p03129 (python)

Fixed submission:
import sys

arglist = [int(i) for i in raw_input().split()]
N = arglist[0]
K = arglist[1]

if int((N+1) / 2) >= K:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
import sys

N = int(sys.argv[1])
K = int(sys.argv[2])

if int((N+1) / 2) >= K:
    print('YES')
else:
    print('NO')