s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
stringlengths
1
5
memory
stringlengths
1
7
code_size
stringlengths
1
6
code
stringlengths
1
539k
s581762032
p04030
u124063060
1593139548
Python
Python (3.8.2)
py
Runtime Error
124
27304
576
import bisect,collections,copy,heapq,itertools,math,numpy,string from fractions import gcd import sys def I(): return int(sys.stdin.readline().rstrip()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) # tupleも検討する。 def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) def main(): N = S() L = [i for i in N] for i, num in enumerate(L): if(i != 0 and num == "B"): L[i-1] = "" L.remove("B") print("".join(L)) if __name__ == '__main__': main()
s499055399
p04030
u971811058
1593124976
Python
Python (3.8.2)
py
Runtime Error
21
8904
532
#include<bits/stdc++.h> // Begin Header {{{ using namespace std; using ll = long long; using P = pair<ll, ll>; using Graph = vector<vector<ll>>; #define rep(i,n) for(ll i=0; i<n; i++) #define loop(i, j, n) for(ll i=j; i<n; i++) #define all(x) (x).begin(), (x).end() constexpr int INF = 0x3f3f3f3f; const long long mod=1e9+7; const long double PI = acos(-1); // }}} End Header int main() { string s, ans=""; cin >> s; for(auto x : s){ if(x!='B') ans+=x; else if(ans!="") ans.pop_back(); } cout << ans << endl; return 0; }
s507845038
p04030
u697615293
1593092882
Python
Python (3.8.2)
py
Runtime Error
25
8956
262
a = list(input()) b = [] for i,j in enumerate(a): if j == str("0"): b += str("0") elif j == str("1"): b += str("1") elif j == str("B"): if not b: pass else: del b[i-1] print("".join(b))
s332112135
p04030
u697615293
1593092717
Python
Python (3.8.2)
py
Runtime Error
25
8868
273
a = list(input()) b = [] for i,j in enumerate(a): if j == str("0"): b += str("0") elif j == str("1"): b += str("1") elif j == str("B"): if a[0] == str("B"): pass else: del b[i-1] print("".join(b))
s233760654
p04030
u697615293
1593091812
Python
Python (3.8.2)
py
Runtime Error
24
9104
195
a = list(input()) b = [] for i,j in enumerate(a): if j == str("0"): b += str("0") elif j == str("1"): b += str("1") else: del b[i-1] print("".join(b))
s311462571
p04030
u333591669
1593042979
Python
Python (3.8.2)
py
Runtime Error
24
8932
352
def sig(): key=[input()] q a=key[0] if a =='0': key.append('0') elif a=='1': key.append('1') else: key.append('') for i in key: b=key[i] if b =='0': key.append('0') elif b=='1': key.append('1') else: key.pop(i-1) print(key) sig()
s398667105
p04030
u014333473
1592949576
Python
Python (3.8.2)
py
Runtime Error
26
8880
164
s=input() b=False result = [] for i in s: if i=='B': if not b: result.pop() b=True else: b=False result.append(i) print(''.join(result))
s200220653
p04030
u804954217
1592929235
Python
Python (3.8.2)
py
Runtime Error
25
8888
130
s = input() txt = [] for c in s: if c == 'B' && len(txt) > 0: txt.pop() else: txt.append(c) print(''.join(txt))
s925160120
p04030
u804954217
1592929177
Python
Python (3.8.2)
py
Runtime Error
21
9008
131
s = input() txt = [] for c in s: if c == 'B' and len(txt) > 0: txt.pop() elif: txt.append(c) print(''.join(txt))
s497545751
p04030
u804954217
1592929153
Python
Python (3.8.2)
py
Runtime Error
29
8912
129
s = input() txt = [] for c in s: if c == 'B' && len(txt) > 0: txt.pop() elif: txt.append(c) print(''.join(txt))
s307439951
p04030
u344813796
1592875323
Python
Python (3.8.2)
py
Runtime Error
29
9088
194
s=list(str(input())) ans=[] for i in s: if i=='1': ans.append('1') elif i=='0': ans.append(0,'0') else: if ans: ans.pop(-1) else: continue print(''.join(ans))
s441422005
p04030
u344813796
1592875081
Python
Python (3.8.2)
py
Runtime Error
25
9072
155
s=list(str(input())) ans=[] for i in s: if i=='1': ans.append('1') elif i=='0': ans.insert(0,'0') else: ans.pop(-1) print(''.join(ans))
s788790224
p04030
u131881594
1592329695
Python
Python (3.4.3)
py
Runtime Error
17
2940
162
s=input() ans="" for b in s: if b=="1": ans+="1" elif b=="0": ans+="0" else: if len(ans)!=0: ans[-1]="" print(ans)
s214204406
p04030
u124212130
1591970500
Python
Python (3.4.3)
py
Runtime Error
17
2940
115
S = input() ANS = "" for i in range(len(S)): if S[i] == B: ANS = ANS[:-1] else: ANS += S[i] print(ANS)
s920489014
p04030
u350093546
1591753577
Python
PyPy3 (2.4.0)
py
Runtime Error
171
38256
125
s=input() x='' for i in s: if i=='B': if i!='': x=x.replace(x[-1],'') else: x+=i print(x)
s384108778
p04030
u293825440
1591639002
Python
Python (3.4.3)
py
Runtime Error
17
3064
292
moji = [] ans="" s = str(input()) s = list(s) def keyboard(key,list): if key == "0": list.append("0") elif key == "1": list.append("1") elif key == "B": list.pop(-1) for i in range(len(s)): keyboard(s[i],moji) for x in moji: ans += x print(ans)
s824321535
p04030
u757274384
1591334775
Python
Python (3.4.3)
py
Runtime Error
17
2940
184
# -*- 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 + S[i] print(w)
s984379472
p04030
u757274384
1591334718
Python
Python (3.4.3)
py
Runtime Error
17
2940
184
# -*- 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 + S[i] print(w)
s480723066
p04030
u757274384
1591334602
Python
Python (3.4.3)
py
Runtime Error
17
2940
185
# -*- coding : utf-8 -*- S = str(input()) w = "" for i in range(len(S)): if S[i] = "B": if w == "": w = "" else : w.remove(w[-1]) else: w + S[i] print(w)
s868083017
p04030
u757274384
1591334572
Python
Python (3.4.3)
py
Runtime Error
17
2940
184
# -*- coding : utf-8 -*- S = str(input()) w = "" for i in range(len(S)): if S[i] = "B": if w != "": w = "" else : w.remove(w[-1]) else: w + S[i] print(w)
s700664138
p04030
u736474437
1591269746
Python
Python (3.4.3)
py
Runtime Error
17
2940
110
s=input() l=list() for i in str(s): if i == "B": del l[-1] else: l.append(i) a="".join(l) print(a)
s699710177
p04030
u730769327
1591177052
Python
PyPy3 (2.4.0)
py
Runtime Error
163
38512
150
s=input() n=len(s) a=[] b="" for i in range(s): if s[i]=="B": a.pop() else: a.append(s[i]) for i in range(len(a)): b+=a[i] print(b)
s447125101
p04030
u199356004
1591166858
Python
Python (3.4.3)
py
Runtime Error
17
2940
185
S=input() result = [] for c in list(S): if c == 'B' and len(result)>0: result.pop(-1) elif c== 'B': result = "" else : result.append(c) print("".join(result))
s099587670
p04030
u946288218
1590846724
Python
Python (2.7.6)
py
Runtime Error
11
2568
168
a = input() ans = "" for i in range(len(a)): if a[i] == 'B' or (i + 1 < len(a) and a[i + 1] == 'B'): continue else: ans = ans + a[i] print(ans)
s891081221
p04030
u946288218
1590846626
Python
Python (2.7.6)
py
Runtime Error
11
2820
166
a = input() ans = "" for i in range(len(a)): if i + 1 < len(a) and a[i + 1] == 'B' or a[i] == 'B': continue else: ans = ans + a[i] print(ans)
s413356467
p04030
u435721973
1590816114
Python
Python (3.4.3)
py
Runtime Error
18
2940
174
li = list(input()) line = [] for i in li: if i == "0": line.append("0") elif i == "1": line.append("1") else: line.pop(len(line) - 1) print("".join(line))
s123975102
p04030
u552738814
1590555280
Python
Python (3.4.3)
py
Runtime Error
17
3060
397
s = input() s_list = [] input_list = [] for i in range(len(s)): s_list.append(s[i]) for i2 in range(len(s)): if s_list[i2] == "0": input_list.append("0") elif s_list[i2] == "1": input_list.append("1") elif s_list[i2] == "B" and input_list != 0: input_list.pop(-1) else: pass for i3 in range(len(input_list)): print(input_list[i3],end="")
s103555384
p04030
u007886915
1590408611
Python
Python (3.4.3)
py
Runtime Error
158
13624
12066
# -*- coding: utf-8 -*- import sys import fractions import copy import bisect import math import numpy as np import itertools from itertools import combinations_with_replacement #import math#数学的計算はこれでいける。普通に0.5乗しても計算可能 #w=input() from operator import itemgetter from sys import stdin #input = sys.stdin.readline#こっちの方が入力が早いが使える時に使っていこう from operator import mul from functools import reduce from collections import Counter #from collections import deque #input = stdin.readline j=0 k=0 n=3 r=1 a=[0] #n=int(input()) #r=int(input()) #print(M) #A=int(input()) #B=int(input()) #print(N) "1行1つの整数を入力を取得し、整数と取得する" #number_list=list(map(int, input().split(" ")))#数字の時 #print(number_list) "12 21 332 とか入力する時に使う" "1行に複数の整数の入力を取得し、整数として扱う" ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' #メモ for i in number_list:#こっちの方がrage使うより早いらしい print(number_list[i-1])# ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''' x=[] y=[] for i in range(N): x1, y1=[int(i) for i in input().split()] x.append(x1) y.append(y1) print(x) print(y) "複数行に2数値を入力する形式 x座標とy座標を入力するイメージ" ''' ''' mixlist=[] for i in range(N): a,b=input().split() mixlist.append((int(a),b)) print(mixlist) "複数行にintとstrを複合して入力するやつ,今回はリスト一つで処理している" ''' ''' #array=[input().split()for i in range(N)] #print(type(array[0][0])) #print(array) "正方行列にstr型の値を入力" ''' #brray=[list(map(int, input().split(" ")))for i in range(N)] #print(type(brray[0][0])) #print(brray) ''' 入力 1 2 4 5 7 8 出力結果 [[1, 2], [4, 5], [7, 8]] ''' "列数に関して自由度の高いint型の値を入力するタイプの行列" #以下に別解を記載 #N, M = [int(i) for i in input().split()] ''' table = [[int(i) for i in input().split()] for m in range(m)] print(type(N)) print(N) print(type(M)) print(M) print(type(table)) print(table) ''' #s=input() #a=[int(i) for i in s] #print(a[0]) #print([a]) #単数値.桁ごとに分割したい.入力と出力は以下の通り #イメージとして1桁ごとにリストに値を入れているかんじ #intを取ると文字列分解に使える ''' 入力 1234 出力 1 [[1, 2, 3, 4]] ''' ''' word_list= input().split(" ") print(word_list[0]) "連続文字列の入力" "qw er ty とかの入力に使う" "入力すると空白で区切ったところでlistの番号が与えられる" ''' ''' A, B, C=stdin.readline().rstrip().split()#str style 何個でもいけることが多い print(A) "リストではなく独立したstr型を入れるなら以下のやり方でOK" ''' #a= stdin.readline().rstrip() #print(a.upper()) "aという変数に入っているものを大文字にして出力" #a,b=map(int, input().split()) #int style 複数数値入力 「A B」みたいなスペース空いた入力のとき #なんかうまく入力されるけど #a=[[int(i) for i in 1.strip()]for 1 in sys.stdin] #a = [[int(c) for c in l.strip()] for l in sys.stdin]] #print(a) #複数行の数値を入力して正方行列を作成 ############################################################################################## ############################################################################################## #under this line explains example calculation ''' コンビネーションの組み合わせの中身を出力する形式 for i in itertools.combinations(brray, 2) combinationsをpermutationsにすれば順列になる 今回なら(abc133B) 入力 1 2 5 5 -2 8 出力 [[1, 2], [5, 5], [-2, 8]] もちろん一次元リストでも使えるし 何よりiもリストのように使えるので便利 ''' #nCr combination ''' def cmb(n,r): #When n < r , this function isn't valid r= min(n-r,r) #print(n,r) if r == 0: return 1 over = reduce(mul, range(n, n-r, -1)) #flochart mul(n,n-1)=x #next mul(x,n-2)........(n-r+1,n-r) #mul read a,b and returns a*b under = reduce(mul, range(1, r+1)) #print(over, under) #reduce is applied mul(1,2)=2 #next mul(2,3)=6 #next mul(6,4)=4.........last(r!,r+1)=r+1! return over // under #// is integer divide #calc example 5C2 #over=5*4*3 #under=3*2*1 a = cmb(n, r) #print(a) ''' ''' import itertools from itertools import combinations_with_replacement combinationについて 以下の違いを意識しよう combinations() p, r 長さrのタプル列、ソートされた順で重複なし combinations_with_replacement() p, r 長さrのタプル列、ソートされた順で重複あり 使用例             出力   combinations('ABCD', 2)            AB AC AD BC BD CD combinations_with_replacement('ABCD', 2)   AA AB AC AD BB BC BD CC CD DD ''' ''' #集計 #example #a=[2,2,2,3,4,3,1,2,1,3,1,2,1,2,2,1,2,1] #a=Counter(a) for i in a.most_common(n):print(i) #most_common()メソッドは、出現回数が多い要素順にCounterオブジェクトを並び替えます。 #引数にint型の数字nを設定した場合は、出現回数が高い上位n個の要素を返します。 #何も設定しなければ、コンテナ型にあるすべての要素を出現回数の順番に並び替えたタプル型オブジェクトを返します。 #out put #(2, 8) #(1, 6) #(3, 3) #(4, 1) ''' #二部探索(binary search) #A = [1, 2, 3, 3, 3, 4, 4, 6, 6, 6, 6] #print(A) #index = bisect.bisect_left(A, 5) # 7 最も左(前)の挿入箇所が返ってきている #A.insert(index, 5) #print(index) #print(A) ''' bisect.bisect_left(a, x, lo=0, h=len(a)) 引数 a: ソート済みリスト x: 挿入したい値 lo: 探索範囲の下限 hi: 探索範囲の上限 (lo, hiはスライスと同様の指定方法) bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。 ''' ''' 素数の判定 ''' def is_prime(n): if n == 1: return False for k in range(2, int(np.sqrt(n)) + 1): #sqrt(n)+1以上は考えて約数はないので却下 if n % k == 0: return False #割り切れたらFalse return True ''' npのmaxとmaximumの違い xs = np.array([1, -2, 3]) np.max(xs, 0) この出力は3となります.[1, -2, 3]と0の4つの数字のうち,最も大きい値を出力します. 一方で,[max(1, 0), max(-2, 0), max(3, 0)]を出力したい時があります. その時は,numpyのmaximum関数を用います. xs = np.array([1, -2, 3]) np.maximum(xs, 0) # [1, 0, 3] ''' def factorial(x, mod=10**9+7): # x! # 階乗 # ex) factorial(5) = 120 tmp = 1 for i in range(1, x+1): tmp = (tmp * i) % mod return tmp ''' Basically, when you do a**d % n, you actually have to calculate a**d, which could be quite large. But there are ways of computing a**d % n without having to compute a**d itself, and that is what pow does. ''' ######################################################################## ######################################################################## #b2=a[:] #1次元のときはコピーはこれで良い #print(b2) #a= [[0]*3 for i in range(5)] #2次元配列はこう準備、[[0]*3]*5だとだめ #b3=copy.deepcopy(a) #2次元配列はこうコピーする #print(b3) ''' ascii_letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz' ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' digits = '0123456789' hexdigits = '0123456789abcdefABCDEF' letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv...\xaf\xb0... lowercase = 'abcdefghijklmnopqrstuvwxyz' octdigits = '01234567' printable = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU... punctuation = '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~' uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' whitespace = '\t\n\x0b\x0c\r ' ''' ''' 引数endに任意の文字列を指定すると、その文字列が改行の代わりに最後に挿入される。例えば連続するprint()の出力を改行なしで単純に連結したい場合は空文字列''を指定すればよい。 print('abc', end='---') print('xyz') # abc---xyz print('abc', end='') print('xyz') # abcxyz source: print_basic.py なお、デフォルトで改行されるのは引数endのデフォルト値が改行文字'\n'に設定されているから。 ''' def main(): n=3 steps=0 state=0 w=1 j=0 k=0 #lenを変数に置くと事故るから注意 #n=int(input()) #a,b=input().split(" ")#a,bがともに文字列のとき #a,b=map(int, input().split(" ")) #mapでとってもstrで変換すればappend可能 s=input() a=[i for i in s]#int(i)にすれば数字も行ける n=len(s) c=[] for i in range(n): if a[i]=="0": c.append("0") elif a[i]=="1": c.append("1") elif a[i]==("B"): del c[-1] #d=str(c) #print(c) #print("".join(d)) print("".join(c)) #nl=list(map(int, input().split(" ")))#数字の時 #print(a) #brray=[list(map(int, input().split(" ")))for i in range(N)] #print(brray) #for i in range(1,n+1,2):#これで1個飛ばしループになる # pass #print(i) l = ['aaa', 'bbb', 'ccc'] x=l.index('aaa')#ある要素のインデックス番号を取得 #s = ''.join(l) #s = " ".join(map(str,a))#スペースを空ける時はこう #print(s) # aaabbbccc #if state in known_states and not flag: # state => 2 steps => 5 #こうやってある要素がリストの中にあるか探すのか #print(f'steps: {steps}, state: {state}') #こう書いてあるとデバックしやすい #dp= [[0]*3 for i in range(5)]#列 行 #dp用の0の入ったやつ #dp= [[0]*(w+1) for i in range(n+1)]#0からwまでのw+1回計算するから #print(dp)#初期条件が入る分計算回数+1列分必要(この場合は判断すべきものの数) DP = np.zeros(w+1, dtype=int)#これでも一次元リストが作れる exdp=np.zeros((3,4)) # 3×4の2次元配列を生成。2次元ならこう #dtypeは指定しないとfloatになる #for i in range(n):#ちょっとした入力に便利 # a, b = map(int, input().split()) #dp[i][0] += [a] #これだとintとlistをつなぐことになって不適 # dp[i] += [a] # dp[i] += [b] #これはうまくいく #やり方はいろいろあるということ #print(dp) #brray=[list(map(int, input().split(" ")))for i in range(N) #print(brray) ''' 入力 1234 出力 [1, 2, 3, 4] ''' pin_l=["x" for i in range(10)]#内包表記に慣れろ #print(pin_l) ls = ["a", "b", "c", "d", "e"] #print(ls[2:5]) #スライスでの取得 #print(ls[:-3]) #一番左端から右から3番目より左まで取得 #print(ls[:4:2]) #スライスで1個飛ばしで取得 #ないときは左端スタート #始点のインデックス番号 : 終点のインデックス番号 : スキップする数+1 #print(ls[::2]) ''' lsというリストの場合に、1つ飛びの値を取得したい場合には ls[::2] のようにします。こうすると、 ["a", "c", "d"]と出力される ''' if __name__ == "__main__": main()
s124344774
p04030
u604655161
1590285874
Python
Python (3.4.3)
py
Runtime Error
17
3060
345
def ABC_43_B(): s = input() t=[] for i in range(len(s)): if s[i] == '0': t.append('0') elif s[i] == '1': t.append('1') else: if len(t)==0: a=0 else: del t[i-1] print(''.join(t)) if __name__ == '__main__': ABC_43_B()
s699486403
p04030
u564004296
1589993558
Python
Python (3.4.3)
py
Runtime Error
23
3316
543
import collections #文字列を一文字ずつ取得したいとき def inputStrOnebyOne(): s = list(input()) return s #整数を一つずつリストに入れる def inputOnebyOne_Int(): a = list(int(x) for x in input().split()) return a def main(): s = inputStrOnebyOne() ret = [] for i in range(len(s)): if s[i] == "0": ret.append(s[i]) elif s[i] == "1": ret.append(s[i]) else: ret.pop() print(''.join(ret)) if __name__=='__main__': main()
s695384180
p04030
u679089074
1589742277
Python
Python (3.4.3)
py
Runtime Error
17
2940
162
S = input() cha = list(S) plist = [] for i in cha: if i == "B": del plist[-1] else: plist.append(i) plist = "".join(plist) print(plist)
s822794341
p04030
u379142263
1589300593
Python
Python (3.4.3)
py
Runtime Error
21
3316
380
import sys import itertools sys.setrecursionlimit(1000000000) from heapq import heapify,heappop,heappush,heappushpop import math import collections MOD = 10**9+7 s = input() q = [""] for i in range(len(s)): if s[i] == "0": q.append(0) elif s[i] == "1": q.append(1) else: q.pop() ans = "" for i in range(len(q)): ans += str(q[i]) print(ans)
s409927590
p04030
u379142263
1589300486
Python
Python (3.4.3)
py
Runtime Error
21
3316
378
import sys import itertools sys.setrecursionlimit(1000000000) from heapq import heapify,heappop,heappush,heappushpop import math import collections MOD = 10**9+7 s = input() q = [] for i in range(len(s)): if s[i] == "0": q.append(0) elif s[i] == "1": q.append(1) else: q.pop() ans = "" for i in range(len(q)): ans += str(q[i]) print(ans)
s975411891
p04030
u702686470
1588987806
Python
Python (3.4.3)
py
Runtime Error
17
2940
201
s = input() l = len(s) t=[] for i in range(l): c = s[i] if c=='B': if len(t)==0: continue else: t.remove(t[len-1]) else: t.append(c) print(t)
s980921055
p04030
u702686470
1588987722
Python
Python (3.4.3)
py
Runtime Error
17
2940
199
s = input() l = len(s) t=[] for i in range(l): c = s[i] if c=='B': if len(t)==0: continue else: t.remove(t[i-1]) else: t.append(c) print(t)
s899083878
p04030
u444722572
1588783000
Python
Python (3.4.3)
py
Runtime Error
21
3316
265
from collections import deque s=deque(list(input())) p=deque() for i in range(len(s)): w=s.popleft() if w=="0": p.append("0") elif w=="1": p.append("1") else: p.pop() for i in range(len(p)): print(p[i],end="")
s235877141
p04030
u453055089
1588752968
Python
Python (3.4.3)
py
Runtime Error
17
3064
246
s = input() ans = [] dp = [""]*(len(s)) if s[0] != "B": dp[0] = s[0] else: dp[0] = [""] for i in range(len(s)-1): if s[i+1] != "B": dp[i+1] = dp[i] + s[i+1] else: dp[i+1] = dp[i][:len(dp[i])-1] print(dp[len(s)-1])
s336667181
p04030
u453055089
1588752884
Python
Python (3.4.3)
py
Runtime Error
17
3064
272
s = input() ans = [] dp = [""]*(len(s)) if s[0] != "B": dp[0] = s[0] else: dp[0] = [""] #print(dp) for i in range(len(s)-1): if s[i+1] != "B": dp[i+1] = dp[i] + s[i+1] else: dp[i+1] = dp[i][:len(dp[i])-1] #print(dp) print(dp[len(s)-1])
s727381922
p04030
u453055089
1588752855
Python
PyPy3 (2.4.0)
py
Runtime Error
164
38384
272
s = input() ans = [] dp = [""]*(len(s)) if s[0] != "B": dp[0] = s[0] else: dp[0] = [""] #print(dp) for i in range(len(s)-1): if s[i+1] != "B": dp[i+1] = dp[i] + s[i+1] else: dp[i+1] = dp[i][:len(dp[i])-1] #print(dp) print(dp[len(s)-1])
s624509866
p04030
u453055089
1588752717
Python
PyPy3 (2.4.0)
py
Runtime Error
169
38256
262
s = input() ans = [] dp = [""]*(len(s)) if s[0] != "B": dp[0] = s[0] else: dp[0] = [""] #print(dp) for i in range(len(s)-1): if s[i+1] != "B": dp[i+1] = dp[i] + s[i+1] else: dp[i+1] = dp[i][:-1] #print(dp) print(dp[len(s)-1])
s855816043
p04030
u453055089
1588752110
Python
PyPy3 (2.4.0)
py
Runtime Error
169
38384
400
s = input() ans = [] dp = [""]*(len(s)) if s[0] != "B": dp[0] = s[0] else: dp[0] = [""] #print(dp) for i in range(len(s)-1): if s[i+1] != "B": if dp[i] != "": dp[i+1] = dp[i] + s[i+1] else: dp[i+1] = s[i+1] else: if dp[i] != "": dp[i+1] = dp[i][:-1] else: dp[i+1] = "" #print(dp) print(dp[len(s)-1])
s808062606
p04030
u453055089
1588751720
Python
PyPy3 (2.4.0)
py
Runtime Error
164
38384
395
s = input() ans = [] dp = [-1]*(len(s)) if s[0] != "B": dp[0] = s[0] else: dp[0] = [-1] #print(dp) for i in range(len(s)-1): if s[i+1] != "B": if dp[i] != -1: dp[i+1] = dp[i] + s[i+1] else: dp[i+1] = s[i+1] else: if dp[i] != -1 and i-1 >= 0: dp[i+1] = dp[i-1] else: dp[i+1] = -1 print(dp[len(s)-1])
s105602692
p04030
u586206420
1588511403
Python
Python (3.4.3)
py
Runtime Error
17
3064
342
s=list(input()) t=["3","3","3","3","3","3","3","3","3","3"] m=0 for i in range(0, len(s)): if s[i]=="B": if m > 0: t[m-1]="3" m=m-1 if s[i]=="0": t[m]="0" m=m+1 if s[i]=="1": t[m]="1" m=m+1 p=list() q=0 while t[q]!="3": p.append(t[q]) q=q+1 print("".join(p))
s772540671
p04030
u586206420
1588443920
Python
Python (3.4.3)
py
Runtime Error
17
3064
335
s=list(input()) t=["3","3","3","3","3","3","3","3","3","3"] m=0 for i in range(0, len(s)): if s[i]=="B": if m > 0: t[m-1]="3" m=m-1 if s[i]=="0": t[m]="0" m=m+1 if s[i]=="1": t[m]="1" m=m+1 p=list() q=0 while t[q]!="3": p.append(t[q]) q=q+1 "".join(p)
s802046465
p04030
u586206420
1588443850
Python
Python (3.4.3)
py
Runtime Error
17
3064
340
s=list(input()) t=["3","3","3","3","3","3","3","3","3","3"] m=0 for i in range(0, len(s)): if s[i]=="B": if m > 0: t[m-1]="3" m=m-1 if s[i]=="0": t[m]="0" m=m+1 if s[i]=="1": t[m]="1" m=m+1 p=list() q=0 while t[q]!="3": p.append(t[q]) q=q+1 int("".join(p))
s228810795
p04030
u103178403
1588123193
Python
Python (3.4.3)
py
Runtime Error
1955
3692
131
a=input() b=a.index while "B" in a: if a.startswith("B"): a=a[1::] elif "B" in a: a=a[0:b("B")-1]+a[b("B")+1:] print(a)
s865401619
p04030
u308918401
1587939169
Python
Python (3.4.3)
py
Runtime Error
17
2940
139
a=input() ans="" while len(a)>0: if a[0]=="0": ans+="0" elif a[0]=="1": ans+="1" elif len(ans)>0: ans=ans[,-1] print(ans)
s348225577
p04030
u642418876
1587684333
Python
Python (3.4.3)
py
Runtime Error
17
3060
200
s=str(input()) ans=[] for i in range(len(s)): if s[i]=='0': ans.append('0') elif s[i]=='1': ans.append('1') else: if i==0: pass else: del ans[i-1] print(''.join(ans))
s437707067
p04030
u798260206
1587658472
Python
Python (3.4.3)
py
Runtime Error
17
2940
233
s = list(input()) answer = [] for i range s: if i == "B": try: answer.pop() except IndexError: pass else: answer.append(i) print(" ".join(answer))
s758689985
p04030
u798260206
1587658386
Python
Python (3.4.3)
py
Runtime Error
17
2940
222
s = list(input()) answer = [] for i range s: if i == "B": try: answer.pop() except: pass else: answer.append(i) print(" ".join(answer))
s218233778
p04030
u798260206
1587658361
Python
Python (3.4.3)
py
Runtime Error
17
2940
221
s = list(input()) answer = [] for i range s: if i == "B": try: answer.pop() except: pass else: answer.append(i) print("".join(answer))
s609039707
p04030
u798260206
1587658319
Python
Python (3.4.3)
py
Runtime Error
17
2940
212
s = list(input()) answer = [] for i range s: if i == "B": try: answer.pop() except: pass else: answer.append(i) print(answer)
s613609604
p04030
u239653493
1587437369
Python
Python (3.4.3)
py
Runtime Error
17
2940
127
x=int(input()) if x>=2000: print(1) else: if (x//100)*100<=x<=(x//100)*105: print(1) else: print(0)
s731865692
p04030
u239772565
1587433040
Python
Python (3.4.3)
py
Runtime Error
21
3316
172
s = input() from collections import deque dq = deque() for i in range(len(s)): if s[i] == "B": dq.pop() continue dq.append(s[i]) print("".join(dq))
s394567094
p04030
u141419468
1587349427
Python
Python (3.4.3)
py
Runtime Error
17
2940
50
s = input() n = s.index('B') s.pop(n-1) print(s)
s211954281
p04030
u578854679
1587216226
Python
PyPy3 (2.4.0)
py
Runtime Error
176
38512
119
s = input() ans = [] for _ in s: if _ == 'B': ans.pop() else: ans.append(_) print(*ans, sep='')
s234235220
p04030
u848667447
1587009533
Python
Python (3.4.3)
py
Runtime Error
17
3060
208
s = input() a = [] for i in range(len(s)): if s[i] == '0': a.append('0') elif s[i] == '1': a.append('1') elif s[i] == 'B': a.pop(-1) result = ''.join(a) print(result)
s117416982
p04030
u566321790
1586979877
Python
Python (3.4.3)
py
Runtime Error
17
3060
169
n = str(input()) ans = '' for i in range(len(n)): if n[i] == 'B': ans = ans[-1] elif n[i] == '0': ans += '0' elif n[i] == '1': ans += '1' print(ans)
s690805666
p04030
u849229491
1586880242
Python
Python (3.4.3)
py
Runtime Error
17
2940
127
s = list(input()) ans = [] for i in s: if i == 'B': ans.pop() else: ans.append(i) print("".join(ans))
s620901823
p04030
u057993957
1586669001
Python
Python (3.4.3)
py
Runtime Error
17
2940
126
s = list(input()) hoge = [] for si in s: if si != "B": hoge.append(si) else: hoge.pop() print("".join(hoge))
s058453867
p04030
u687135117
1586477101
Python
Python (3.4.3)
py
Runtime Error
17
3064
388
S=list(input()) D=[] for i in range (1,len(S)): if S[i]=="B": del S[i-1] S.append("A") for i in range (1,len(S)-1): if S[i]=="B": del S[i] S.append("A") for i in range (0,abs(len(S)-2)): while S[i]=="B": S.remove("B") for i in range (0,len(S)): if S[i]=="0" or S[i]=="1": D.append(S[i]) D=''.join(D) print(D)
s958225582
p04030
u687135117
1586477050
Python
Python (3.4.3)
py
Runtime Error
17
2940
278
for i in range (1,len(S)-1): if S[i]=="B": del S[i] S.append("A") for i in range (0,abs(len(S)-2)): while S[i]=="B": S.remove("B") for i in range (0,len(S)): if S[i]=="0" or S[i]=="1": D.append(S[i]) D=''.join(D) print(D)
s231938646
p04030
u687135117
1586476502
Python
Python (3.4.3)
py
Runtime Error
17
3064
406
S=list(input()) D=[] for i in range (1,len(S)-1): if S[i]=="B": del S[i-1] S.append("A") for i in range (1,len(S)-1): if S[i]=="B": del S[i] S.append("A") for i in range (0,abs(len(S)-2)): while S[i]=="B": S.remove("B") for i in range (0,len(S)): if S[i]=="0" or S[i]=="1": D.append(S[i]) D=''.join(D) print(D)
s695714158
p04030
u440161695
1586447006
Python
Python (3.4.3)
py
Runtime Error
21
3316
163
from collections import deque s=deque(input()) A=deque() for i in range(len(s)): a=s.popleft() if a=="B": A.pop() else: A.append(a) print("".join(A))
s424368773
p04030
u870841038
1586281607
Python
Python (3.4.3)
py
Runtime Error
17
2940
183
s = input() ans = [] x = 0 for c in s: if c == '0' or c == '1': ans.append(c) else: if len(ans) != 0: del ans[x-1] x += 1 print(''.join(ans))
s157279097
p04030
u257541375
1586222750
Python
Python (3.4.3)
py
Runtime Error
17
2940
154
s=input() length = len(s) ary = [] for i in length: if s[i] != "B": ary.append(s[i]) elif len(ary) != 0: ary.pop(-1) print("".join(ary))
s158114466
p04030
u870297120
1585946624
Python
Python (3.4.3)
py
Runtime Error
17
2940
120
ans = [] for i in input(): if (i == '1' or i == '0'): ans.append(i) if i == 'B': ans.pop() print(''.join(ans))
s024585220
p04030
u080986047
1585941173
Python
Python (3.4.3)
py
Runtime Error
18
2940
208
li = input() li2 =[] for n in li: if n == "0": li2.append("0") elif n == "1": li2.append("1") elif n == "B": if not len.li2 == 0: li2.pop() print("".join(li2))
s086119367
p04030
u080986047
1585940985
Python
Python (3.4.3)
py
Runtime Error
17
2940
174
li = input() li2 =[] for n in li: if n == "0": li2.append("0") elif n == "1": li2.append("1") elif n == "B": li2.pop() print("".join(li2))
s700725808
p04030
u218838821
1585794589
Python
Python (3.4.3)
py
Runtime Error
16
3060
202
s = list(map(str,input())) ans = [] for i in range(len(s)): if s[i] == '0': ans.append('0') elif s[i] == '1': ans.append('1') else: ans.pop(-1) print(''.join(ans))
s142879936
p04030
u787449825
1585517322
Python
Python (3.4.3)
py
Runtime Error
16
2940
133
key = input() s = [] for i in key: if i == '0' or if i == '1': s.append(i) else: if len(s) > 0: s.pop(-1) print(s)
s086265600
p04030
u787449825
1585517278
Python
Python (3.4.3)
py
Runtime Error
17
2940
127
key = input() s = [] for i in key: if i == '0' or i == '1': s.append(i) else: len(s) > 0: s.pop(-1) print(s)
s950654944
p04030
u787449825
1585517231
Python
Python (3.4.3)
py
Runtime Error
17
2940
130
key = input() s = [] for i in key: if i == '0' or if i == '1': s.append(i) else: len(s) > 0: s.pop(-1) print(s)
s940690009
p04030
u395816772
1585436592
Python
Python (3.4.3)
py
Runtime Error
17
2940
185
s = list(input()) a = s.count('B') b = [] for i in range(len(s)): if s[i] == 'B': b.append(i) b.sort(reverse=True) for i in b: s.pop(i) s.pop(i-1) print(''.join(s))
s966172246
p04030
u203339404
1585167746
Python
Python (3.4.3)
py
Runtime Error
17
2940
105
s = input() counter = 0 moji = "" for i in s: if i == "B": moji[:-1] continue else: moji+ i
s931457697
p04030
u836737505
1585136449
Python
Python (3.4.3)
py
Runtime Error
20
3316
146
from collections import deque s = input() a = deque() for i in s: if i == "B": a.pop() else: a.append(i) print(''.join(a))
s677356090
p04030
u789205676
1585111706
Python
Python (3.4.3)
py
Runtime Error
17
2940
163
s = [i for i in input()] for i in s: if i == 'B': s.remove(i) s.remove(tmp) tmp = i if s[0] == 'B': s.remove('B') print(''.join(s))
s252855963
p04030
u789205676
1585111317
Python
Python (3.4.3)
py
Runtime Error
17
2940
163
s = [i for i in input()] for i in s: if i == 'B': s.remove(i) s.remove(tmp) tmp = i if s[0] == 'B': s.remove('B') print("".join(s))
s912090933
p04030
u789205676
1585111257
Python
Python (3.4.3)
py
Runtime Error
17
2940
163
s = [i for i in input()] for i in s: if i == 'B': s.remove(i) s.remove(tmp) tmp = i if s[0] == 'B': s.remove('B') print("".join(s))
s872085490
p04030
u789205676
1585110672
Python
Python (3.4.3)
py
Runtime Error
17
2940
163
s = [i for i in input()] for i in s: if i == 'B': s.remove(i) s.remove(tmp) tmp = i if s[0] == 'B': s.remove('B') print("".join(s))
s314961851
p04030
u789205676
1585110475
Python
Python (3.4.3)
py
Runtime Error
17
2940
164
s = [i for i in input()] for i in s: if i == 'B': s.remove(i) s.remove(tmp) tmp = i if s[0] == 'B': s.remove('B') print("".join(s))
s824789567
p04030
u288430479
1584456449
Python
Python (3.4.3)
py
Runtime Error
17
3060
185
s=list(input()) print(s) l=len(s) data =[] for i in s: if i=="0": data.append(0) elif i=="1": data.append(1) else: if data!=[]: del data[-1] print("".join(data))
s280865469
p04030
u223663729
1584310952
Python
Python (3.4.3)
py
Runtime Error
17
2940
110
s = input() ans = '' for i in s: if i == 'B': ans = ans[:-1] else ans += i print(ans)
s345866781
p04030
u163874353
1584120659
Python
Python (3.4.3)
py
Runtime Error
17
3060
244
s = input() l =[] for i in range(len(s)): if s[i] == "0": l.append("0") elif s[i] == "1": l.append("1") elif s[i] =="B": if len(l) == 0: pass else: del l[i - 1] print("".join(l))
s574023769
p04030
u066855390
1583984879
Python
Python (3.4.3)
py
Runtime Error
18
2940
188
S = list(input()) stack = [] stack.append(S.pop(0)) for s in S: if s == "B": if len(stack) > 0: stack.pop() else: stack.append(s) print("".join(stack)
s880790252
p04030
u000123984
1583785669
Python
Python (3.4.3)
py
Runtime Error
19
2940
129
li = list(str(input())) for i in range(li): if(li[i] == "B" and not i == 0): li[i-1] = "" li[i] = "" print("".join(li))
s058230295
p04030
u000123984
1583785566
Python
Python (3.4.3)
py
Runtime Error
17
2940
127
li = list(str(input())) for i in len(li): if(li[i] == "B" and not i == 0): li[i-1] = "" li[i] = "" print("".join(li))
s431012253
p04030
u000123984
1583785429
Python
Python (3.4.3)
py
Runtime Error
18
2940
133
li = list(map(str, input())) for i in len(li): if(not i == 0 and li[i] == "B"): li[i-1] = "" li[i] = "" print("".join(li))
s872442529
p04030
u000123984
1583785363
Python
Python (3.4.3)
py
Runtime Error
17
2940
123
li = list(input()) for i in len(li): if(not i == 0 and li[i] == "B"): li[i-1] = "" li[i] = "" print("".join(li))
s162389110
p04030
u000123984
1583284487
Python
Python (3.4.3)
py
Runtime Error
17
3064
158
li = list(input()) for i in range(len(li)): if li[i]=="B": li[i-1]=="" else: for j in len(li): if li[j]=="B": li[j]=="" else: print("".join(li))
s145609061
p04030
u263824932
1583268814
Python
Python (3.4.3)
py
Runtime Error
17
3060
297
S=input() words=[*S] answers=[] for n in words: if n=='1': answers.append('1') elif n=='0': answers.append('0') else: if not answers: continue else: answers.pop() mojiretu='' for x in answers: mojiretu+=x print(int(mojiretu))
s771896720
p04030
u263824932
1583268697
Python
Python (3.4.3)
py
Runtime Error
17
2940
293
S=input() words=[*S] answers=[] for n in words: if n=='1': answers.append('1') elif n=='0': answers.append('0') else: if not answers: continue else: answers.pop() mojiretu='' for x in answers: mojiretu+=x print(mojiretu)
s547576064
p04030
u263824932
1583268654
Python
Python (3.4.3)
py
Runtime Error
17
2940
293
S=input() words=[*S] answers=[] for n in words: if n=='1': answers.append('1') elif n=='0': answers.append('0') else: if not answers: continue else: answers.pop() mojiretu='' for x in answers: mojiretu+=x print(mojiretu)
s926390952
p04030
u693933222
1582692745
Python
Python (3.4.3)
py
Runtime Error
17
3064
149
s = list(input()) ans = [] for i in s: if(i == "B"): ans.pop(-1) else: ans+=i for i in ans: print(i, end="") print("")
s022553983
p04030
u223663729
1582683770
Python
Python (3.4.3)
py
Runtime Error
17
2940
143
s = str(input()).split('') text = '' for i in s: if i == 'B' and len(text) > 0: text = text[:-1] else: text += i print(text)
s237488937
p04030
u208309047
1582404246
Python
Python (3.4.3)
py
Runtime Error
17
2940
170
C = [] A = input() for i in A: if i == '0': C.append(i) if i == '1': C.append(i) if i == 'B' and len(C)!=0: C.pop() print("".join(C)
s199928425
p04030
u208309047
1582325794
Python
Python (3.4.3)
py
Runtime Error
17
2940
147
C = [] A = input() for i in A: if i == '0': C.append(i) if i == '1': C.append(i) if i == 'B': C.pop() print(C)
s550281507
p04030
u408375121
1582247841
Python
Python (3.4.3)
py
Runtime Error
17
2940
133
s = input() l = [] for t in s: if t == '0' or t == '1': l.append(t) elif t == 'B': l.pop() for r in l: print(r, end='')
s490815413
p04030
u408375121
1582247225
Python
Python (3.4.3)
py
Runtime Error
17
2940
120
s = input() c = '' for t in s: if t == '0' or t == '1': c += t if t == 'B' and c != '': c -= c[-1] print(c)
s648084683
p04030
u408375121
1582246751
Python
Python (3.4.3)
py
Runtime Error
17
2940
140
s = input() c = '' for t in s: if t == '0' or t == '1': c += t elif t == 'B': if c != '': k = c[-1] c -= k print(c)