Problem:


Score : 200 points

Problem Statement

Sig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the 0 key, the 1 key and the backspace key.

To begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this string is empty. When each key on the keyboard is pressed, the following changes occur to the string:

The 0 key: a letter 0 will be inserted to the right of the string.

The 1 key: a letter 1 will be inserted to the right of the string.

The backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is deleted.

Sig has launched the editor, and pressed these keys several times. You are given a string s, which is a record of his keystrokes in order. In this string, the letter 0 stands for the 0 key, the letter 1 stands for the 1 key and the letter B stands for the backspace key. What string is displayed in the editor now?

Constraints

1 ≦ |s| ≦ 10 (|s| denotes the length of s)

s consists of the letters 0, 1 and B.

The correct answer is not an empty string.

Input

The input is given from Standard Input in the following format:

s

Output

Print the string displayed in the editor in the end.

Sample Input 1

01B0

Sample Output 1

00

Each time the key is pressed, the string in the editor will change as follows: 0, 01, 0, 00.

Sample Input 2

0BB1

Sample Output 2

1

Each time the key is pressed, the string in the editor will change as follows: 0, (empty), (empty), 1.



Sample input:
01B0


Sample output:
00

Submission status: Wrong Answer

Solution code:
s = list(input())
ans = []
for i in range(len(s)) :
    if s[i] == "0" :
        ans.append("0")
    elif s[i] == "1" :
        ans.append("1")
    elif s[i] == "B" and len(ans) > 0 :
        ans.remove(ans[-1])
print("".join(ans))

Submission status: Wrong Answer

Solution code:
s = input()
ans = ''
for i in range(len(s)-1):
    if s[i] != 'B' and s[i+1] !='B':
        ans += s[i]
if s[-1] != 'B':
    ans += s[-1]

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
S = s.split('B')
for i in range(len(S)-1):
    S[i] = S[i][:-1]
print(''.join(S))

Submission status: Wrong Answer

Solution code:
s = input()
x = ""
for i in range(len(s) - 1):
    if s[i] == "0" and s[i+1] != "B":
        x += "0"
    elif s[i] == "1" and s[i+1] != "B":
        x += "1"
if s[-1] == "0":
    x += "0"
elif s[-1] == "1":
    x += "1"
print(x)

Submission status: Wrong Answer

Solution code:
s = list(input())
x = len(s)
a = []

for i in range(x):
  if s[i] == '0':
    a.append('0')
  elif s[i] == '1':
    a.append('1')
  elif s[i] == 'B':
    if a == []:
      continue
    else:
      a.remove(a[-1])
b = ''.join(a)
print(b)

Submission status: Wrong Answer

Solution code:
s = list(input())
x = len(s)
a = []

for i in range(x):
  if s[i] == '0':
    a.append('0')
  elif s[i] == '1':
    a.append('1')
  elif s[i] == 'B':
    if a != []:
      a.remove(a[-1])
    else:
      continue
b = ''.join(a)
print(b)

Submission status: Wrong Answer

Solution code:
s = list(input())
x = len(s)
a = []

for i in range(x):
  if s[i] == '0':
    a.append(0)
  elif s[i] == '1':
    a.append(1)
  elif s[i] == 'B':
    if a != []:
      a.remove(a[-1])
    else:
      continue

print(*a)

Submission status: Wrong Answer

Solution code:
s = input()
ans = []
for i in range(len(s)):
    if s[i] == 'B' and ans:
        ans.pop()
    else:
        ans.append(s[i])
print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())
for i in range(len(s)):
    if s[i] == "B":
        s[i] = "\n"
print("".join("".join(s).split()))

Submission status: Wrong Answer

Solution code:
s=input()
data=[]
for i in range(len(s)):
  if s[i]=='0':
    data.append('0')
  elif s[i]=='1':
    data.append('1')
  else:
    if len(data)==0:
      continue
    else:
      data.remove(data[len(data)-1])
print(*data,sep='')

Submission status: Wrong Answer

Solution code:
s = input()
s = s.replace("0B","").replace("1B","")
print(s.replace("B",""))

Submission status: Wrong Answer

Solution code:
a = input()
test = ''
for i in range(len(a)):
  if a[i] == '0':
    test += '0'
  elif a[i] == '1':
    test += '1'
  else:
    if len(a) == 0:
      pass
    else:
      test = test[:-1]

Submission status: Wrong Answer

Solution code:
S = input()

F = []
for ch in S:
  if ch == "B" and len(F) > 0:
    F.pop()
  else:
    F.append(ch)
    
print("".join(F))

Submission status: Wrong Answer

Solution code:
print(input().replace('0B','').replace('1B','').replace('B',''))

Submission status: Wrong Answer

Solution code:
n = input()
s=""
for i in range(len(n)):
    if(n[i]=="B" and s != ""):
        s=s[:-1]
    else:
        s+=n[i]
print(s)

Submission status: Wrong Answer

Solution code:
s = ""
for i in (input()):
  if i in ["0", "1"]:
    s = s + i
  else:
    if len(s) >0:
    	s = s[:-1]

Submission status: Wrong Answer

Solution code:
s = []
for l in raw_input():
	if s == 'B':
		if s:s.pop()
	else:
		s.append(l)
print ''.join(s)

Submission status: Wrong Answer

Solution code:
s = input()
a = ""
for i in a:
  if i == "1" or i == "0":
    a += i
  else:
    if a:
      a = a[:-1]
print(a)

Submission status: Wrong Answer

Solution code:
S=str(input())
ans=""
for i in range(len(S)):
    if S[i]=="B":
        ans=ans[:len(ans)-1]
    else:
        ans+=S[i]
    print(ans)
print(ans)

Submission status: Wrong Answer

Solution code:
S=str(input())
ans=""
for i in range(len(S)):
    if S[i]=="B":
        ans=ans[:i-1]
    else:
        ans+=S[i]
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()

ans=""
for i in range(len(s)):
    if s[i]=="B":
        if len(ans)==0:
            continue
        t=ans[len(ans)-1]
        ans=ans.rstrip(t)
    else:
        ans+=s[i]
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
ans = ""
for i in range(len(S) - 1):
    if S[i] == "0":
        if S[i + 1] == "B":
            continue
        else:
            ans += "0"
    elif S[i] == "1":
        if S[i + 1] == "B":
            continue
        else:
            ans += "1"

if S[-1] != "B":
    ans += S[-1]
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

Z = []
X = len(S)

i = 0
while i  < X :
    if S[i] == "0":
        Z.append(0)
    elif S[i] == "1":
        Z.append(1)
    elif S[i] == "B":
        if len(Z)<= 1:
            pass
        else:
            Z.pop()
    i += 1

i = 0
X = len(Z)
while i < X:
    print(Z[i] , end ="")
    i +=1

Submission status: Wrong Answer

Solution code:
S = input()

Z = []
X = len(S)

i = 0
while i  < X :
    if S[i] == "0":
        Z.insert(0,0)
    elif S[i] == "1":
        Z.insert(0,1)
    elif S[i] == "B":
        if len(Z)<= 1:
            pass
        else:
            Z.pop(0)
    i += 1

i = 0
X = len(Z)
while i < X:
    print(Z[i] , end ="")
    i +=1

Submission status: Wrong Answer

Solution code:
S = input()

Z = []
X = len(S)

i = 0
while i  < X :
    if S[i] == "0":
        Z.insert(0,0)
    elif S[i] == "1":
        Z.insert(0,1)
    elif S[i] == "B":
        if len(Z)== 0:
            pass
        else:
            Z.pop(0)
    i += 1

i = 0
X = len(Z)
while i < X:
    print(Z[i] , end ="")
    i +=1

Submission status: Wrong Answer

Solution code:
s = input()
s = s[::-1]
news = ""
c = 0
for i in range(len(s)):
    if s[i] == "B":
        c += 1
    elif c == 0:
        news += s[i]
    else:
        c = 0
print(news[::-1])

Submission status: Wrong Answer

Solution code:
s = input()
s = s[::-1]
news = ""
c = 0
for i in range(len(s)):
    if s[i] == "B":
        c += 1
    elif c == 0:
        news += s[i]
    else:
        c = 0
print(news)

Submission status: Wrong Answer

Solution code:
s = input()
s=s.replace('0B', '')
s=s.replace('1B', '')
s=s.replace('B', '')
print(s)

Submission status: Wrong Answer

Solution code:
0

Submission status: Wrong Answer

Solution code:
s=input()
ans,skip='',0
for c in reversed(s):
    if c == 'B':
        skip+=1
    elif skip>0:
        skip-=1
    else:
        ans+=c

print(ans)

Submission status: Wrong Answer

Solution code:
S = list(input())
print(S)
S_after = []
for i in S:
    if i == '1':
        S_after.append('1')
    elif i == '0':
        S_after.append('0')
    elif i == 'B':
        if S_after == []:
            pass
        else:
            S_after.pop()
print(''.join(S_after))

Submission status: Wrong Answer

Solution code:
S = list(input())
print(S)
S_after = []
for i in S:
    if i == '1':
        S_after.append(1)
    elif i == '0':
        S_after.append(0)
    elif i == 'B':
        if S_after == []:
            pass
        else:
            S_after.pop()
print(S_after)

Submission status: Wrong Answer

Solution code:
s=str(input())
C= list(s)
list=[]
for I in range(len(C)):
    if I!='B':
        list.append(C[I])
    elif I=='B':
        list.pop()
 
print("".join(list))

Submission status: Wrong Answer

Solution code:
input = input()
output = ""

for i in range(len(input)):
    if input[i] == "0":
        output += "0"
    elif input[i] == "1":
        output += "1"
    elif input[i] == "B":
        if output != "":
            output.rstrip()
        else:
            pass
    else:
        pass

print(output)

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)
ans=[]
for i in range(n-1):
    if s[i]!="B" and s[i+1]!="B":
        ans.append(s[i])
if s[-1]!="B":
    ans.append(s[-1])
print("".join(ans))

Submission status: Wrong Answer

Solution code:
s = input()
out = ""
for i in range(len(s)):
  if s[i] == "B":
    out = out[0:i-1]
  else:
    out = out+s[i]
    
print(out)

Submission status: Wrong Answer

Solution code:
import re
text = input()
b_length = int(re.sub('B', '', text))
for _ in range(b_length):
    text = re.sub('(0|1)??B', '', text, 1)
print(text)

Submission status: Wrong Answer

Solution code:
import re
print(re.sub('(0|1)??B', '', input()))

Submission status: Wrong Answer

Solution code:
import re
print(re.sub('(0|1)B','', input()))

Submission status: Wrong Answer

Solution code:
s = list(input())
n = len(s)

ans = []
for i in range(n):
  if s[i] == 0:
    ans.append('0')
  elif s[i] == 1:
    ans.append('1')
  elif ans == []:
    continue
  else:
    ans.pop()
    
print(''.join(ans))

Submission status: Wrong Answer

Solution code:
def main():
    s=input()
    li=[]
    for i in range(len(s)):
        if(s[i]!='B'):
            li.append(s[i])
        else:
            if(len(li)!=0):
                li.pop()
    for i in range(len(li)):
        print(i,end='')

main()

Submission status: Wrong Answer

Solution code:
s = input()
output_s = ""

for i in s:
  if i == "B" and len( output_s) != 0:
    output_s = output_s[0:len( output_s)-1]
  else:
    output_s += i
    
print(output_s)

Submission status: Wrong Answer

Solution code:
s = input()
ans = ""
for i in range(len(s)):
  if s[i] == 'B' and len(ans) != 0:
    ans = ans[0:len(ans)-1]
  else:
    ans += s[i]
    
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
ans = ""
for i in range(len(s)):
  if s[i] == 'B' and len(ans) != 0:
    ans = ans[0:len(ans)]
  else:
    ans += s[i]
    
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
ans = ""
for i in range(len(s)-1):
  if s[i+1] != 'B':
    ans += s[i]
    
print(ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import re

s = input()
print(re.sub(r"\dB", "", s).replace("B", ""))

Submission status: Wrong Answer

Solution code:
s = list(input())
n = len(s)

ans = [''] * n
for i in range(n):
    if s[i] == '0':
        ans.append('0')
    if s[i] == '1':
        ans.append('1')
    if s[i] == 'B':
        ans[-1] = ''

print("".join(ans))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# B - バイナリハックイージー

s = '01B0'
listAns = []

set1 = ['0', '1']
set2 = ['B']

listS = list(s)

# print(listS)

for i in listS:
    if i in set1:
        listAns.append(i)

    elif i in set2:
        if len(listAns) != 0:
            listAns.pop()

listAns.reverse()
ans = "".join(listAns)

print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# B - バイナリハックイージー

s = '01B0'
listAns = []

set1 = ['0', '1']
set2 = ['B']

listS = list(s)

# print(listS)

for i in listS:
    if i in set1:
        listAns.append(i)

    elif i in set2:
        if len(listAns) != 0:
            listAns.pop()

ans = "".join(listAns)

print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
A=s.replace("0B","").replace("1B","").replace("0B","").replace("1B","").replace("0B","").replace("1B","")
B=A.replace("0B","").replace("1B","").replace("0B","").replace("1B","").replace("0B","").replace("1B","")
C=A.replace("B","")
print(C)

Submission status: Wrong Answer

Solution code:
s=input()
A=s.replace("0B","").replace("1B","").replace("0B","").replace("1B","").replace("0B","").replace("1B","").replace("B","")
print(A)

Submission status: Wrong Answer

Solution code:
s=input()
A=s.replace("0B","").replace("1B","").replace("B","")
print(A)

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)

ans = []

for i in range(n - 1):
    if s[i + 1] != "B" and s[i] != "B":
        ans.append(s[i])
if s[-1] != "B":
    ans.append(s[-1])
print("".join(ans))

Submission status: Wrong Answer

Solution code:
s = str(input())
result = ""


for i in range(len(s)):
    if s[i] == "0":
        result += "0"
    elif s[i] == "1":
        result += "1"
    else:
        if len(result) > 1:
            result = result[0:i-1]
        elif len(result) == 1:
            result = ""

print(result)

Submission status: Wrong Answer

Solution code:
s = str(input())
result = ""


for i in range(len(s)):
    if s[i] == "0":
        result += "0"
    elif s[i] == "1":
        result += "1"
    else:
        if len(result) > 0:
            result = result[0:i-1]

print(result)

Submission status: Wrong Answer

Solution code:
def bs(s):
  if s == "":
    return s
  else:
    return s[:-1]

s = input()
ans = ""
for c in s:
  if c == "b":
    ans = bs(ans)
  else:
    ans += c
print(ans)

Submission status: Wrong Answer

Solution code:
S = input ()
s = []
for i in range (len(S)):
  if S[i] == '0':
    s.append (S[i])
  elif S[i] == '1':
    s.append (S[i])
  elif S[i] == 'B':
    if len(s) != 0:
      s.remove (s[-1])
S = ''.join(list(s))
print (S)

Submission status: Wrong Answer

Solution code:
S = input ()
S = S.replace('0B', '')
S = S.replace('1B', '')
S = S.replace('B', '')
print (S)

Submission status: Wrong Answer

Solution code:
S = input ()
Z = ''.join(list(S))
Z = Z.replace('0B', '')
Z = Z.replace('1B', '')
Z = Z.replace('B', '')
print (Z)

Submission status: Wrong Answer

Solution code:
S = input()
ans = ""
flag = 0
for s in S[::-1]:
  if s == "B":
    flag += 1
    continue
  if flag:
    flag -= 1
    continue
  ans += s
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
from collections import deque
import itertools
import math

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

d = deque()

for i in input():
  if i=="0":
    d.append("0")
  elif i=="1":
    d.append("1")
  elif d:
    d.pop()

while d:
  print(d.pop(),end="")
print()

Submission status: Wrong Answer

Solution code:
t=input()
a=''
for i in range(len(t)):
  if t[i]=='0':
    a += '0'
  if t[i]=='1':
    a += '1'
  if t[i]=='b':
    if len(a) > 0:
      a = a[0:len(a)-1]
print(a)

Submission status: Wrong Answer

Solution code:
t=input()
a=''
for i in range(len(t)):
  if t[i]==0:
    a += '0'
  if t[i]==1:
    a += '1'
  if t[i]=='b':
    if len(a) > 0:
      a = a[0:len(a)-1]
print(a)

Submission status: Wrong Answer

Solution code:
arr = input()
if not 'B' in arr:
    print(arr)
else:
    arr = ''.join(reversed(arr))
    print(''.join(reversed(arr[:arr.index('B')])))

Submission status: Wrong Answer

Solution code:
arr = input()
if not 'B' in arr:
    print(arr)
else:
    arr = ''.join(reversed(arr))
    print(arr[:arr.index('B')])

Submission status: Wrong Answer

Solution code:
s = input()
txt = []

for c in s:
    if c == 'B' and len(txt) > 0:
        txt.pop()
    else:
        txt.append(c)

print(''.join(txt))

Submission status: Wrong Answer

Solution code:
s=list(str(input()))

ans=[]
for i in s:
  if i=='1':
    ans.append('1')
  elif i=='0':
    ans.insert(0,'0')
  else:
    if ans:
      ans.pop(-1)
    else:
      continue

print(''.join(ans))

Submission status: Wrong Answer

Solution code:
def resolve():
    s = input()
    lis = []
    ans = ""
    for i in range(len(s)):
        if s[i] != "B":
            lis.append(s[i])
        elif s[i] == "B" and len(lis) != 0:
            lis.remove(lis[-1])
    for j in range(len(lis)):
        ans += lis[j]
    print(ans)
resolve()

Submission status: Wrong Answer

Solution code:
s=input()
ans=[]
for x in s:
    if x=='B' and len(ans)>0:
        del(ans[len(ans)-1])
    else :
        ans.append(x)
for x in ans:
    print(x,end="")

Submission status: Wrong Answer

Solution code:
s = input()
from collections import deque
d = deque()
for elem in s:
    if elem == '0':
        d.appendleft(elem)
    elif elem == '1':
        d.append(elem)
    elif elem == 'B' and len(d) > 0:
        d.pop()
print(*d, sep='')

Submission status: Wrong Answer

Solution code:
import os, sys, re, math

S = input()

ret = ""
for s in S:
    if s == '0':
        ret = s + ret
    if s == '1':
        ret = ret + s
    if s == 'B':
        ret = ret[:len(ret)-1]

print(ret)

Submission status: Wrong Answer

Solution code:
l = list(input())[::-1]
ans = ''
idx = 0
while idx < len(l):
    cnt = 0
    while idx < len(l) and l[idx] == 'B':
        idx+=1
        cnt += 1
    idx += cnt
    if idx < len(l):
        ans += l[idx]
    idx+=1
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
x=''
for i in s:
    if i=='B':
        if x!='':
            x=x.replace(x[-1],'')
    else:
        x+=i
print(x)

Submission status: Wrong Answer

Solution code:
s = input()
t = ''
for i in s:
    if i == '0':
        t = t + '0'
    elif i == '1':
        t = t + '0'
    else:
        t = t[:-1]
print(t)

Submission status: Wrong Answer

Solution code:
s = input()
now = []
for i in range(len(s)):
    if s[i] == "0":
        now.append("0")
    elif s[i] == "1":
        now.append("1")
    elif s[i] == "B":
        if len(now) == 0:
            continue
        else:
            now.remove(now[-1])
ans = ""
for i in range(len(now)):
    ans += now[i]
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding : utf-8 -*-

S = str(input())

w = ""

if len(S) == 0:
  if S[0] == "B":
    w = ""
  else :
    w = w + S[0]
else:
  if S[0] == "B":
    w = ""
  else :
    w = w + S[0]
    for i in range(1,len(S)):
      if S[i] == "B":
        if w == "":
          w = ""
        else :
          w = w.rstrip(S[i-1])
      else:
        w = w + S[i]

print(w)

Submission status: Wrong Answer

Solution code:
# -*- coding : utf-8 -*-

S = str(input())

w = ""
if S[0] == "B":
  w = ""
else :
  w = w + S[0]

for i in range(1,len(S)):
  if S[i] == "B":
    if w == "":
      w = ""
    else :
      w = w.rstrip(S[i-1])
  else:
    w = w + S[i]

print(w)

Submission status: Wrong Answer

Solution code:
# -*- coding : utf-8 -*-

S = str(input())

w = ""
for i in range(len(S)):
  if S[i] == "B":
    if w == "":
      w = ""
    else :
      w = w.rstrip()
  else:
    w = w + S[i]

print(w)

Submission status: Wrong Answer

Solution code:
from functools import reduce
s = input()

def benri(a, b):
  if b == "0" or b == "1":
    return a+b
  else:
    return a[0:len(a)-1]

print(reduce(benri,s))

Submission status: Wrong Answer

Solution code:
S=input()

result = []
for c in list(S):
   if c == 'B' and len(result)>0:
     result.pop(-1)
   else :
     result.append(c)

print("".join(result))

Submission status: Wrong Answer

Solution code:
a=list(input())
s=''

for i in a:
    if i == '0':
        s=s+'0'
    elif i == '1':
        s=s+'1'
    else:
        s=s[0:a.index(i)-1]
    
print(s)

Submission status: Wrong Answer

Solution code:
s = input()
string = []
for i in range(len(s)):
    print(s[i])
    if s[i] == '0':
        string.append(str(s[i]))
    elif s[i] == '1':
        string.append(str(s[i]))
    else:
        if len(string) == 0:
            continue
        else:
            string.pop(-1)
print("".join(string))

Submission status: Wrong Answer

Solution code:
S = list(str(input()))
for i, s in enumerate(S):
    if s == 'B':
        if i == 0:
            S[0] = ''
        else:
            S[i-1] = ''
            S[i] = ''

print(''.join(S))

Submission status: Wrong Answer

Solution code:
def main():
    import sys
    
    s = sys.stdin.readline()
    
    delete = False
    for i in reversed(range(len(s))):
        if s[i] == "B":
            s = s[:i] + s[i+1:]
            delete = True
        elif delete:
            s = s[:i] + s[i+1:]
            delete = False
    print(s)
        
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
a=list(input())
print(a)
b=[]

for i in a:
    if i=="0":
        b.append(i)
    if i=="1":
        b.append(i)
    if i=="B":
        if b!=[]:
            b.pop(-1)
for j in b:
    print(j,end="")

Submission status: Wrong Answer

Solution code:

s = str(input())
ans = ""
for i in range(len(s)):
    if s[i] == "0":
        ans += "0"
    elif s[i] == "1":
        ans += "1"
    else:
        if len(ans) == 0:
            continue
        else:
            ans = ans[:-1]
print(s)

Submission status: Wrong Answer

Solution code:
S = input()
cha = list(S)
plist = []

for i in cha:
    if plist!=[] and i != "B":   
        if i == "B":
            del plist[-1]
        else:
            plist.append(i)

plist = "".join(plist)

print(plist)

Submission status: Wrong Answer

Solution code:
s=input()
v=list(s)
k=''
for i in range(len(s)):
        if s[i]=='B':
            v[i-1]=9
            v[i]=9
for q in v:
    if q!=9:
        k+=str(q)
print(k)

Submission status: Wrong Answer

Solution code:
s=input()
if s.rfind('0')>s.rfind('1'):
  a='0'
else:
  a='1'
s=s.replace('0B','').replace('1B','').replace('B','')
if s=='':
  print(a)
else:
  print(s)

Submission status: Wrong Answer

Solution code:
s = str(input())

#一旦リストにしちゃう
s_list = list(s)

for i in range(1,len(s_list)):
    if s_list[i] == "B":
        s_list[i-1] = "B"

s_str = "".join(s_list) #リストからstrに戻す

s_ans = s_str.replace("B","")
print(s_ans)

Submission status: Wrong Answer

Solution code:
s=str(input())
s=list(s)
temp=[]
i=0
for i in range(0,len(s)):
  if s[i]=="1":
    temp.insert(0,"1")
  elif s[i]=="0":
    temp.insert(0,"0")
  else:
    if len(temp)!=0:
      del temp[0]

#temp="".join(temp)
print(temp)

Submission status: Wrong Answer

Solution code:
s=str(input())
s=list(s)
temp=[]
i=0
for i in range(0,len(s)):
  if s[i]=="1":
    temp.insert(0,"1")
  elif s[i]=="0":
    temp.insert(0,"0")
  else:
    if len(temp)!=0:
      del temp[0]

temp="".join(temp)
print(temp)

Submission status: Wrong Answer

Solution code:
s = input()

ans = []
for i in s:
    if i == '0':
        ans.append(i)
    elif i == '1':
        ans.append(i)
    elif i == 'B':
        if len(ans) != 0:
            ans.remove(ans[-1])
print("".join(ans))

Submission status: Wrong Answer

Solution code:
str_list=[]
tmp=[]
s=''
str_list=list(input())
for i in str_list:
    if i =='0':
        tmp.append('0')
    elif i == '1':
        tmp.append('1')
    elif i == 'B' and tmp:
        tmp.pop()
for i in range(len(tmp)):
    s+=tmp[i]
print(tmp)
print(s)

Submission status: Wrong Answer

Solution code:
s = input()
ans = ''

for i in s:
    if i == '0' or i == '1':
        ans += i
    else:
        if len(ans) >= 1:
            ans = ans[:-1]
    print(ans)

print(ans)

Submission status: Wrong Answer

Solution code:
from sys import exit
s = input()

ans=""
for i in range(len(s)):
    if s[i] == "0":
        ans = "0" + ans
    elif s[i] == "1":
        ans += "1"
    else:
        if len(ans) != 0 :
            ans = ans[:-1]

print(ans)

Submission status: Wrong Answer

Solution code:
def cin():
	return map(int,input().split())

def cino(test=False):
    if not test:
        return int(input())
    else:
        return input()
def cina():
  return list(map(int,input().split()))

a = cino(True)
a = list(a)
s = []
for i in a:
    if i=='B' and len(s)>0:
        s.pop()
    else:
        s.append(i)

print(''.join(s))

Submission status: Wrong Answer

Solution code:
ans=""
for i in list(input()):
    if ans and i=="B":ans=ans[:-1]
    else:ans=ans+i
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
ans = ""
for k in s:
  if k == 'B':
    if len(s) > 0:
      ans = ans[:len(s)-1]
  else:
    ans += k
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
ans = ''
for si in s:
    if si == 'B' and len(ans) > 0:
        ans = ans[:-1]
    else:
        ans += si
print(ans)

Submission status: Wrong Answer

Solution code:
N=input()
ans=[]
for i in N:
    if i=='B' and not ans==[]:
        ans.pop()
    else:
        ans.append(i)
print(''.join(ans))

Submission status: Wrong Answer

Solution code:
N=input()
ans=[]
for i in N:
    if i=='B' and not ans==[]:
        ans[-1]=''
    else:
        ans.append(i)
print(''.join(ans))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import re
import math
from collections import defaultdict
import itertools
from copy import deepcopy
import random
from heapq import heappop,heappush
import time
import os
import queue
import sys
import datetime
from functools import lru_cache
#@lru_cache(maxsize=None)
readline=sys.stdin.readline
sys.setrecursionlimit(2000000)
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def is_power(a,b):#aはbの累乗数か
    now=b
    while now<a:
        now*=b
    if now==a:return True
    else:return False
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def get_facs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(a,b,c):
    if a:return b
    else:return  c
def join(A,c=""):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n,type_="dict"):
    b = 2
    list_ = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            list_.append(b)
        b+=1
    if n > 1:list_.append(n)
    if type_=="dict":
        dic={}
        for a in list_:
            if a in dic:
                dic[a]+=1
            else:
                dic[a]=1
        return dic
    elif type_=="list":
        return list_
    else:
        return None
def floor_(n,x=1):
    return x*(n//x)
def ceil_(n,x=1):
    return x*((n+x-1)//x)
def hani(x,min_,max_):
    ret=x
    if x<min_:ret=min_
    if x>max_:ret=max_
    return ret
def seifu(x):
    return x//abs(x)
###################################################

def main():
    s=input()
    ans=""
    for a in range(len(s)):
        if s=="B":
            ans=ans[:-1]
        else:
            ans+=s[a]
    print(ans)
main()

Submission status: Wrong Answer

Solution code:
s = input()
word = ""
for i in s:
  if i != "B":
    word += i
  else:
    if word != "":
      word = word.replace(word[-1], "")
    else:
      pass
print(word)

Submission status: Wrong Answer

Solution code:
s = input()
word = ""
for i in s:
  if i != "B":
    word += i
  else:
    if word != "":
      word = word.replace(word[-1], "")
print(word)

Submission status: Wrong Answer

Solution code:
s = input()
word = ""
for i in s:
  if i != "B":
    word += i
  else:
    if word != "":
      word = word.rstrip(word[-1])
    else:
      pass
print(word)

Submission status: Wrong Answer

Solution code:
s = list(input())
word = ""
for i in s:
  if i != "B":
    word += i
  else:
    if word != "":
      word = word.rstrip(word[-1])
    else:
      pass
print(word)

Submission status: Wrong Answer

Solution code:
s = list(input())
word = ""
for i in s:
  if i != "B":
    word += i
  else:
    if word != "":
      word = word.rstrip(word[-1])
print(word)

Submission status: Wrong Answer

Solution code:
import sys
from collections import deque
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7



def main():
    S = readline().decode('utf-8')
    L = len(S)
    d = deque()
    for i in range(L):
        if S[i]=='0':
            d.append(0)
        elif S[i]=='1':
            d.append(1)
        else:
            if len(d)!=0:
                d.pop()
    print(''.join(map(str,d)))



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s=input()
moji=""
for i in range(0,len(s)-1):
  if s[i]=="0" and s[i+1]!="B":
    moji+="0"
  elif s[i]=="1" and s[i+1]!="B":
    moji+="1"
if s[-1]=="0":
  moji+="0"
elif s[-1]=="1":
  moji+="1"
print(moji)

Submission status: Wrong Answer

Solution code:
print(input().replace("1B", "").replace("0B", "").replace("B", ""))
# print(*[s[q] if s[q] != "B" else chr(0x08) for q in range(len(s))], sep="")

Submission status: Wrong Answer

Solution code:
s = input()
print(*[s[q] if s[q] != "B" else chr(0x08) for q in range(len(s))], sep="")

Submission status: Wrong Answer

Solution code:
s = input()
s0 = s.replace("0B","")
s1 = s0.replace("1B","")
ans = s1.replace("B","")
print(ans)

Submission status: Wrong Answer

Solution code:
#! python3
def main():
    s = str(input())
    ans = ""
    r = len(s)
    for i in range(r):
        if s[i] == "0":
            ans += "0"
        elif s[i] == "1":
            ans += "1"
        elif s[i] == "b":
            if ans == "":
                continue

            else:
                ans = ans[:-1]
    print(ans)
main()