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

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

b=[list(map(int,input().split())) for i in range(m)]

if n==1:
  for i in range(10):
    
    flg=True
    for l in range(m):
      if str(i)[b[l][0]-1]  != str(b[l][1]):
        flg=False
    if flg==True:
      print(i)
      break
  else:
    print(-1)
  
else:  
  for i in range(10**(n-1),10**n):
    flg=True
    for j in range(m):
      if str(i)[b[j][0]-1] != str(b[j][1]):
        flg=False
    
    if flg==True:
      print(i)
      break
  if flg == False:
    print(-1)

Buggy submission (verdict: Runtime Error):
if n==1:
  for i in range(10):
    
    flg=True
    for l in range(m):
      if str(i)[b[l][0]-1]  != str(b[l][1]):
        flg=False
    if flg==True:
      print(i)
      break
  else:
    print(-1)
  
else:  
  for i in range(10**(n-1),10**n):
    flg=True
    for j in range(m):
      if str(i)[b[j][0]-1] != str(b[j][1]):
        flg=False
    
    if flg==True:
      print(i)
      break
  if flg == False:
    print(-1)
Problem p02772 (python)

Fixed submission:
n=int(input())
x=list(map(int,input().split()))
f=False
for i in range(n):
  if x[i]%2==0:
    if x[i]%3==0 or x[i]%5==0:
      pass
    else:
      f=True
      break
      
if f==False:
  
  print('APPROVED')
else:
        print('DENIED')

Buggy submission (verdict: Runtime Error):
n=int(input())
x=list(map(int,input().split()))
f=False
for i in range(n):
  if x[i]%2==0:
    if x%3==0 or x%5==0:
      pass
    else:
      f=True
      break
      
if f==False:
  print('APPROVED")
else:
        print('DENIED')
Problem p02778 (python)

Fixed submission:
s=input()
l=len(s)
t=[]
for i in range(l):
  t.append('x')

n=''.join(t)
print(n)

Buggy submission (verdict: Runtime Error):
s=input()
l=len(s)
t=[]
for i in range(l):
  t.append(x)

n=''.join(t)
print(n)
Problem p02802 (python)

Fixed submission:
n,m=map(int,input().split())
if m==0:
  print(0,0)
else:
  q=[0]*(n+1)
  s=[0]*(n+1)
  t=0
  for i in range(m):
    p,u=map(str,input().split())
    p=int(p)
    if q[p]==1:
      continue
    
    elif u=='AC':
      q[p]=1
      
      t+=s[p]
      
      
    elif u=="WA":
      if q[p]==0:
        s[p]+=1
        
  
  
  
  
  print(sum(q),t)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
if m==0:
  print(0,0)
else:
  p=[list(map(str,input().split())) for i in range(m)]
  q=[]
  s=[0]*n
  t=0
  for i in range(len(p)):
    if p[i][1]=='AC' and  not p[i][0] in q:
      q.append(p[i][0])
      t+=s[i]
      
    elif p[i][1]=="WA":
      if not p[i][0] in q:
        s[i]+=1
  
  
  
  
  print(len(q),t)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
if m==0:
  print(0,0)
else:
  p=[list(map(str,input().split())) for i in range(m)]
  q=[]
  s=[0]*n
  t=0
  for i in range(len(p)):
    if p[i][1]=='AC' and  not p[i][0] in q:
      q.append(p[i][0])
      t+=s
      
    elif p[i][1]=="WA":
      if not p[i][0] in q:
        s[i]+=1
  
  
  
  
  print(len(q),t)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
if m==0:
  print(0,0)
else:
  p=[list(map(str,input().split())) for i in range(m)]
  q=[]
  s=[0]*n
  t=0
  for i in range(len(p)):
    if p[i][1]=='AC' and  not p[i][0] in q:
      q.append(p[i][0])
      t+=s
      
    elif p[i][1]=="WA":
      if not p[i][0] in q:
        s[i]+=1
  
  
  
  
  print(len(q),len(s))
Problem p02818 (python)

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

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

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,innput().split())
if a>=k:
  print(a-k,b)
else:
  print(0,b-(k-a))
Problem p02900 (python)

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

def fact(n):
  temp=n
  arr=[]
  for i in range(2,int(-(-n**0.5//1))+1):
    if temp%i==0:
      
      while temp%i==0:
        
        temp//=i
      arr.append(i)
      
  if temp!=1:
    arr.append(temp)
  if arr==[]:
    arr.append(n)
  return arr

c=fact(a)
d=fact(b)
e=[1]

  
for i in range(len(c)):
  if c[i]  in d:
    e.append(c[i])

e=set(e)    
print(len(e))

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

def fact(n):
  temp=n
  arr=[]
  for i in range(2,int(-(-n**0.5//1))+1):
    if temp%i==0:
      
      while temp%i==0:
        
        temp//=i
      arr.append(i)
      
  if temp!=1:
    arr.append(temp)
  if arr==[]:
    arr.append(n)
  return arr

c=fact(a)
d=fact(b)


  
for i in range(len(c)):
  if c[i] not in d:
    del c[i]

    
print(len(c)+1)
Problem p02936 (python)

Fixed submission:
import collections

n,q=map(int,input().split())
cnt=[0]*(n+1)
g=[[] for i in range(n+1)]
for i in range(n-1):
  a,b=map(int,input().split())
  g[a].append(b)
  g[b].append(a)
for i in range(q):
  v,val=map(int,input().split())
  cnt[v]+=val
q=collections.deque()
q.append(1)
checked=[0]*(n+1)
while q:
  v=q.pop()
  checked[v]=1
  for i in g[v]:
    if checked[i]==1:
      continue
    cnt[i]+=cnt[v]
    q.append(i)
print(*cnt[1:])

Buggy submission (verdict: Runtime Error):
n,q=map(int,input().split())
g=[[] for i in range(n)]

for i in range(n-1):
  a,b=map(int,input().split())
  g[a-1].append(b-1)
  g[b-1].append(a-1)
  
add=[0]*n

for i in range(q):
  p,x=map(int,input().split())
  add[p-1]+=x
  
ans=[0]*n
def dfs(v,p,value):
  value+=add[v]
  ans[v]=value
  for j in g[v]: 
    if j==p: continue
    dfs(j,v,value)
      
      
dfs(0,-1,0)

print(*ans)
Problem p02952 (python)

Fixed submission:
m=int(input())
ans=0
for i in range(1,m+1):
  if len(str(i))%2==1:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
m=int(input())
ans=0
for i in range(n+1):
  if len(str(i))%2==1:
    ans+=1
print(ans)
Problem p03361 (python)

Fixed submission:
h,w=map(int,input().split())
s=[list(input()) for i in range(h)]

dxy=[(-1,0),(0,1),(0,-1),(1,0)]
for i in range(h):
  for j in range(w):
    if s[i][j]=="#":
      f=False
      for x,y in dxy:
        
        if 0<=i+x<=h-1 and 0<=j+y<=w-1 and s[i+x][j+y]=="#":
          f=True
      
      if not f:
        print("No")
        exit()
        
        

print("Yes")

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

dxy=[(-1,0),(0,1),(0,-1),(1,0)]
for i in range(h):
  for j in range(w):
    if s[i][j]=="#":
      f=False
      for x,y in dxy:
        
        if 0<=i+x<=h-1 and 0<=j+y<=w-1 and s[i+x][j+y]=="#":
          f=True
      
      if not f:
        print("No")
        exit()
        
        
if f:
  print("Yes")

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

dxy=[(-1,0),(0,1),(0,-1),(1,0)]
for i in range(h):
  for j in range(w):
    if s[i][j]=="#":
      f=False
      for x,y in dxy:
        
        if 0<=i+x<=h-1 and 0<=j+y<=w-1 and s[i+x][j+y]=="#":
          f=True
      
      if not f:
        print("No")
        break
        
        
if f:
  print("Yes")

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

dxy=[(-1,0),(0,1),(0,-1),(1,0)]
for i in range(h):
  for j in range(w):
    if s[i][j]=="#":
      f=False
      for x,y in dxy:
        
        if 0<=i+x<=h-1 and 0<=j+y<=w-1 and s[i+x][j+y]=="#":
          f=True
      
      if not f:
        print("No")
        
        
if f:
  print("Yes")
Problem p03545 (python)

Fixed submission:
s=str(input())
a=int(s[0])
b=int(s[1])
c=int(s[2])
d=int(s[3])

if a+b+c+d==7:
  print('{}+{}+{}+{}=7'.format(a,b,c,d))
elif a-b+c+d==7:
  print('{}-{}+{}+{}=7'.format(a,b,c,d))
elif a-b-c+d==7:
  print('{}-{}-{}+{}=7'.format(a,b,c,d))
elif a-b+c-d==7:
  print('{}-{}+{}-{}=7'.format(a,b,c,d))
elif a-b-c-d==7:
  print('{}-{}-{}-{}=7'.format(a,b,c,d))
elif a+b-c+d==7:
  print('{}+{}-{}+{}=7'.format(a,b,c,d))
elif a+b-c-d==7:
  print('{}+{}-{}-{}=7'.format(a,b,c,d))
else:
  print('{}+{}+{}-{}=7'.format(a,b,c,d))

Buggy submission (verdict: Runtime Error):
s=input()
a=s[0]
b=s[1]
c=s[2]
d=s[3]

if a+b+c+d==7:
  print('a+b+c+d=7')
elif a-b+c+d==7:
  print('a-b+c+d=7')
elif a-b-c+d==7:
  print('a-b-c+d=7')
elif a-b+c-d==7:
  print('a-b+c-d=7')
elif a-b-c-d==7:
  print('a-b-c-d=7')
elif a+b-c+d==7:
  print('a+b-c+d=7')
elif a+b-c-d==7:
  print('a+b-c-d=7')
else:
  print('a+b+c-d=7')
Problem p03574 (python)

Fixed submission:
h,w=map(int,input().split())
s=[list(input()) for i in range(h)]

dxy=[(-1,-1),(-1,0),(-1,1),(0,-1),(0,1),(1,-1),(1,0),(1,1)]
def bombcount(hi,wi):
  cnt=0
  for x,y in dxy:
    
      
    if 0<=hi+x<=h-1 and 0<=wi+y<=w-1:
      if s[hi+x][wi+y]=="#":
        
        cnt+=1
  return cnt
      
for i in range(h):
  for j in range(w):
    
    
    if s[i][j]==".":
      s[i][j]=str(bombcount(i,j))
      
for i in range(h):
  print("".join(s[i]))

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


def bombcount(hi,wi):
  cnt=0
  for x in range(-1,2):
    for y in range(-1,2):
      
      if 0<=hi+x<h-1 and 0<=wi+y<w-1:
        if s[hi+x][wi+y]=="#":
          cnt+=1
  return cnt
      
for i in range(h):
  for j in range(w):
    
    if s[i][j]=="#":
      continue
    else:
      s[i][j]=bombcount(i,j)
      
for i in range(h):
  print("".join(s[i]))
Problem p03643 (python)

Fixed submission:
s=int(input())
print('ABC'+str(s))

Buggy submission (verdict: Runtime Error):
s=int(input())
print('ABC'+s)
Problem p04001 (python)

Fixed submission:
s=input()
t=len(s)-1
sl=[s[i] for i in range(len(s))]
answers=[]

for i in range(2**t):
  tmp=[]
  for j in range(t):
    if (i>>j)&1:
      tmp.append(j)
  ll=['*'] * len(s)
  for k in tmp:
    ll[k]="+"
  ans=[]
  
  for k,_ in zip(sl,ll):
    ans.append(k)
    ans.append(_)
  ans=[_ for _ in ans if _ != "*"]
  ans=''.join(ans)
  ans=ans.split('+')
  ans=[int(k) for k in ans if k != '+']
  ans=sum(ans)
  answers.append(ans)
  
print(sum(answers))

Buggy submission (verdict: Runtime Error):
s=input()
t=len(s)-1
sl=[s[i] for i in range(len(s))]
answers=[]

for i in range(2**t):
  tmp=[]
  for j in range(t):
    if (i>>j)&1:
      tmp.append(j)
  ll=['*'] * len(s)
  for k in tmp:
    ll[k]="+"
  ans=[]
  
  for k,_in zip(sl,ll):
    ans.append(k)
    ans.append(_)
  ans=[_ for _ in ans if _ != "*"]
  ans=''.join(ans)
  ans=ans.split('+')
  ans=[int(k) for k in ans if k != '+']
  ans=sum(ans)
  answers.append(ans)
  
print(sum(answers))

Buggy submission (verdict: Runtime Error):
s=str(input())
t=len(s)-1
sl=[s[i] for i in range(len(S))]
answers=[]

for i in range(2**t):
  tmp=[]
  for j in range(t):
    if (i>>j)&1:
      tmp.append(j)
  ll=['*'] * len(s)
  for k in tmp:
    ll[k]="+"
  ans=[]
  
  for k,_in zip(sl,ll):
    ans.append(k)
    ans.append(_)
  ans=[_ for _ in ans if _ != "*"]
  ans=''.join(ans)
  ans=ans.split('+')
  ans=[int(k) for k in ans if k != '+']
  ans=sum(ans)
  answers.append(ans)
  
print(sum(answers))
Problem p02675 (python)

Fixed submission:
A = int(input())
rem = A % 10
if rem == 3:
  print("bon")
elif (rem == 0) or (rem == 1) or (rem == 6) or (rem == 8):
  print("pon")
else:
  print("hon")

Buggy submission (verdict: Runtime Error):
A = map(int, open(0).read().split())
rem = A % 10
if rem == 3:
  print("bon")
elif (rem == 0) or (rem == 1) or (rem == 6) or (rem == 8):
  print("pon")
else:
  print("hon")
Problem p02718 (python)

Fixed submission:
N ,M = map(int, input().split())
List = list(map(int, input().split()))
stand = 1 / (4 * M) * sum(List)
arr = []
for i in range(len(List)):
  if List[i] >= stand:
    arr.append(List[i])
if len(arr) >= M:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N ,M = map(int, input().split())
List = list(map(int, input().split()))
stand = 1 / (4 * M) * sum(List)
arr = []
for i in range(List):
  if List[i] >= stand:
    arr.append(List[i])
if len(arr) >= M:
  print("Yes")
else:
  print("No")
Problem p03060 (python)

Fixed submission:
def calculate_max(Ans, value):
    temp = Ans
    if (Ans + value) > Ans:
        temp += value
    if temp < 0 :
        temp = 0
    return temp
# input processing 
N = int(input())
Value = list(map(int, input().split()))
Cost = list(map(int, input().split()))
# profit calculation
Profit = [Value[i] - Cost[i] for i in range(N)]
Answer = 0
# process
for i in range(N):
    Answer = calculate_max(Answer, Profit[i])
# Output
print(Answer)

Buggy submission (verdict: Runtime Error):
def calculate_max(Ans, value):
    temp = Ans
    if (Ans + value) > Ans:
        temp += value
    if tmep < 0 :
        temp = 0
    return temp
# input processing 
N = int(input())
Value = map(int, input().split())
Cost = map(int, input().split())
# profit calculation
Profit = [Value[i] - Cost[i] for i in range(N)]
Answer = 0
# process
for i in range(N):
    Answer = calculate_max(Answer, Profit[i])
# Output
print(Answer)
Problem p02765 (python)

Fixed submission:
InputValue = input().split(' ')

N = int(InputValue[0])
R = int(InputValue[1])

if 0<=R<=4111 and 1<=N<=100:
    if N>=10:
        IR = R
        print(IR,end='\n')
    elif N<10:
        IR = R + 100*(10-N)
        print(IR,end='\n')

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

if 0<=R<=4111 and 1<=N<=100:
    if N>=10:
        IR = R
        print(IR,end='\n')
    elif N<10:
        IR = R + 100*(10-N)
        print(IR,end='\n')

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

if 0<=R<=4111 and 1<=N<=100:
    if N>=10:
        IR = R
        print(IR,end='\n')
    elif N<10:
        IR = R + 100*(10-N)
        print(IR,end='\n')

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

if 0<=R<=4111 and 1<=N<=100:
    if N>=10:
        IR = R
        print(IR,end='\n')
    elif N<10:
        IR = R + 100*(10-N)
        print(IR,end='\n')
Problem p02639 (python)

Fixed submission:
X = [int(i) for i in input().split()]

for i in range(len(X)):
  if X[i] == 0:
    print (i+1)

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

ans = "No"

for a in range(x + 1):
  b = x - a
  if (2 * a + 4 * b ) == y:
    ans = "Yes"
    break

print (ans)

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

a = y / 2
b = 0
while (a + b) != x:
  a -= 2
  b += 1
  if a < 0: break

s = 2 * a + 4 * b
if s == y and a >= 0:
  print("Yes")
else:
  print("No")
Problem p02639 (python)

Fixed submission:
nums = [int(x) for x in input().split(" ")]

for i in range(5):
    if nums[i] == 0:
        print(i + 1)
        exit(0)

Buggy submission (verdict: Runtime Error):
nums = [int(x) for x in input()]

for i in range(5):
    if nums[i] == 0:
        print(i + 1)
        exit(0)
Problem p02641 (python)

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

if n == 0:
    print(x)
    exit(0)

nums = set([int(x) for x in input().split(" ")])

dist = 0

while True:
    if not x - dist in nums:
        print(x - dist)
        exit(0)

    if not x + dist in nums:
        print(x + dist)
        exit(0)

    dist += 1

Buggy submission (verdict: Runtime Error):
x, _ = [int(x) for x in input().split(" ")]
nums = set([int(x) for x in input().split(" ")])

dist = 0

while True:
    if not x - dist in nums:
        print(x - dist)
        exit(0)

    if not x + dist in nums:
        print(x + dist)
        exit(0)

    dist += 1
Problem p02760 (python)

Fixed submission:
BingoRow = 3
BingoList = [list(map(int,input().split())) for i in range(BingoRow)]
 
TargetRow = int(input())
TargetList = [int(input()) for i in range(TargetRow)]
 
ansList = []
x = 0
flg = False
for row in BingoList:
  for num in row:
    flg = False
    for target in TargetList:
      if num == target:
        ansList.append(1)
        flg = True
    if not flg:
      ansList.append(0)
 
if (ansList[0] + ansList[1] + ansList[2]) == 3:
  print('Yes')
elif (ansList[3] + ansList[4] + ansList[5]) == 3:
  print('Yes')
elif (ansList[6] + ansList[7] + ansList[8]) == 3:
  print('Yes')
elif (ansList[0] + ansList[3] + ansList[6]) == 3:
  print('Yes')
elif (ansList[1] + ansList[4] + ansList[7]) == 3:
  print('Yes')
elif (ansList[2] + ansList[5] + ansList[8]) == 3:
  print('Yes')
elif (ansList[0] + ansList[4] + ansList[8]) == 3:
  print('Yes')
elif (ansList[2] + ansList[4] + ansList[6]) == 3:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
BingoRow = 3
BingoList = [list(map(int,input().split())) for i in range(BingoRow)]

TargetRow = int(input())
TargetList = [int(input()) for i in range(TargetRow)]

ansList = []
x = 0
flg = false
for row in BingoList:
  for num in row:
    flg = false
    for target in TargetList:
      if num == target:
        ansList.append(1)
        flg = true
    if !flg:
      ansList.append(0)

if (ansList[0] + ansList[1] + ansList[2]) == 3:
  print('Yes')
elif (ansList[3] + ansList[4] + ansList[5]) == 3:
  print('Yes')
elif (ansList[6] + ansList[7] + ansList[8]) == 3:
  print('Yes')
elif (ansList[0] + ansList[3] + ansList[6]) == 3:
  print('Yes')
elif (ansList[1] + ansList[4] + ansList[7]) == 3:
  print('Yes')
elif (ansList[2] + ansList[5] + ansList[8]) == 3:
  print('Yes')
elif (ansList[0] + ansList[4] + ansList[8]) == 3:
  print('Yes')
elif (ansList[2] + ansList[4] + ansList[6]) == 3:
  print('Yes')
else:
  print('No')
Problem p02765 (python)

Fixed submission:
N,R = map(int,input().split())
if N >= 10:
    print(R)
else:
    print(R + (100 * (10 - N)))

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

print(b + max(0, 10 -a))
Problem p02922 (python)

Fixed submission:
import sys

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")



a,b=MI()
x=a

if b == 1:
    print(0)
    exit()
if x >= b:
    print(1)
    exit()
for i in range(2,21):
    x+=(a-1)
    if x >= b:
        print(i)
        exit()

Buggy submission (verdict: Runtime Error):
import sys
from math import gcd


# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")



a,b=MI()
x=a
if x >= b:
    print(1)
    exit()
for i in range(2,21):
    x+=(a-1)
    if x >= b:
        print(i)
        exit()
Problem p02952 (python)

Fixed submission:
import sys

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

N = int(input())
ans = 0
for i in range(1, N + 1):
    if len(str(i)) % 2 == 1:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import sys

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

N = int(input())
ans = 0
for i in range(1, N + 1):
    if len(str(i)) % 2 == 1:
    ans += 1
print(ans)
Problem p03146 (python)

Fixed submission:
import sys
import math
from collections import Counter
import itertools
import fractions
import datetime
from decimal import Decimal
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################

s=II()
l=[s]
cnt = 1
while True:
    cnt += 1
    if s%2==0:
        s/=2
    else:
        s = 3*s+1
    if s in l:
        print(cnt)
        exit()
    else:
        l.append(s)

Buggy submission (verdict: Runtime Error):
import sys
import math
from collections import Counter
import itertools
import fractions
import datetime
from decimal import Decimal
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################

s=II()
l=[s]
cnt = 1
while True:
    cnt += 1
    if s%2==0:
        s/=2
    else:
        s = 3*s+1
    if s in se:
        print(cnt)
        exit()
    else:
        l.append(s)
Problem p03067 (python)

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

if a<c<b or b<c<a:
    print("Yes")
else:
    print("No")

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

if a<c<b or b<c<a:
    print("Yes")
else
    print("No")
Problem p02640 (python)

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

if Y <= 4 * X and Y >= 2 * X and Y % 2 == 0:
    print('Yes')
else:
    print('No')

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

if Y <= 4 * X && Y >= 2 * X:
    print('Yes')
else:
    print('No')
Problem p02886 (python)

Fixed submission:
a=int(input())
b=list(map(int,input().split()))
out=0
for i in range(a):

  for j in range(i+1,a):

    out=out+b[i]*b[j]
    
print(out)

Buggy submission (verdict: Runtime Error):
a=int(inputu())
b=list(map(int,input().split()))
out=0
for i in range(a):
  for j in range(i-1):
    out=out+b[i]*b[j]
    
print(out)