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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s602265058 | p04029 | u555962250 | 1542765319 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 43 | N = int(input())
print(int(N * (N + 1) / 2) |
s814938952 | p04029 | u733321071 | 1540751059 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 34 | n = int(input))
print((n + 1)*n/2) |
s744376032 | p04029 | u923279197 | 1540160239 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 39 | print(int(input())*(int(input())+1)//2) |
s236499749 | p04029 | u131405882 | 1540070257 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 40 | N = input()
sum = N*(N+1)/2
print(sum)
|
s644443299 | p04029 | u474270503 | 1538774523 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 28 | N=input()
print(N*(N+1)//2)
|
s079847137 | p04029 | u353919145 | 1538084234 | Python | Python (3.4.3) | py | Runtime Error | 16 | 2940 | 224 | import math
int i
i=input()
sum=(1+n)*n/2
if i!=1:
print(sum)
print("The sum of the integers from 1 to"+i+" is"+sum+".")
else:
print(sum)
print("Only one child. The answer is 1 in this case.") |
s936713777 | p04029 | u353919145 | 1538084153 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 221 | import math
int i
i=input()
sum=(1+n)*n/2
if i!=1:
print(sum)
print("The sum of the integers from 1 to"+i+" is"+sum .)
else:
print(sum)
print("Only one child. The answer is 1 in this case.) |
s062939891 | p04029 | u379702654 | 1537047693 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 64 | def solve(n):
return sum([1..n])
print(solve(int(input())))
|
s186314883 | p04029 | u394482932 | 1536249534 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38640 | 31 | n=int(input());print(n(n+1)//2) |
s385856782 | p04029 | u005260772 | 1533932388 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 41 | print sum(range(1, int(raw_input() + 1))) |
s047670131 | p04029 | u574050882 | 1533168519 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 40 | print(int((N=int(input())) * (N+1) /2))
|
s368821642 | p04029 | u574050882 | 1533168377 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 33 | print((N=int(input()) * (N+1) /2) |
s591423388 | p04029 | u004025573 | 1533007385 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 33 | n=int(input())
print((1+N)*N//2) |
s803616090 | p04029 | u931636178 | 1530887515 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 71 | s = int(input())
if s == 1:
print(1)
else:
print(int((1+s)*n/2))
|
s988964245 | p04029 | u205561862 | 1528813642 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 46 | print(sum([x for i in range(int(input())+1)])) |
s614533807 | p04029 | u205561862 | 1528812613 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 40 | print((lambda x:x* x-~/2)(int(input()))) |
s191741744 | p04029 | u205561862 | 1528812560 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 40 | print((lambda x:x* x-~/2)(int(input()))) |
s996255333 | p04029 | u982517812 | 1528258730 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 90 | # 6月6日
a = int(input())
b = int(input())
c = int(input())
d = (a+b)*c//2
print(d)
|
s123407006 | p04029 | u982517812 | 1528258592 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 90 | # 6月6日
a = int(input())
b = int(input())
c = int(input())
d = (a+b)*c//2
print(d)
|
s825350540 | p04029 | u573970531 | 1524598522 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 87 | inn = int(input())
r = 0
for i in range(1,inn+1):
r += i
print(r) |
s830461346 | p04029 | u127856129 | 1521473130 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 63 | a=int(input())
c==0
while a==0:
c+=a
a-=1
print(int(c))
|
s979944891 | p04029 | u127856129 | 1521473035 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 58 | a=int(input())
while a==0:
c+=a
a-=1
print(int(c))
|
s255190614 | p04029 | u926678805 | 1519925483 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 83 | # coding: utf-8
n=int(input().split())
a=0
for i in range(1,n+1):
a+=i
print(a) |
s344096035 | p04029 | u088543709 | 1518604853 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 34 | n = raw_input()
print (n*(n-1)/2)
|
s056344201 | p04029 | u978494963 | 1517270499 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 66 | n = int(input())
res= 0
if i in range(n)
res += i+1
print(res) |
s138129544 | p04029 | u598016178 | 1505674503 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 30 | print((n=int(input()))*-~n>>1) |
s763318120 | p04029 | u598016178 | 1505672840 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 100 | def fact(n):
if n <= 0:
return 1
return n * fact(n - 1)
n = input()
print(fact(n))
|
s841434625 | p04029 | u364386647 | 1501254047 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 42 | N = int(input())
print(int(N * (N+1) / 2)
|
s512779589 | p04029 | u996252264 | 1500180645 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 183 | def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(input())
def pli(a): return "".join(list(map(str, a)))
n = ri()
print(n(n+1)/2) |
s061652299 | p04029 | u502149531 | 1497855516 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 65 | a = int(input())
b = 1
for i in range(a)
b = b * a
print(b) |
s925535350 | p04029 | u559722042 | 1490085053 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 27 | n=input()
print(n*(n+1)//2) |
s201641570 | p04029 | u524343822 | 1485228718 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 28 | a = input()
print a*(a+1)/2
|
s511477740 | p04029 | u045337404 | 1479513478 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3064 | 54 | N = raw_input('')
x = (int(N) + 1) * int(N)/2
print(x) |
s033010107 | p04029 | u272496669 | 1478548177 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 30 | n = input()
print((n*(n+1))/2) |
s817129562 | p04029 | u971321372 | 1473582306 | Python | PyPy2 (5.6.0) | py | Runtime Error | 64 | 8944 | 158 | n = input()
arr = map(int, raw_input().split())
if n == 1:
print 0
else:
mid = (arr[0] + arr[-1])/2
ans = 0
for e in arr:
ans += (e-mid)**2
print ans
|
s670817237 | p04029 | u816175360 | 1473166726 | Python | Python (3.4.3) | py | Runtime Error | 40 | 3064 | 213 | n=int(input())
s=[int(x) for x in input().split()]
s.sort()
a=s[0]
b=s[-1]
m=9999999999999
for i in range(a,b+1):
sum=0
for j in s:
sum+=(j-i)**2
if sum < m:
m=sum
print(m) |
s654344252 | p04029 | u816175360 | 1473166705 | Python | Python (3.4.3) | py | Runtime Error | 37 | 3064 | 213 | n=int(input())
s=[int(x) for x in input().split()]
s.sort()
a=s[0]
b=s[-1]
m=9999999999999
for i in range(a,b+1):
sum=0
for j in s:
sum+=(j-i)**2
if sum < m:
m=sum
print(m) |
s803951120 | p04029 | u706147596 | 1472418049 | Python | Python (2.7.6) | py | Runtime Error | 27 | 2568 | 372 | N = int(raw_input())
numbers = map(int, raw_input().split())
min_num = min(numbers)
max_num = max(numbers)
min_cost = None
for result in xrange(min_num, max_num+1):
cost = 0
for number in numbers:
cost += (number - result)**2
if min_cost:
if min_cost >= cost:
min_cost = cost
else:
min_cost = cost
print min_cost
|
s720074693 | p04029 | u783939477 | 1472242563 | Python | Python (3.4.3) | py | Runtime Error | 39 | 3064 | 90 | import sys
n = int(sys.stdin().strip())
result = str(int(n * (n + 1) / 2))
sys.stdout() |
s881611124 | p04029 | u542939897 | 1472185689 | Python | Python (2.7.6) | py | Runtime Error | 30 | 2692 | 58 | N=raw_input()
n=0
for i in range(0,N):
n+=i
print n |
s462238362 | p04029 | u438131499 | 1471900658 | Python | Python (2.7.6) | py | Runtime Error | 28 | 2568 | 23 | n=raw_input()
n*(n-1)/2 |
s713074818 | p04029 | u337931720 | 1471689373 | Python | Python (2.7.6) | py | Runtime Error | 26 | 2568 | 164 | raw_input()
a = [int(x) for x in raw_input().split()]
bsc = 1e10
for i in range(-101, 102):
sc = 0
for j in a:
sc += (j-i)**2
bsc = min(bsc, sc)
print bsc |
s660460089 | p04029 | u187430339 | 1471220651 | Python | Python (2.7.6) | py | Runtime Error | 26 | 2568 | 94 | import sys
sys.stdin = open('a_2.txt', 'r')
N = int(raw_input())
print str(((N+1) * N) / 2)
|
s782655476 | p04029 | u751047721 | 1471213445 | Python | Python (3.4.3) | py | Runtime Error | 38 | 3064 | 65 | A = 0
S = input()
fot n in range(1,int(S)+1):
A = A + n
print(A) |
s445181203 | p04029 | u521667517 | 1471209256 | Python | Python (2.7.6) | py | Runtime Error | 26 | 2568 | 65 | # coding: utf-8
import sys
n = int(row_input())
print n*(n+1)/2 |
s722930474 | p04029 | u521667517 | 1471209177 | Python | Python (2.7.6) | py | Runtime Error | 26 | 2568 | 54 | # coding: utf-8
n = int(row_input())
print n*(n+1)/2 |
s788868739 | p04029 | u751047721 | 1471196280 | Python | Python (3.4.3) | py | Runtime Error | 42 | 3064 | 56 | A = 0
S = input()
fot n in range(1,int(S)+1):
A = A + n |
s875454529 | p04029 | u751047721 | 1471196162 | Python | Python (3.4.3) | py | Runtime Error | 38 | 3064 | 56 | A = 0
S = input()
fot n in tange(1,int(S)+1):
A = A + n |
s208468169 | p04029 | u583826716 | 1471139543 | Python | Python (3.4.3) | py | Runtime Error | 37 | 3064 | 35 | N = input()
print(N * (N + 1) / 2)
|
s399175641 | p04029 | u184598095 | 1471138940 | Python | Python (3.4.3) | py | Runtime Error | 1045 | 14556 | 185 | import numpy as np
import math
N = int(input())
a = np.array(list(map(int, input().split())))
c = round(a.mean())
res = int(0)
for i in a:
res += (c - i) ** 2
print(int(res))
|
s673382157 | p04029 | u352021237 | 1471138107 | Python | Python (2.7.6) | py | Runtime Error | 25 | 2568 | 150 | n=int(raw_input())
N=map(int,raw_input().split())
add=0
if sum(N)%n==0:
a=sum(N)/n
else:
a=sum(N)/n +1
for i in N:
add+=(a-i)**2
print add |
s868452444 | p04029 | u352021237 | 1471137477 | Python | Python (2.7.6) | py | Runtime Error | 25 | 2568 | 218 | n=int(raw_input())
N=map(int,raw_input().split())
if len(set(N))==1:
print 0
else:
add=0
if sum(N)%n==0:
a=sum(N)/n
else:
a=sum(N)/n+1
for i in N:
add+=(a-i)**2
print add |
s078269066 | p04029 | u472492255 | 1471137207 | Python | Python (3.4.3) | py | Runtime Error | 37 | 3064 | 57 | # coding: utf-8
n = int(input())
return n * (n + 1) // 2 |
s002884118 | p04029 | u825624694 | 1471136740 | Python | Python (3.4.3) | py | Runtime Error | 38 | 3064 | 65 | a =map(int,input())
s=0
for i in range(a[0]+1):
s+=i
print(s) |
s043491142 | p04029 | u825624694 | 1471136558 | Python | Python (3.4.3) | py | Runtime Error | 38 | 3064 | 62 | a =map(int,input())
s=0
for i in range(a+1):
s+=i
print(s) |
s259448951 | p04029 | u982653403 | 1471136538 | Python | Python (3.4.3) | py | Runtime Error | 37 | 3064 | 30 | print(sum(range(1,input()+1))) |
s642253996 | p04030 | u513211419 | 1601236940 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9072 | 210 | s = input()
ans = ""
for char in s:
if char != 'B':
ans += char
else:
if ans == "":
pass
else:
len = len(ans)
ans = ans[0:len - 1]
print(ans)
|
s253955641 | p04030 | u097700948 | 1600727441 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9088 | 123 | s = input()
S = s.split('B')
for n in range(count):
s_B = s.find('B')
print( s[s_B-1:s_B+1])
s = s[s_B-1:s_B+1] |
s043110082 | p04030 | u758933970 | 1600491837 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9048 | 247 |
opperations = list(input())
display_stack = []
for opperation in opperations:
if opperation == "B":
if display_stack:
display_stack.pop()
else:
display_stack.append(opperation)
print(''.join(display_stack))
ß
|
s258763168 | p04030 | u977605150 | 1600458335 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9044 | 289 | a = list(input())
ans = []
for i in range(len(a)):
if a[i] == '0':
ans.append('0')
elif a[i] == '1':
ans.append('1')
elif a[i] == 'B':
if ans == []:
continue
else:
i -= 1
ans.remove(ans[i])
print(''.join(ans)) |
s521125497 | p04030 | u044378346 | 1600185906 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8940 | 281 | s = input()
ans = ''
for i in range(len(s)):
if s[i] == '0':
ans += '0'
elif s[i] == '1':
ans += '1'
else:
if ans != '':
ans = ans[:-1]
print(ans) |
s833201572 | p04030 | u044378346 | 1600185740 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9048 | 176 | ans = []
a = list(input())
for i in range(len(a)):
if(a[i] == '1'):
ans.append('1')
elif(a[i] == '0'):
ans.append('0')
elif(a[i] == 'B'):
ans.pop()
print(''.join(ans)) |
s268268610 | p04030 | u044378346 | 1600185400 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9012 | 176 | ans = []
a = list(input())
for i in range(len(a)):
if(a[i] == '1'):
ans.append('1')
elif(a[i] == '0'):
ans.append('0')
elif(a[i] == 'B'):
ans.pop()
print(''.join(ans)) |
s458524667 | p04030 | u381585104 | 1600068476 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9044 | 135 | s = input()
st = []
for e in s:
if e == 'B' and len(st) != 0:
st.pop()
else:
st.append(int(e))
print(''.join(map(str,st)))
|
s685878708 | p04030 | u381585104 | 1600068431 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8928 | 132 | s = input()
st = []
for e in s:
if e == B and len(st) != 0:
st.pop()
else:
st.append(int(e))
print(''.join(map(str,st))) |
s662989505 | p04030 | u244836567 | 1599920844 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8956 | 184 | a=input()
b=""
for i in range(len(a)):
if a[i]=="0":
b=b+"0"
if a[i]=="1":
b=b+"1"
if a[i]=="B":
if a[i]!="":
restrip(a)
else:
a=a
print(a)
|
s789988445 | p04030 | u918422508 | 1599812031 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8856 | 202 | s = str(input())
a = []
for i in len(s):
if s[i] == '0':
a.append('0')
elif s[i] == '1':
a.append('1')
else:
if len(a) != 0:
a.pop()
print(''.join(a)) |
s277335616 | p04030 | u863850961 | 1599706354 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9008 | 396 | s=input()
list_s=list(s)
element='B'
l1=['0','1','B']
for i in range(0,len(list_s)-1):
if(list_s[i] == element):
index_element=list_s[i-1]
if(index_element):
list_s.remove(index_element)
list_s.remove(element)
print(list_s)
else:
list_s.append("s")
list_s.remove("s")
else:
list_s.append("s")
list_s.remove("s")
print(list_s)
list_s.remove('B')
print(list_s)
|
s864682047 | p04030 | u863850961 | 1599706326 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8948 | 394 | s=input()
list_s=list(s)
element='B'
l1=['0','1','B']
for i in range(0,len(list_s)):
if(list_s[i] == element):
index_element=list_s[i-1]
if(index_element):
list_s.remove(index_element)
list_s.remove(element)
print(list_s)
else:
list_s.append("s")
list_s.remove("s")
else:
list_s.append("s")
list_s.remove("s")
print(list_s)
list_s.remove('B')
print(list_s)
|
s463805708 | p04030 | u244836567 | 1599700682 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9036 | 180 | a=input()
b=""
for i in range(len(a)):
if a[i]=="0":
b=b+"0"
if a[i]=="1":
b=b+"1"
if a[i]=="B":
if a[i]!="":
restrip(a)
else:
print(a)
|
s022279505 | p04030 | u282813849 | 1599322465 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9104 | 108 | S = input()
F = []
for ch in S:
if ch == "B":
F.pop()
else:
F.append(ch)
print("".join(F)) |
s284166846 | p04030 | u620846115 | 1599226156 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8980 | 125 | n = input()
a = ""
for i in range(n):
if i =="0":
a+=i
elif i =="1":
a+=i
elif i =="B":
a = a[:-1]
print(a) |
s416225691 | p04030 | u620846115 | 1599225721 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9008 | 141 | n = input()
a = []
for i in range(n):
if i =="0":
a.append("0")
elif i =="1":
a.append("1")
elif i =="B":
a.pop()
print(*a) |
s401168327 | p04030 | u620846115 | 1599225672 | Python | Python (3.8.2) | py | Runtime Error | 22 | 9024 | 136 | n = input()
a = ""
for i in range(n):
if i =="0":
a.append(0)
elif i =="1":
a.append(1)
elif i =="B":
a.pop()
print(a) |
s270320037 | p04030 | u786150969 | 1598651436 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9104 | 248 | S = input()
a = ''
count = 0
for s in S:
if s == '0':
a +='0'
if s == '1':
a +='1'
if s == 'B':
if a != '':
a = a.rstrip(a[count-1],1)
if a == '':
continue
count +=1
print(a) |
s639377165 | p04030 | u786150969 | 1598651368 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9036 | 246 | S = input()
a = ''
count = 0
for s in S:
if s == '0':
a +='0'
if s == '1':
a +='1'
if s == 'B':
if a != '':
a = a.rstrip(a[count-1])
if a == '':
continue
count +=1
print(a) |
s280182407 | p04030 | u786150969 | 1598651230 | Python | Python (3.8.2) | py | Runtime Error | 31 | 9292 | 889 | import math
from math import gcd,pi
INF = float("inf")
import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
S = s_input()
a = ''
count = 0
for s in S:
if s == '0':
a +='0'
if s == '1':
a +='1'
if s == 'B':
if a != '':
a = a.rstrip(a[count-1])
if a == '':
continue
count +=1
print(a) |
s807653937 | p04030 | u164776089 | 1598649505 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9084 | 182 | s = str(input())
a = []
for i in s:
if i == '0':
a.append('0')
elif i == '1':
a.append('1')
elif i == 'B':
del a[-1]
print(''.join(a)) |
s000253590 | p04030 | u814886720 | 1597938544 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9060 | 145 | s=[]
a=int(input())
if a==0:
s.append(0)
elif a==1:
s.append(1)
else:
if len(s)>0:
s.pop()
for l in s:
print(l) |
s651677621 | p04030 | u070423038 | 1597886302 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8944 | 122 | r = []
for i in input():
if 'B' == i:
if r:
r.pop()
else:
r.append(i)
print(''.join(r) |
s994289816 | p04030 | u175217658 | 1596747624 | Python | Python (3.8.2) | py | Runtime Error | 30 | 8960 | 197 | S = list(input())
ans = []
for i in range(len(S)):
if(S[i] != 'B'):
ans.append(S[i])
elif(S[i] == 'B' and len(ans) != 0):
ans.remove(ans[i-1])
print(''.join(ans)) |
s707829785 | p04030 | u123107676 | 1596388326 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9880 | 146 | 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) |
s258122402 | p04030 | u123107676 | 1596388232 | Python | Python (3.8.2) | py | Runtime Error | 32 | 9944 | 138 | import re
text = input()
b_length = re.sub('B', '', text)
for _ in range(b_length):
text = re.sub('(0|1)??B', '', text, 1)
print(text) |
s732010133 | p04030 | u259190728 | 1596014054 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9080 | 1590 | from sys import stdin,stdout
import bisect
import math
def st():
return list(stdin.readline().strip())
def inp():
return int(stdin.readline())
def li():
return list(map(int,stdin.readline().split()))
def mp():
return map(int,stdin.readline().split())
def pr(n):
stdout.write(str(n)+"\n")
def soe(limit):
l=[1]*(limit+1)
prime=[]
for i in range(2,limit+1):
if l[i]:
for j in range(i*i,limit+1,i):
l[j]=0
for i in range(2,limit+1):
if l[i]:
prime.append(i)
return prime
def segsoe(low,high):
limit=int(high**0.5)+1
prime=soe(limit)
n=high-low+1
l=[0]*(n+1)
for i in range(len(prime)):
lowlimit=(low//prime[i])*prime[i]
if lowlimit<low:
lowlimit+=prime[i]
if lowlimit==prime[i]:
lowlimit+=prime[i]
for j in range(lowlimit,high+1,prime[i]):
l[j-low]=1
for i in range(low,high+1):
if not l[i-low]:
if i!=1:
print(i)
def gcd(a,b):
while b:
a=a%b
b,a=a,b
return a
def power(a,n):
r=1
while n:
if n&1:
r=(r*a)
a*=a
n=n>>1
return r
def check(n,s):
v=str(n)
for i in v:
if i in s:
return False
return True
def solve():
l=[]
s=input()
for i in s:
if i=='0' or i=='1':
l.append(i)
else:
l.pop()
print(''.join(l))
for _ in range(1):
solve()
|
s858223141 | p04030 | u396211450 | 1596014028 | Python | Python (3.8.2) | py | Runtime Error | 22 | 9100 | 128 | s=input()
l=[]
for i in s:
if i=="0":
l.append("0")
elif i=="1":
l.append("1")
else:
l.pop()
print("".join(l)) |
s039037537 | p04030 | u980503157 | 1595827901 | Python | Python (3.8.2) | py | Runtime Error | 29 | 8956 | 90 | s = input()
for i in range(len(s)-1):
if s[i+1] != 'B':
ans += s[i]
print(ans)
|
s970098787 | p04030 | u980503157 | 1595827849 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8968 | 87 | s = input()
for i in range(len(s)):
if s[i+1] != 'B':
ans += s[i]
print(ans) |
s570145218 | p04030 | u861421280 | 1595492343 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9100 | 204 | k=int(input("enter keys="))
b=" "
length=len(s)
while length <=1 or length<=0:
if k==0 and k==1 and k==b:
print(s)
elif k==0:
print(s=0)
elif k==1:
print(s=1)
else:
print(s=b)
|
s584444201 | p04030 | u801049006 | 1595456151 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9108 | 208 | s = list(input())
n = len(s)
ans = []
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))
|
s381910811 | p04030 | u112065131 | 1595455369 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9060 | 363 | # -*- coding: utf-8 -*-
# B - バイナリハックイージー
s = input()
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 = reduce(lambda x, y: x + y, [str(x) for x in listAns])
print(ans) |
s886225854 | p04030 | u298101891 | 1595376691 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8892 | 313 | lst=[]
res=[]
a=input()
for i in range(len(a)):
lst.append(a[i])
if lst[i] == "0":
res.append(lst[i])
elif lst[i] == "1":
res.append(lst[i])
else:
if res == [] or res[0] == "" :
continue
else:
res.remove(lst[len(res)-1])
print("".join(res))
|
s650832255 | p04030 | u298101891 | 1595376599 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8952 | 304 | lst=[]
res=[]
a=input()
for i in range(len(a)):
lst.append(a[i])
if lst[i] == "0":
res.append(lst[i])
elif lst[i] == "1":
res.append(lst[i])
else:
if res == [] or res[0] == "" :
else:
res.remove(lst[len(res)-1])
print("".join(res)) |
s133999568 | p04030 | u298101891 | 1595376481 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8996 | 289 | lst=[]
res=[]
a=input()
for i in range(len(a)):
lst.append(a[i])
if lst[i] == "0":
res.append(lst[i])
elif lst[i] == "1":
res.append(lst[i])
else:
if res==[]:
pass
else:
res.remove(lst[len(res)-1])
print("".join(res)) |
s691323239 | p04030 | u298101891 | 1595376364 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9044 | 297 | lst=[]
res=[]
a=input()
for i in range(len(a)):
lst.append(a[i])
if lst[i] == "0":
res.append(lst[i])
elif lst[i] == "1":
res.append(lst[i])
else:
if len(res)==0:
continue
else:
res.remove(lst[len(res)-1])
print("".join(res)) |
s820188771 | p04030 | u886907961 | 1594278402 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8952 | 153 | n = input()
s = " "
for i in n:
if i == '0':
s+='0'
elif i=='1':
s+='1'
if i=='B':
s = s.replace(s[-1],'')
print(s)
|
s018223737 | p04030 | u786020649 | 1594245510 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8912 | 126 | s=input()
ans=''
for x in s:
if ans<>'':
if x=='B'
ans=ans[:-1]
continue
if x<>'B':
ans+=x
print(ans) |
s412077970 | p04030 | u520018621 | 1593672332 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8884 | 71 | arr = input()
arr = ''.join(reversed(arr))
print(arr[:arr.index('B')])
|
s327183613 | p04030 | u333591669 | 1593657086 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9148 | 524 | def key():
a=input()
b=input()
c=input()
d=input()
key=[a,b,c,d]
if key[0]=='b':
print('')
elif key[0]=='0':
print('0')
else:
print('1')
if key[1]=='b':
key.pop()
elif key[1]=='0':
print('0')
else:
print('1')
if key[2]=='b':
key.pop()
elif key[2]=='0':
print('0')
else:
print('1')
if key[3]=='b':
key.pop()
elif key[3]=='0':
print('0')
else:
print('1')
key()
|
s529113310 | p04030 | u679817762 | 1593376989 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8884 | 314 | #入力
input = input()
lst = []
text = ''
#操作
for i in range(len(input)):
if input[i] == '0':
text = text + '0'
elif input[i] == '1':
text = text + '1'
elif input[i] = 'B':
if text != '': #文字列が空でないときのみBS実行
text = text[:-1]
#出力
print(text) |
s999855411 | p04030 | u729119068 | 1593269708 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9036 | 119 | s=input()
l=[]
for a in s:
if a=='0':l.append('0')
elif a=='1':l.append('1')
else:l.pop()
print(''.join(l)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.