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

Fixed submission:
a,b=map(int,input().split())
if a>=13:
  print(b)
elif a>=6:
  print(b//2)
else:
  print("0")

Buggy submission (verdict: Runtime Error):
a,p=map(int,input().split())
if a>=13:
  print(b)
elif a>=6:
  print(b//2)
else:
  print("0")
Problem p03085 (python)

Fixed submission:
b=input()
if b=="A":
  print("T")
if b=="T":
  print("A")
if b=="C":
  print("G")
if b=="G":
  print("C")

Buggy submission (verdict: Runtime Error):
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if lis[0]>=lo:
  lo=lis[j]
if le-lis[-1]-1>=lo:
  lo=le-lis[-1]-1
print(lo)

Buggy submission (verdict: Runtime Error):
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if lis[0]>=lo:
  lo=lis[j]
if len(lis)-lis[-1]+1>=lo:
  lo=len(lis)-lis[-1]-1
print(lo)

Buggy submission (verdict: Runtime Error):
b=input()
if b=="A":
  print("T")
if b="T":
  print("A")
if b="C":
  print("G")
if b="G":
  print("C")

Buggy submission (verdict: Runtime Error):
b=input()
if b[i]=="A":
  print("T")
if b[i]=="T":
  print("A")
if b[i]=="C":
  print("G")
if b[i]=="G":
  print("C")
Problem p03086 (python)

Fixed submission:
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="C" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if bool(lis):
  if lis[0]>=lo:
    lo=lis[0]
  if le-lis[-1]-1>=lo:
    lo=le-lis[-1]-1
  print(lo)
else:
  print(le)

Buggy submission (verdict: Runtime Error):
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="C" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
#print(lo)
if lis[0]>=lo:
  lo=lis[0]
#print(lo)
if le-lis[-1]-1>=lo:
  lo=le-lis[-1]-1
#print(lo)
print(lo)

Buggy submission (verdict: Runtime Error):
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="C" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
#print(lo)
if lis[0]>=lo:
  lo=lis[0]
#print(lo)
if le-lis[-1]-1>=lo:
  lo=le-lis[-1]-1
#print(lo)
print(lis,lo)

Buggy submission (verdict: Runtime Error):
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="C" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if lis[0]>=lo:
  lo=lis[j]
if le-lis[-1]-1>=lo:
  lo=le-lis[-1]-1
print(lo)

Buggy submission (verdict: Runtime Error):
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if lis[0]>=lo:
  lo=lis[j]
if le-lis[-1]-1>=lo:
  lo=le-lis[-1]-1
print(lo)

Buggy submission (verdict: Runtime Error):
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if lis[0]>=lo:
  lo=lis[j]
if le-lis[-1]+1>=lo:
  lo=le-lis[-1]-1
print(lo)

Buggy submission (verdict: Runtime Error):
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if lis[0]>=lo:
  lo=lis[j]
if len(lis)-lis[-1]+1>=lo:
  lo=len(lis)-lis[-1]-1
print(lo)

Buggy submission (verdict: Runtime Error):
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if lis[0]>=lo:
  lo=lis[j]
if len(lis)-lis[-1]+1>=lo:
  lo=len(lis)-lis[-1]+1
print(lo)
Problem p03126 (python)

Fixed submission:
import copy
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.pop(0)
for i in range(n-1):
  t=list(map(int,input().split()))
  k=t.pop(0)
  b=copy.deepcopy(a)
  for j in range(0,len(a)):
    if not b[j] in t:
      a.remove(b[j])
print(len(a))

Buggy submission (verdict: Runtime Error):
import copy
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.pop(0)
for i in range(n-1):
  t=list(map(int,input().split()))
  k=t.pop(0)
  b=copy.deepcopy(a)
  for j in range(0,len(a)):
    if not b[j] in t:
      a.remove(a[j])
print(len(a))
Problem p03210 (python)

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

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

Fixed submission:
n=int(input())
v=list(map(int,input().split()))
dic1={}
dic2={}
for i in range(0,n):
  if i%2==0:
    at=v[i]
    if at in dic1:
      dic1[at]+=1
    else:
      dic1[at]=1
  else:
    at=v[i]
    if at in dic2:
      dic2[at]+=1
    else:
      dic2[at]=1 

count1=0
count2=0
kep1=0
kep2=0
for i in range(len(dic1)):
  at=dic1.popitem()
  moji=at[0]
  count=at[1]
  if count>count2:
    kep2=moji
    count2=count
  if count2>count1:
    moji_tamotu=kep1
    count_tamotu=count1
    kep1=kep2
    kep2=moji_tamotu
    count1=count2
    count2=count_tamotu

odd_1_moji=kep1
odd_1_count=count1
odd_2_moji=kep2
odd_2_count=count2
    
count1=0
count2=0
kep1=0
kep2=0
for i in range(len(dic2)):
  at=dic2.popitem()
  moji=at[0]
  count=at[1]
  if count>count2:
    kep2=moji
    count2=count
  if count2>count1:
    moji_tamotu=kep1
    count_tamotu=count1
    kep1=kep2
    kep2=moji_tamotu
    count1=count2
    count2=count_tamotu

even_1_moji=kep1
even_1_count=count1
even_2_moji=kep2
even_2_count=count2

if even_1_moji!=odd_1_moji:
  kouho=[odd_1_moji,even_1_moji]*(n//2)
else:
  if even_1_count+odd_2_count>=even_2_count+odd_1_count:
    kouho=[odd_2_moji,even_1_moji]*(n//2)
  else:
    kouho=[odd_1_moji,even_2_moji]*(n//2)
    
res=0
for i in range(0,n):
  if v[i]!=kouho[i]:
    res+=1
print(res)

Buggy submission (verdict: Runtime Error):
n=int(input())
v=list(map(int,input().split()))
dic1={}
dic2={}
for i in range(0,n):
  if i%2==0:
    at=v[i]
    if at in dic1:
      dic1[at]+=1
    else:
      dic1[at]=1
  else:
    at=v[i]
    if at in dic2:
      dic2[at]+=1
    else:
      dic2[at]=1 

count1=0
count2=0
kep1=0
kep2=0
for i in range(len(dic1)):
  at=dic1.popitem()
  moji=at[0]
  count=at[1]
  if count>count2:
    kep2=moji
    count2=count
  if count2>count1:
    moji_tamotu=kep1
    count_tamotu=count1
    kep1=kep2
    kep2=moji_tamotu
    count1=count2
    count2=count_tamotu

odd_1_moji=kep1
odd_1_count=count1
odd_2_moji=kep2
odd_2_count=count2
    
count1=0
count2=0
kep1=0
kep2=0
for i in range(len(dic2)):
  at=dic2.popitem()
  moji=at[0]
  count=at[1]
  if count>count2:
    kep2=moji
    count2=count
  if count2>count1:
    moji_tamotu=kep1
    count_tamotu=count1
    kep1=kep2
    kep2=moji_tamotu
    count1=count2
    count2=count_tamotu

even_1_moji=kep1
even_1_count=count1
even_2_moji=kep2
even_2_count=count2

if even_1_moji!=odd_1_moji:
  kouho=[odd_1_moji,even_1_moji]*(n//2)
else:
  if even_1_count+odd_2_count>=even_2_count+odd_1_count:
    kouho=[odd_2_moji,even_1_moji]*2
  else:
    kouho=[odd_1_moji,even_2_moji]*2
    
res=0
for i in range(0,n):
  if v[i]!=kouho[i]:
    res+=1
print(res)
Problem p03273 (python)

Fixed submission:
h,w=map(int,input().split())
lis=[]
for i in range(h):
  lis.append(input())
tate=[]
yoko=[]
for i in range(0,w):
  for j in range(0,h):
    if lis[j][i]=="#":
      tate.append(i)
      break

for i in range(0,h):
  for j in range(0,w):
    if lis[i][j]=="#":
      yoko.append(i)
      break

for x in yoko:
  for y in tate:
    if y != tate[len(tate)-1]:
      print(lis[x][y],end="")
    else:
      print(lis[x][y])

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
lis=[]
for i in range(h):
  lis.append(list(input()))
for i in range(0,len(lis)):
  i=len(lis)-i-1
  count=0
  for j in range(0,len(lis[0])):
    if lis[i][j]==".":
      count+=1
  if count==len(lis[0]):
    lis.pop(i)

for i in range(0,len(lis[0])):
  i=len(lis)-i-1
  count=0
  for j in range(0,len(lis)):
    if lis[j][i]==".":
      count+=1
  if count==len(lis):
    for k in range(len(lis)):
      lis[k].pop(i)

for i in range(len(lis[0])):
  moji=""
  for j in range(len(lis)):
    moji+=lis[i][j]
  print(moji)
Problem p03284 (python)

Fixed submission:
n,k=map(int,input().split())
if n%k==0:
  print("0")
else:
  print("1")

Buggy submission (verdict: Runtime Error):
n=int(input())
count=0
for i in range(0,30):
  for j in range(0,30):
    if i*4+j+7==30:
      print("Yes")
      break
    else:
      count+=1
if count==900:
  print("No")
Problem p03378 (python)

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

keep=0
hidari=a[0]
while hidari<x and keep<=m:
  keep+=1
  hidari=a[keep]
  
print(min(keep,m-keep))

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

keep=0
hidari=1
while keep<x:
  keep=a[hidari]
  hidari+=1

keep=10*100
migi=-1
while keep>x:
  keep=a[migi]
  migi-=1
  
print(min([hidari-1,-migi-2]))
Problem p03424 (python)

Fixed submission:
n=int(input())
dic={}.fromkeys(map(str,input().split()))
if len(dic)==3:
  print("Three")
if len(dic)==4:
  print("Four")

Buggy submission (verdict: Runtime Error):
n=int(input())
dic={}.fromkeys(map(str,input().split()))
if len(dic)==3:
  print("Three")
if len(dic)==4::
  print("Four")
Problem p03657 (python)

Fixed submission:
a,b=map(int,input().split())
if a%3==0 or b%3==0 or (a+b)%3==0:
  print("Possible")
else:
  print("Impossible")

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a%3==0 or b%3==0 or c%3==0:
  print("Possible")
else:
  print("Impossible")
Problem p03680 (python)

Fixed submission:
n=int(input())
a=[]
for i in range(n):
  a.append(int(input()))
keep=1
count=0
ababa=0
for i in range(n):
  count+=1
  keep=a[keep-1]
  if keep==2:
    ababa=1
    print(count)
    break
if ababa==0:
  print(-1)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[]
for i in range(n):
  a.append(int(input()))
keep=1
count=0
ababa=0
for i in range(n):
  count+=1
  keep=a[keep-1]
  if keep==2:
    ababa=1
    print(count)
    break
if ababa=0:
  print(-1)
Problem p03693 (python)

Fixed submission:
a,b,c=map(int,input().split())
print(["NO","YES"][(b*10+c)%4==0])

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print(["NO","YES"][(b*10+c)%4==0]
Problem p03730 (python)

Fixed submission:
a,b,c=map(int,input().split())
moda=a%b
keep=0
for i in range(1,10**6):
  if (moda*i)%b==c:
    keep=1
    print("YES")
    break
if keep==0:
  print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
moda=a%k
keep=0
for i in range(0,10**8):
  if (moda*i)%k==c:
    keep=1
    print("YES")
    break
if keep==0:
  print("No")
Problem p04043 (python)

Fixed submission:
a,b,c=map(int,input().split())
if (a==5 and b==5 and c==7) or(a==5 and c==5 and b==7) or (c==5 and b==5 and a==7):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if (a==5 and b=5 and c==7) or(a==5 and c==5 and b==7) or (c==5 and b==5 and a==7):
  print("YES")
else:
  print("NO")
Problem p02628 (python)

Fixed submission:
N,K = input().split()
price = list(int(t) for t in input().split())
price_s = sorted(price)
total = sum(price_s[0:int(K)])
print(total)

Buggy submission (verdict: Runtime Error):
N,K = list(int(t) for t in input().split())
price = list(int(t) for t in input().split())
price.sort()
total = sum(price[0,K])
print(total)
Problem p02639 (python)

Fixed submission:
n = 5
Si = n*(n+1)/2
lst = list(map(int,input().split()))
Sr = sum(lst)
print(int(Si-Sr))

Buggy submission (verdict: Runtime Error):
n = 5
Si = n(n+1)/2
lst = list(map(int,input().split()))
Sr = sum(lst)
print(Si-Sr)
Problem p02612 (python)

Fixed submission:
s = int(input())
for i in range(1,11):
  if (1000 * i) >= s:
    print((1000 * i) - s)
    break

Buggy submission (verdict: Runtime Error):
s = int(input())
for i in range(1,10):
  if (1000 * i) > s:
    return print((1000 * i) - s)
Problem p02641 (python)

Fixed submission:
X,N = map(int, input().split())
if N > 0: 
    P = list(map(int,input().split()))
    direction = -1
    i = 1
    if not X in P:
        print(X)
    else:
        while True:
            dist = i * direction
            val = dist+X
            if not (val in P):
                print(val)
                break
            if direction < 0: direction = 1
            else : 
                direction = -1
                i+=1
else: 
    print(X)

Buggy submission (verdict: Runtime Error):
X,N = map(int, input().split())
P = map(list,int(input.split()))
direction = -1
i = 0
while True:
    dist = i * direction

    if not (dist + X in P):
        print(dist + X)
        break
    i += 1
    if direction < 0: direction = 1
    else : direction = -1
Problem p02621 (python)

Fixed submission:
a=int(input())
print(a+a**2+a**3)

Buggy submission (verdict: Runtime Error):
print(int(a+a**2+a**3))

Buggy submission (verdict: Runtime Error):
print(a + a ** 2 + a ** 3)

Buggy submission (verdict: Runtime Error):
a = input()
print(a + a ** 2 + a ** 3)
Problem p02657 (python)

Fixed submission:
def main():
    a, b = (int(i) for i in input().split())
    print(str(a * b))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    arg = int(input())
    ans = arg + arg ** 2 + arg ** 3
    print(str(ans))


if __name__ == '__main__':
    main()
Problem p03035 (python)

Fixed submission:
age, price = (int(x) for x in input().split(' '))

if age <= 5:
    print('0')
elif 6 <= age <= 12:
    print('{}'.format(price // 2))
else:
    print('{}'.format(price))

Buggy submission (verdict: Runtime Error):
age, price = (int(x) for x in input().split(' '))

if age <= 5:
    print('0')
elif age >= 6 & age <= 12:
    print(f'{price // 2}')
else:
    print(f'{price}')
Problem p03280 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = map(int, input(),split())
c = (a-1) * (b-1)
print(c)
Problem p02818 (python)

Fixed submission:
a, b, k  = map(int, input().split())
if a + b <=k:
    ansa=0
    ansb=0
elif k>=a:
    ansa=0
    ansb=a+b-k
else:
    ansa=a-k
    ansb=b

print(ansa, ansb)

Buggy submission (verdict: Runtime Error):
a, b, k  = map(int, input().split())
if a + b =<k:
    ansa=0
    ansb=0
elif k=>a:
    ansa=0
    ansb=a+b-k
else:
    ansa=a-k
    ansb=b

print(ansa + " "+ ansb)
Problem p02887 (python)

Fixed submission:
n=int(input())
S=str(input())
s=list(S)
i=1
while True:
    if n ==1 or n==0:
        break
    if s[i-1]==s[i]:
        s.pop(i)
        n -= 1
    else:
        i +=1
    if i >= n:
        break
print(len(s))

Buggy submission (verdict: Runtime Error):
n=int(input())
S=str(input())
s=list(S)
i=1
while True:
    if n ==1:
        break
    if s[i-1]==s[i]:
        s.pop(i)
        n -= 1
    else:
        i +=1
    if i > n:
        break
print(len(s))

Buggy submission (verdict: Runtime Error):
n=int(input())
S=str(input())
s=list(S)
i=1
while True:
    if i > n:
        break
    if s[i-1]==s[i]:
        s.pop(i)
        n -= 1
    else:
        i +=1

print(len(s))

Buggy submission (verdict: Runtime Error):
n=int(input())
S=str(input())
s=list(S)
i=1
while True:
    if s[i-1]==s[i]:
        s.pop(i)
        n -= 1
    else:
        i +=1
    if i >=n:
        break
print(len(s))
Problem p02613 (python)

Fixed submission:
N = int(input())
status={'AC':0, 'WA':0, 'TLE':0, 'RE':0}
results = [input() for n in range(N)]
for result in results:
     if result in status.keys():
         status[result] += 1
for k, v in status.items():
    print('{} x {}'.format(k, v))

Buggy submission (verdict: Runtime Error):
6
AC
TLE
AC
AC
WA
TLE
Problem p03455 (python)

Fixed submission:
a,b = map(int, input().split())
if a * b % 2 == 0:
  print('Even')
else:
  print('Odd')

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
if a*b // 2 == 0:
  print('Even')
  else:
  	print('Odd')
Problem p03076 (python)

Fixed submission:
import math 
a = [int(input())for i in range(5)]
rest = []
t = 0
for i in a:
  if i%10 == 0 :
    t+=i
  else:
    rest.append(i)
if rest == [] :
  print(t)
else :
  f = sorted(rest, key=lambda x:str(x)[-1] ,reverse=True)
  c = [math.ceil(i/10)*10for i in f[:-1]]
  t += sum(c)+f[-1]
  print(t)

Buggy submission (verdict: Runtime Error):
import math 
a = [int(input())for i in range(5)]
rest = []
t = 0
for i in a:
  if i%10 == 0 :
    t+=i
  else:
    rest.append(i)

f = sorted(rest, key=lambda x:str(x)[-1] ,reverse=True)
c = [math.ceil(i/10)*10for i in f[:-1]]

t += sum(c)+f[-1]

print(t)
Problem p03079 (python)

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

if (a == b)  & (b == c) &(c == a):
    print('Yes')
else :
    print( 'No')

Buggy submission (verdict: Runtime Error):
a,b,c = input()

if (a == b)  & (b == c) &(c == a):
    print('yes')
else :
    print( 'no')
Problem p03086 (python)

Fixed submission:
import re 
S = input()
 
p = re.compile('[ATCG]+')
f = p.finditer(S)
 
candidate = [i.span()[1]- i.span()[0] for i in f]
if candidate == [] :
    print(0)
else :
    print(max(candidate))

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

p = re.compile('[ATCG]+')
f = p.finditer

candidate = [i.span()[1]- i.span()[0] for i in f]
if candidate == [] :
    print(0)
else :
    print(max(candidate))
Problem p03102 (python)

Fixed submission:
N, M, C = map(int,input().split(' '))
import numpy as np
B = np.array(list(map(int,input().split(' '))))
def f(A, B, C):
    A = np.array(list(map(int,A.split(' '))))
    return np.sum(A*B) +C >  0
print(np.sum([f(input(), B, C) for i in range(N)]))

Buggy submission (verdict: Runtime Error):
N, M, C = map(int,input().split(' '))
import numpy as np
B = np.array(list(map(int,input().split(' '))))
def f(A, B, C):
    A = np.array(list(map(int,A.split(' '))))
    return np.sum(A*B) +C >  0
print(
Problem p03125 (python)

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

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

if b%a == 0 :
  print(b+a)
else :
  print(b -a)
Problem p03360 (python)

Fixed submission:
A=  sorted(list(map(int, input().split())))
n = int(input())

print(sum(A[:-1]) + A[-1] *2**n )

Buggy submission (verdict: Runtime Error):
import numpy as np
A=  np.array(list(map(int, input().split())))
n = int(input())
f = np.argmax(A)c
A[f] = A[f]*2**n
print(A.sum())
Problem p03386 (python)

Fixed submission:
a,b,k=map(int,input().split())
l=range(a,b+1)
ans=sorted(set(l[:k])|set(l[-k:]))
for i in ans:
    print(i)

Buggy submission (verdict: Runtime Error):
a,b,k = list(map( int, input().split()))
x = list(range(a,b+1))
x = sorted(list(set(x[:k])|set(x[-k:])))
for i in x:
  print(i)

Buggy submission (verdict: Runtime Error):
a,b,k = list(map( int, input().split()))
x = list(range(a,b+1))
x = sorted(list(set(x[:k]+x[-k:])))
for i in x:
  print(i)

Buggy submission (verdict: Runtime Error):
a,b,k = list(map( int, input().split()))
x = list(range(a,b+1))

x = sorted(list(set(x[:k]+x[-k:])))
for i in x:
  print(i)
Problem p03474 (python)

Fixed submission:
a,b =map(int, input().split())
s =input()
 
def main(a,b,s):
  if len(s) != a+1+b :
    return 'No'
 
  for n,i in enumerate(s) :
    if n == a :
      
      if i != '-' :
        return 'No'
    else :
      try :
        int(i)
      except :
        return 'No'
  return 'Yes'
              
print(main(a,b,s))

Buggy submission (verdict: Runtime Error):
def main(a,b,s):
  if len(s) != a+1+b :
    return 'No'
 
  for n,i in enumerate(s) :
    if n == a :
      
      if i != '-' :
        return 'No'
    else :
      try :
        int(i)
      except :
        return 'No'
  return 'Yes'
              
print(main(a,b,s))
Problem p03564 (python)

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

a = [1]
b = [1]
x = 10**6
for i in range(n+1):
  for j in range(n-i,n-i+1):
    f = 1*2**i+j*k
    if x > f:
      x = f
      
print(x)

Buggy submission (verdict: Runtime Error):
 int( input())
k = int( input())
 
a = 1
for i in range(n):
  a = min(a+k, a*2)  
print(a)
Problem p03636 (python)

Fixed submission:
x,*y,z=input()
print(x+str(len(y))+z)

Buggy submission (verdict: Runtime Error):
#include<iostream>
using namespace std;

main(){
	string s ;
  	cin >> s; 
  	cout << s.front()<<to_string(s.length() -2 )<<s.back()<< endl;
  	return 0;
}
Problem p02612 (python)

Fixed submission:
N=int(input())
a=0
if N<1000:
    print(1000-N)
    exit()
else:
    while 1:
        if a*1000-N>=0:
            print(a*1000-N)
            exit()
        else:
            a+=1

Buggy submission (verdict: Runtime Error):
N=int(input())
a=0
if N<1000:
    print(N)
    exit()
else:
    while 1:
        if a*1000-N>=0:
            prit(a*1000-N)
            exit()
        else:
            a+=1
Problem p02612 (python)

Fixed submission:
N = input()
if N[-3:] == '000':
  print(0)
else:
  print(1000 - int(N[-3:]))

Buggy submission (verdict: Runtime Error):
N = input()
if N[-3] == '0':
  print(0)
else:
  print((10 - int(N[-3]))*100)
Problem p02761 (python)

Fixed submission:
N, M = map(int, input().split())
A = []
for i in range(0, M):
    a = tuple(map(int, input().split()))
    A.append(a)
start = 10**(N-1)
if N == 1:
    start = 0
for x in range(start, 10**N):
    ans = str(x)
    flag = True
    for a in A:
        if ans[a[0]-1] != str(a[1]):
            flag = False
    if flag:
        print(x)
        exit(0)
print(-1)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = []
for i in range(0, M):
    a = tuple(map(int, input().split()))
    A.append(a)
for x in range(10**(N-1)-1, 10**N):
    ans = str(x)
    flag = True
    for a in A:
        if ans[a[0]-1] != str(a[1]):
            flag = False
    if flag:
        print(x)
        exit(0)
print(-1)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
if M == 0:
    print(10**(N-1))
    exit(0)
A = [[] for i in range(0, N)]
for i in range(0, M):
    x, y = map(int, input().split())
    if y in A[x-1]:
        continue
    A[x-1].append(y)
for a in A:
    if len(a) > 1:
        print(-1)
        exit(0)
ans = ''
if A[0][0] == 0:
    print(-1)
    exit(0)
for i in range(0, N):
    if len(A[i]) == 1:
        ans += str(A[i][0])
    else:
        ans += '0'
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [[] for i in range(0, N)]
for i in range(0, M):
    x, y = map(int, input().split())
    if y in A[x-1]:
        continue
    A[x-1].append(y)
for a in A:
    if len(a) > 1:
        print(-1)
        exit(0)
ans = ''
if A[0][0] == 0:
    print(-1)
    exit(0)
for i in range(0, N):
    if len(A[i]) == 1:
        ans += str(A[i][0])
    else:
        ans += '0'
print(ans)
Problem p02802 (python)

Fixed submission:
N, M = map(int, input().split())
P = []
S = []
flag = [False for i in range(0, N)]
for i in range(0, M):
    x, y = map(str, input().split())
    P.append(int(x)-1)
    S.append(y)
ans = [0, 0]
wa = [0 for i in range(0, N)]
for i in range(0, M):
    if not flag[P[i]]:
        if S[i] == 'AC':
            flag[P[i]] = True
            ans[0] += 1
            ans[1] += wa[P[i]]
        else:
            wa[P[i]] += 1
print(*ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
P = []
S = []
flag = [False for i in range(0, N)]
for i in range(0, M):
    x, y = map(str, input().split())
    P.append(int(x-1))
    S.append(y)
ans = [0, 0]
for i in range(0, M):
    if flag[P[i]]:
        continue
    else:
        if S[i] == 'AC':
            flag[P[i]] = True
            ans[0] += 1
        else:
            ans[1] += 1
print(*ans)