s_id string | p_id string | u_id string | date string | language string | original_language string | filename_ext string | status string | cpu_time string | memory string | code_size string | code string | error string | stdout string |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s788804239 | p02422 | u535719732 | 1559305647 | Python | Python3 | py | Runtime Error | 0 | 0 | 573 | def op_print(data,a,b):
for i in range(a,b):
print(data[i-1],end="")
print()
def op_reverse(data,a,b):
return data[:a] + data[::-1][-b:-a] + data[:b]
def op_replace(data,a,b,q):
return data.replace(data[a:b],q)
data = input()
q = int(input())
for _ in range(q):
op = list(map(str,input().sp... | Traceback (most recent call last):
File "/tmp/tmp7ba0aco5/tmp8fdx85h5.py", line 10, in <module>
data = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s440629748 | p02422 | u535719732 | 1559305990 | Python | Python3 | py | Runtime Error | 0 | 0 | 540 | def op_print(data,a,b):
print(data[a:b])
def op_reverse(data,a,b):
return data[:a] + data[::-1][-b:-a] + data[:b]
def op_replace(data,a,b,q):
return data.replace(data[a:b],q)
data = input()
q = int(input())
for _ in range(q):
op = list(map(str,input().split()))
op[2] += 1
if(op[0] == "print"):... | Traceback (most recent call last):
File "/tmp/tmp1vnx17ee/tmpouftba2c.py", line 8, in <module>
data = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s893017225 | p02422 | u535719732 | 1559306224 | Python | Python3 | py | Runtime Error | 0 | 0 | 535 | def op_print(data,a,b):
print(data[a:b])
def op_reverse(data,a,b):
return data[:a] + data[::-1][-b:-a] + data[:b]
def op_replace(data,a,b,q):
return data.replace(data[a:b],q)
data = input()
q = int(input())
for _ in range(q):
op = list(map(str,input().split()));num[2]+=1
if(op[0] == "print"):
... | Traceback (most recent call last):
File "/tmp/tmp40b_ggvl/tmpzz6sxwoo.py", line 8, in <module>
data = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s676700896 | p02422 | u535719732 | 1559306239 | Python | Python3 | py | Runtime Error | 0 | 0 | 534 | def op_print(data,a,b):
print(data[a:b])
def op_reverse(data,a,b):
return data[:a] + data[::-1][-b:-a] + data[:b]
def op_replace(data,a,b,q):
return data.replace(data[a:b],q)
data = input()
q = int(input())
for _ in range(q):
op = list(map(str,input().split()));op[2]+=1
if(op[0] == "print"):
... | Traceback (most recent call last):
File "/tmp/tmpylwmzdvu/tmp5huvykp7.py", line 8, in <module>
data = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s626546546 | p02422 | u535719732 | 1559306248 | Python | Python3 | py | Runtime Error | 0 | 0 | 538 | def op_print(data,a,b):
print(data[a:b])
def op_reverse(data,a,b):
return data[:a] + data[::-1][-b:-a] + data[:b]
def op_replace(data,a,b,q):
return data.replace(data[a:b],q)
data = input()
q = int(input())
for _ in range(q):
op = list(map(str,input().split()))
op[2]+=1
if(op[0] == "print"):
... | Traceback (most recent call last):
File "/tmp/tmp905ci9w7/tmpv_kk8bu_.py", line 8, in <module>
data = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s670634844 | p02422 | u535719732 | 1559306689 | Python | Python3 | py | Runtime Error | 0 | 0 | 336 | data = input()
q = int(input())
for _ in range(q):
op = list(map(str,input().split()))
a = int(op[1])
b = int(op[2]) + 1
if(op[0] == "print"):
print(data[a:b])
elif(op[0] == "reverse"):
data = data[:a] + data[a:b][::-1] + data[:b]
elif(op[0] == "replace"):
data = data[:a]... | Traceback (most recent call last):
File "/tmp/tmps13zjut3/tmp2gmo6dyl.py", line 1, in <module>
data = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s273429263 | p02422 | u140201022 | 1413129244 | Python | Python | py | Runtime Error | 0 | 0 | 286 | n=input()
l=['print','replace','reverse']
for i in range(n):
c=map(str,raw_input().split())
if c[0]==l[0]:
print w[int(c[1]):int(c[2])+1]
elif c[0]==l[1]:
w=w[:int(c[1])]+c[3]+w[int(c[2])+1:]
else:
w=w[int(c[1]):int(c[2])+1][::-1]+w[int(c[2])+1:] | File "/tmp/tmpsf2ht6hm/tmpm03hpy_b.py", line 6
print w[int(c[1]):int(c[2])+1]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s336216822 | p02422 | u297342993 | 1423530991 | Python | Python3 | py | Runtime Error | 30 | 6720 | 357 | text = input()
count = int(input())
for c in range(count):
args = input().split()
(a, b) = [int(x) for x in args[1:3]]
if args[0] == 'print':
print(text[a:b + 1])
elif args[0] == 'reverse':
text = text[0:a] + text[a:b + 1][::-1] + text[b + 1:]
elif args[0] == 'replace':
tex... | Traceback (most recent call last):
File "/tmp/tmpk5qfkov6/tmpn9667op2.py", line 1, in <module>
text = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s202621659 | p02422 | u370429022 | 1426265445 | Python | Python3 | py | Runtime Error | 0 | 0 | 371 | if __name__ == '__main__':
s = input()
q = int(input())
for i in range(q):
code = input().split()
op, a, b = code[0], int(code[1]), int(code[2])
if op == 'print':
print(s[a:b+1])
elif op == 'reverse':
s = s[:a] + s[a:b+1][::-1] + s[b+1:]
elif o... | Traceback (most recent call last):
File "/tmp/tmpjjolwr03/tmprpem734g.py", line 2, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s301177104 | p02422 | u633068244 | 1433156268 | Python | Python | py | Runtime Error | 0 | 0 | 324 | s = list(raw_input())
for loop in xrange(input()):
c = raw_input().split()
if c[0] == "replace":
s[int(c[1]): int(c[2]) + 1] = list(c[3])
if c[0] == "reverse":
s[int(c[1]): int(c[2]) + 1] = s[int(c[1]): int(c[2) + 1][::-1]
if c[0] == "print":
print "".join(s[int(c[1]): int(c[2]) ... | File "/tmp/tmp0y55sh9x/tmppz0992qh.py", line 7
s[int(c[1]): int(c[2]) + 1] = s[int(c[1]): int(c[2) + 1][::-1]
^
SyntaxError: closing parenthesis ')' does not match opening parenthesis '['
| |
s638052655 | p02422 | u811841526 | 1449087291 | Python | Python3 | py | Runtime Error | 0 | 0 | 340 | s = input()
n = int(input())
for _ in range(n):
line = input().split()
command, args = line[0], line[1:]
if command == 'replace':
s = s[:args[0]] + args[2] + s[args[1]:]
elif command == 'reverse':
s = s[:args[0]] + str(reversed(s[args[0]:args[1]])) + s[args[1]:]
elif command == 'prin... | Traceback (most recent call last):
File "/tmp/tmp8rdav447/tmpngg3cb8e.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s384896347 | p02422 | u971748390 | 1454306684 | Python | Python3 | py | Runtime Error | 0 | 0 | 328 | snt=input()
num=int(input())
for i in range(num):
ops=input().split()
if ops[0]=="replace":
snt[int(ops[1]):int(ops[2])]=ops[3]
elif ops[0]=="print":
snt=snt[int(ops[1]):int(ops[2])]
elif ops[0]=="reverse":
snt[int(ops[1]):int(ops[2])]=snt[int(ops[1]):int(ops[2])].reverse
pr... | File "/tmp/tmpwdvvyxwm/tmp3xpbx99m.py", line 1
snt=input()
IndentationError: unexpected indent
| |
s852249733 | p02422 | u971748390 | 1454307042 | Python | Python3 | py | Runtime Error | 0 | 0 | 336 | snt=input()
num=int(input())
for i in range(num):
ops=input().split()
if ops[0]=="replace":
snt[int(ops[1]):int(ops[2])+1]=ops[3]
elif ops[0]=="print":
snt=snt[int(ops[1]):int(ops[2])+1]
elif ops[0]=="reverse":
snt[int(ops[1]):int(ops[2])+1]=snt[int(ops[1]):int(ops[2])+1].revers... | File "/tmp/tmphn0zd79x/tmpzwjkogdc.py", line 1
snt=input()
IndentationError: unexpected indent
| |
s309329064 | p02422 | u971748390 | 1454307191 | Python | Python3 | py | Runtime Error | 0 | 0 | 353 | snt=input()
num=int(input())
for i in range(num):
ops=input().split()
if ops[0]=="replace":
snt[int(ops[1]):int(ops[2])+1]=ops[3]
elif ops[0]=="print":
snt=snt[int(ops[1]):int(ops[2])+1]
print(snt)
elif ops[0]=="reverse":
snt[int(ops[1]):int(ops[2])+1]=snt[int(ops[1]):int(... | File "/tmp/tmpuhr4eqii/tmpv9hl0sax.py", line 1
snt=input()
IndentationError: unexpected indent
| |
s858832534 | p02422 | u971748390 | 1454307740 | Python | Python3 | py | Runtime Error | 0 | 0 | 324 | snt=input()
num=int(input())
for i in range(num):
ops=input().split()
if ops[0]=="replace":
snt[int(ops[1]):int(ops[2])+1]=ops[3]
elif ops[0]=="print":
snt=snt[int(ops[1]):int(ops[2])+1]
print(snt)
elif ops[0]=="reverse":
snt[int(ops[1]):int(ops[2])+1].reverse()
print(... | File "/tmp/tmp52rmf65k/tmp_fw2z0ya.py", line 1
snt=input()
IndentationError: unexpected indent
| |
s274950959 | p02422 | u971748390 | 1454307782 | Python | Python3 | py | Runtime Error | 0 | 0 | 309 | snt=input()
num=int(input())
for i in range(num):
ops=input().split()
if ops[0]=="replace":
snt[int(ops[1]):int(ops[2])+1]=ops[3]
elif ops[0]=="print":
snt=snt[int(ops[1]):int(ops[2])+1]
print(snt)
elif ops[0]=="reverse":
snt[int(ops[1]):int(ops[2])+1].reverse() | File "/tmp/tmp8mcz01bf/tmpsyslohvh.py", line 1
snt=input()
IndentationError: unexpected indent
| |
s773145068 | p02422 | u971748390 | 1454311388 | Python | Python3 | py | Runtime Error | 0 | 0 | 363 | snt=input()
num=int(input())
for i in range(num):
ops=input().split()
if ops[0]=="replace":
snt=snt.replace(snt[int(ops[1]):int(ops[2])+1],ops[3])
elif ops[0]=="print":
snt=snt[int(ops[1]):int(ops[2])+1]
print(snt)
elif ops[0]=="reverse":
snt=snt[:int(ops[1])]+ snt[int(ops[1]):i... | File "/tmp/tmpl7p1m4f3/tmpxzm222mo.py", line 1
snt=input()
IndentationError: unexpected indent
| |
s521708364 | p02422 | u017764209 | 1454885226 | Python | Python | py | Runtime Error | 0 | 0 | 414 | str = raw_input()
q = input()
for ans in range(q):
ans = raw_input()
ans1 = ans.split(' ')
if ans1[0] == 'replace':
str = str[0:int(ans1[1])]+ans1[3]+ str[int(ans1[2])+1:len(str)]
if ans1[0] == 'reverse':
str = str[0:int(ans1[1])]+ans1[3]+str[int(ans1[1]):int(ans1[2])+1][::-1] + str[int(... | File "/tmp/tmpo2nb_lkf/tmp10n5f93s.py", line 11
print str[int(ans1[1]):int(ans1[2])+1]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s260985768 | p02422 | u017764209 | 1454885324 | Python | Python | py | Runtime Error | 0 | 0 | 415 | str = raw_input()
q = input()
for ans in range(q):
ans = raw_input()
ans1 = ans.split(' ')
if ans1[0] == 'replace':
str = str[0:int(ans1[1])]+ans1[3]+ str[int(ans1[2])+1:len(str)]
if ans1[0] == 'reverse':
str = str[0:int(ans1[1])]+ans1[3]+ str[int(ans1[1]):int(ans1[2])+1][::-1] + str[int... | File "/tmp/tmpqj5koco0/tmpbxl_wakn.py", line 11
print str[int(ans1[1]):int(ans1[2])+1]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s979846724 | p02422 | u075836834 | 1457881594 | Python | Python3 | py | Runtime Error | 0 | 0 | 329 | string = input()
n = int(input())
for i in range(n):
command = input().split()
c_n = command[0]
c_i1 = command[1]
c_i2 = command[2]
if c_n =='print':
print(string[c_i1:c_i2])
elif c_n =='revese':
string = string[:c_i1]+string[c_i1:c_i2][::-1]+string[c_i2:]
else:
string = string[:c_i1] + command[3] + strin... | Traceback (most recent call last):
File "/tmp/tmp93cy5o5r/tmps_o3zke_.py", line 1, in <module>
string = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s838882652 | p02422 | u130979865 | 1459646943 | Python | Python | py | Runtime Error | 10 | 6360 | 447 | # -*- coding: utf-8 -*-
s = str(raw_input())
q = int(raw_input())
for i in range(q):
line = map(str, raw_input().split())
com = line[0]
a = int(line[1])
b = int(line[2])
if com == "print":
print s[a:b+1]
elif com == "reverse":
len = len(s)
s = s[0:a] + s[-len+b:-len+a-1:... | File "/tmp/tmp3x4ingk8/tmpmsu3emzr.py", line 11
print s[a:b+1]
^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s562654789 | p02422 | u100813820 | 1463715947 | Python | Python3 | py | Runtime Error | 0 | 0 | 1532 | # 21-String-Transformation.py
# ???????????????
# ????????? str ?????????????????????????????????????????????????????????????????°????????????????????????????????????
# ???????????\?????????????????????????????§??????
# print a b: str ??? a ??????????????? b ??????????????§??????????????????
# reverse a b: str ??? a ... | Traceback (most recent call last):
File "/tmp/tmp_8kw4_ka/tmpwltm3p4x.py", line 46, in <module>
str = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s825524065 | p02422 | u100813820 | 1463715967 | Python | Python3 | py | Runtime Error | 0 | 0 | 1544 | # 21-String-Transformation.py
# ???????????????
# ????????? str ?????????????????????????????????????????????????????????????????°????????????????????????????????????
# ???????????\?????????????????????????????§??????
# print a b: str ??? a ??????????????? b ??????????????§??????????????????
# reverse a b: str ??? a ... | Traceback (most recent call last):
File "/tmp/tmpx946x1gz/tmpu71jj0cp.py", line 46, in <module>
str = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s428859926 | p02422 | u100813820 | 1463715980 | Python | Python3 | py | Runtime Error | 0 | 0 | 1552 | # 21-String-Transformation.py
# ???????????????
# ????????? str ?????????????????????????????????????????????????????????????????°????????????????????????????????????
# ???????????\?????????????????????????????§??????
# print a b: str ??? a ??????????????? b ??????????????§??????????????????
# reverse a b: str ??? a ... | Traceback (most recent call last):
File "/tmp/tmp6vzthc_8/tmp252b9da1.py", line 46, in <module>
str = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s449455895 | p02422 | u100813820 | 1463715991 | Python | Python3 | py | Runtime Error | 0 | 0 | 1556 | # 21-String-Transformation.py
# ???????????????
# ????????? str ?????????????????????????????????????????????????????????????????°????????????????????????????????????
# ???????????\?????????????????????????????§??????
# print a b: str ??? a ??????????????? b ??????????????§??????????????????
# reverse a b: str ??? a ... | File "/tmp/tmpchaq6e82/tmpar7mwdba.py", line 57
# print(str[a:b+1])
IndentationError: expected an indented block after 'while' statement on line 45
| |
s470997916 | p02422 | u100813820 | 1463717118 | Python | Python3 | py | Runtime Error | 0 | 0 | 1561 | # 21-String-Transformation.py
# ???????????????
# ????????? str ?????????????????????????????????????????????????????????????????°????????????????????????????????????
# ???????????\?????????????????????????????§??????
# print a b: str ??? a ??????????????? b ??????????????§??????????????????
# reverse a b: str ??? a ... | File "/tmp/tmp5mdixuga/tmpfse1pati.py", line 57
else op[0]=="print":
^^
SyntaxError: expected ':'
| |
s404855896 | p02422 | u239721772 | 1463729654 | Python | Python3 | py | Runtime Error | 30 | 7596 | 828 | string = list(input())
times = int(input())
for i in range(times):
order = input().split()
if order[0] == "replace":
replace_string = order[3]
count = 0
for j in range(int(order[1]), int(order[2]) + 1):
string[j] = replace_string[count]
count += 1
#pri... | Traceback (most recent call last):
File "/tmp/tmphlp4l_72/tmpgvp0mv1b.py", line 1, in <module>
string = list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s927070549 | p02422 | u239721772 | 1463731557 | Python | Python3 | py | Runtime Error | 50 | 7600 | 1046 | string = list(input())
times = int(input())
#a = [int(i) for i in range(0,5)]
#print(a)
for i in range(times):
order = input().split()
#print(order)
if order[0] == "replace":
replace_string = order[3]
#print(string)
count = 0
for j in range(int(order[1]), int(order[2]) + 1):
... | Traceback (most recent call last):
File "/tmp/tmp15zjvm2u/tmp8mtr07dh.py", line 1, in <module>
string = list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s357195170 | p02422 | u239721772 | 1463732717 | Python | Python3 | py | Runtime Error | 20 | 7688 | 1046 | string = list(input())
times = int(input())
#a = [int(i) for i in range(0,5)]
#print(a)
for i in range(times):
order = input().split()
#print(order)
if order[0] == "replace":
replace_string = order[3]
#print(string)
count = 0
for j in range(int(order[1]), int(order[2]) + 1):
... | Traceback (most recent call last):
File "/tmp/tmp3yqehn95/tmphayfcioj.py", line 1, in <module>
string = list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s083419865 | p02422 | u617990214 | 1466249425 | Python | Python | py | Runtime Error | 0 | 0 | 237 | round=int(input())
T_pt=0
H_pt=0
for i in range(round):
pair=raw_input().split(" ")
T_card=pair[0].lower()
H_card=pair[1].lower()
if T_card<H_card:
H_pt+=3
elif T_card>H_card:
T_pt+=3
else:
T_pt+=1
H_pt+=1
print T_pt,H_pt | File "/tmp/tmpmm3nnr4u/tmpapujzwow.py", line 17
print T_pt,H_pt
^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s751499616 | p02422 | u617990214 | 1466249434 | Python | Python | py | Runtime Error | 0 | 0 | 237 | round=int(input())
T_pt=0
H_pt=0
for i in range(round):
pair=raw_input().split(" ")
T_card=pair[0].lower()
H_card=pair[1].lower()
if T_card<H_card:
H_pt+=3
elif T_card>H_card:
T_pt+=3
else:
T_pt+=1
H_pt+=1
print T_pt,H_pt | File "/tmp/tmpbvmrsuto/tmpulttit4g.py", line 17
print T_pt,H_pt
^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s437927531 | p02422 | u131984977 | 1470293521 | Python | Python3 | py | Runtime Error | 0 | 0 | 328 | s = input()
q = int(input())
for qi in range(q):
command = input().split()
a = command[1]
b = command[2]
if command[0] == 'print':
print(s[a:b + 1])
elif command[0] == 'reverse':
s = s[:a] + reversed(s[a:b + 1]) + s[b + 1:]
else:
p = command[3]
s = s[:a] + p + s... | Traceback (most recent call last):
File "/tmp/tmp7xwvf5ak/tmpjrkskuv8.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s573462031 | p02422 | u204883389 | 1470294382 | Python | Python3 | py | Runtime Error | 0 | 0 | 344 | s = input()
q = int(input())
for pi in range(q):
command = input().split()
a = int(command[1])
b = int(command[2])
if command[0] == 'print':
print(s[a:b + 1])
elif command[0] == 'reverse':
s = s[:a] + reversed(s[a:b + 1][::-1]) + s[b + 1:]
else:
p = command[3]
s ... | Traceback (most recent call last):
File "/tmp/tmppwhax5i1/tmpkecmdfra.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s949376673 | p02422 | u204883389 | 1470294432 | Python | Python3 | py | Runtime Error | 0 | 0 | 358 | s = input()
q = int(input())
for pi in range(q):
command = input().split()
a = int(command[1])
b = int(command[2])
if command[0] == 'print':
print(s[a:b + 1])
elif command[0] == 'reverse':
s = s[:a] + reversed(s[a:b + 1][::-1]) + s[b + 1:]
else:
p = command[3] == 'replac... | File "/tmp/tmpcwu3a_ym/tmpmy1varx9.py", line 13
p = command[3] == 'replace':
^
SyntaxError: invalid syntax
| |
s852218957 | p02422 | u204883389 | 1470294489 | Python | Python3 | py | Runtime Error | 0 | 0 | 354 | s = input()
q = int(input())
for pi in range(q):
command = input().split()
a = int(command[1])
b = int(command[2])
if command[0] == 'print':
print(s[a:b + 1])
elif command[0] == 'reverse':
s = s[:a] + reversed(s[a:b + 1][::-1]) + s[b + 1:]
else:
command[3] == 'replace':
... | File "/tmp/tmp3cn7sfbs/tmp7aasyi7y.py", line 13
command[3] == 'replace':
^
SyntaxError: invalid syntax
| |
s535219171 | p02422 | u204883389 | 1470294534 | Python | Python3 | py | Runtime Error | 0 | 0 | 354 | s = input()
q = int(input())
for pi in range(q):
command = input().split()
a = int(command[1])
b = int(command[2])
if command[0] == 'print':
print(s[a:b + 1])
elif command[0] == 'reverse':
s = s[:a] + reversed(s[a:b + 1][::-1]) + s[b + 1:]
else:
command[3] == 'replace':
... | File "/tmp/tmpy6t334pb/tmps7_lges5.py", line 13
command[3] == 'replace':
^
SyntaxError: invalid syntax
| |
s714555305 | p02422 | u498041957 | 1470294590 | Python | Python3 | py | Runtime Error | 0 | 0 | 108 | s = input()
for i in range(int(input())):
cmd = input().split()
s = s[:a] + cmd[3] + s[b+1:] | File "/tmp/tmpylqk79jk/tmp2yxlvd5o.py", line 5
s = s[:a] + cmd[3] + s[b+1:]
IndentationError: unexpected indent
| |
s956769833 | p02422 | u600195957 | 1470294600 | Python | Python3 | py | Runtime Error | 0 | 0 | 328 | s = input()
q = input()
for qi in range(q):
command = input().split()
a = int(command[1])
b = int(command[2])
if command[0] == 'print':
print(s[a:b + 1])
elif command[0] == 'reverse':
s = s[:a] + s[a:b + 1][::-1] + s[b + 1:]
else:
p = command[3]
s = s[:a] + p + s... | Traceback (most recent call last):
File "/tmp/tmp372dmjvg/tmpfobnrp1g.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s469092615 | p02422 | u628732336 | 1470716776 | Python | Python3 | py | Runtime Error | 0 | 0 | 336 | s = input()
q = int(input())
for qi in range(q):
command = input().split()
a = int(command[1])
b = int(command[2])
if command[0] == 'print':
print(s[a:b + 1])
elif command[1] == 'reverse':
s = s[:a] + reversed(s[a:b + 1]) + s[b + 1:]
else:
p = command[3]
s = s[:... | Traceback (most recent call last):
File "/tmp/tmppd07dj6n/tmpj5p_lxdj.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s265370058 | p02422 | u628732336 | 1470716838 | Python | Python3 | py | Runtime Error | 0 | 0 | 332 | s = input()
q = int(input())
for qi in range(q):
command = input().split()
a = int(command[1])
b = int(command[2])
if command[0] == 'print':
print(s[a:b + 1])
elif command[1] == 'reverse':
s = s[:a] + s[a:b + 1][::-1] + s[b + 1:]
else:
p = command[3]
s = s[:a] +... | Traceback (most recent call last):
File "/tmp/tmpcmskbe9d/tmpaoyj2jw2.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s293913572 | p02422 | u979507074 | 1476283967 | Python | Python | py | Runtime Error | 0 | 0 | 333 | s = raw_input()
n = int(raw_input())
for i in range(n):
message = raw_input().split(" ")
a, b = int(message[1]), int(message[2])
if message[0] == "print":
print(s[a:b+1])
elif message[0] == "reverse":
s[a:b+1] = s[a:b+1][::-1]
elif message[0] == "replace":
s = s[:a] + messa... | Traceback (most recent call last):
File "/tmp/tmpapfb2tcf/tmp6ce4kkvk.py", line 1, in <module>
s = raw_input()
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s230732569 | p02422 | u801346721 | 1478431981 | Python | Python3 | py | Runtime Error | 0 | 0 | 272 | s = input()
n = int(input())
for i in range(n):
a = list(input().split())
temp = s[int(a[1])+1:int(a[2])+2]
if a[0] == 'replace':
s.replace(temp, a[3])
elif a[0] == 'reverse':
s.replace(temp, temp[::-1])
elif a[0] == 'print':
print(s[int(a[1])+1:int(a[2])+2)
| File "/tmp/tmpvj7rm4rm/tmpoql_b48n.py", line 11
print(s[int(a[1])+1:int(a[2])+2)
^
SyntaxError: closing parenthesis ')' does not match opening parenthesis '['
| |
s378441131 | p02422 | u801346721 | 1478432040 | Python | Python3 | py | Runtime Error | 0 | 0 | 284 | s = input()
n = int(input())
for i in range(n):
a = list(input().split())
temp = s[int(a[1])-1:int(a[2])]
if a[0] == 'replace':
s.replace(temp, a[3])
elif a[0] == 'reverse':
temp2 = temp[::-1]
s.replace(temp, temp2)
elif a[0] == 'print':
print(s[int(a[1])-1:int(a[2]))
| File "/tmp/tmpr9vmorg9/tmpnq0qc_6h.py", line 12
print(s[int(a[1])-1:int(a[2]))
^
SyntaxError: closing parenthesis ')' does not match opening parenthesis '['
| |
s706970586 | p02422 | u801346721 | 1478433342 | Python | Python3 | py | Runtime Error | 0 | 0 | 364 | s = input()
n = int(input())
for i in range(n):
a = list(input().split())
temp = s[int(a[1]):int(a[2])+1]
if a[0] == 'replace':
temp3 = a[3]
s = list(s)
seq = 0
for i in range(int(a[1]), int(a[2])+1):
s[i] = temp3[seq]
seq += 1
elif a[0] == 'reverse':
temp2 = temp[::-1]
s = s.replace(temp, temp2, ... | Traceback (most recent call last):
File "/tmp/tmp_jw6iwa6/tmpiodcfik_.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s906274952 | p02422 | u854978981 | 1480463439 | Python | Python3 | py | Runtime Error | 20 | 7676 | 628 | string = input()
q = int(input())
for c in range(0,q):
instruction = input().split(' ')
if instruction[0] == 'print':
print(string[int(instruction[1]):int(instruction[2]) + 1])
elif instruction[0] == 'reverse':
string = string.replace(string[int(instruction[1]):int(instruction[2])+1], string... | Traceback (most recent call last):
File "/tmp/tmpa1yi1v5n/tmpjjbs1lt2.py", line 1, in <module>
string = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s096443455 | p02422 | u854978981 | 1480463487 | Python | Python3 | py | Runtime Error | 20 | 7652 | 633 | string = input()
q = int(input())
for c in range(0,q):
instruction = input().split(' ')
if instruction[0] == 'print':
print(string[int(instruction[1]):int(instruction[2]) + 1])
elif instruction[0] == 'reverse':
string = string.replace(string[int(instruction[1]):int(instruction[2])+1], string... | Traceback (most recent call last):
File "/tmp/tmpjgp4nrdc/tmpviazgktc.py", line 1, in <module>
string = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s269816955 | p02422 | u656368260 | 1481979757 | Python | Python | py | Runtime Error | 0 | 0 | 314 | s=input()
for _ in range(int(input())):
a=input().split()
i,j=map(int, a[1:3])
if a[0] == "print":
print(s[i:j+1])
elif a[0] == "reverse":
t1=s[0:i]
t2=list(s[i:j+1])
t2.reverse()
t3=s[j+1:]
s=t1+"".join(t2)+t3
else:
s=s[0:i]+a[3]+s[j+1:] | Traceback (most recent call last):
File "/tmp/tmpoiwo_ci3/tmpio2s1w1n.py", line 1, in <module>
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s531986184 | p02422 | u650790815 | 1496732858 | Python | Python3 | py | Runtime Error | 0 | 0 | 281 | s = input()
n = int(input())
for i in ragne(n):
cmd = input().split()
a,b = map(int,[cmd[1],cmd[2]])
if cmd[0][0] == 'p':print(s)
elif cmd[0] =='replace':
s = s[:a] + cmd[3] + s[b+1:]
elif cmd[0] =='reverse':
s = s[:a] + s[a:b+1][::-1] + s[b+1:] | Traceback (most recent call last):
File "/tmp/tmp74jk2som/tmpy0qxnbxw.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s072486142 | p02422 | u299798926 | 1499477322 | Python | Python3 | py | Runtime Error | 20 | 7656 | 478 | x=[i for i in input()]
y=[i for i in range(len(x))]
y=x.copy()
n=int(input())
for i in range(n):
c=[j for j in input().split()]
if len(c)==4:
for j in range(len(c[3])):
y[j+int(c[1])]=list(c[3])[j]
x=y.copy()
elif c[0]=="print":
for j in range(int(c[1]),int(c[2])+1):
... | Traceback (most recent call last):
File "/tmp/tmphywop4_1/tmpqxkq1t6g.py", line 1, in <module>
x=[i for i in input()]
^^^^^^^
EOFError: EOF when reading a line
| |
s720344646 | p02422 | u264972437 | 1499831012 | Python | Python3 | py | Runtime Error | 0 | 0 | 380 | def f1(a,b,s):
print(s[a:b+1])
return s
def f2(a,b,s):
temp = s[a:b+1]
return s[:a] + temp[::-1] + s[b+1:]
def f3(a,b,p,s):
return s[:a] + p + s[b+1:]
data = input()
q = int(input())
functions = {'print':f1, 'reverse':f2, 'replace':f3}
for i in range(q):
temp = [s if s.isalpha() else int(s) for s in input().s... | Traceback (most recent call last):
File "/tmp/tmp130a1nqn/tmpqju3hf3u.py", line 12, in <module>
data = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s627954253 | p02422 | u264972437 | 1499831077 | Python | Python3 | py | Runtime Error | 0 | 0 | 380 | def f1(a,b,s):
print(s[a:b+1])
return s
def f2(a,b,s):
temp = s[a:b+1]
return s[:a] + temp[::-1] + s[b+1:]
def f3(a,b,p,s):
return s[:a] + p + s[b+1:]
data = input()
q = int(input())
functions = {'print':f1, 'reverse':f2, 'replace':f3}
for i in range(q):
temp = [s if s.isalpha() else int(s) for s in input().s... | Traceback (most recent call last):
File "/tmp/tmpm83a8k03/tmp6ydbrcu0.py", line 12, in <module>
data = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s343889923 | p02422 | u264972437 | 1499831199 | Python | Python3 | py | Runtime Error | 0 | 0 | 380 | def f1(a,b,s):
print(s[a:b+1])
return s
def f2(a,b,s):
temp = s[a:b+1]
return s[:a] + temp[::-1] + s[b+1:]
def f3(a,b,p,s):
return s[:a] + p + s[b+1:]
data = input()
q = int(input())
functions = {'print':f1, 'reverse':f2, 'replace':f3}
for i in range(q):
temp = [s if s.isalpha() else int(s) for s in input().s... | Traceback (most recent call last):
File "/tmp/tmpk13kwpnj/tmpy2peocg3.py", line 12, in <module>
data = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s263013605 | p02422 | u264972437 | 1499831400 | Python | Python3 | py | Runtime Error | 0 | 0 | 410 | def f1(a,b,s):
print(s[a:b+1])
return s
def f2(a,b,s):
temp = s[a:b+1]
return s[:a] + temp[::-1] + s[b+1:]
def f3(a,b,p,s):
return s[:a] + p + s[b+1:]
'''
data = input()
q = int(input())
'''
data = 'abcdefg'
q = 1
functions = {'print':f1, 'reverse':f2, 'replace':f3}
for i in range(q):
temp = [s if s.isalpha() ... | Traceback (most recent call last):
File "/tmp/tmprmo_4mk1/tmpu_a760sq.py", line 20, in <module>
temp = [s if s.isalpha() else int(s) for s in input().split(' ')]
^^^^^^^
EOFError: EOF when reading a line
| |
s951350685 | p02422 | u956645355 | 1500213946 | Python | Python3 | py | Runtime Error | 30 | 7660 | 557 | def main():
STR = input()
Q = int(input())
ORDER = tuple(tuple(input().split()) for _ in range(Q))
str_ = list(STR)
for order in ORDER:
s = int(order[1])
e = int(order[2]) + 1
a = str_[s:e]
if order[0] == 'print':
print(''.join(a))
elif order[0] =... | Traceback (most recent call last):
File "/tmp/tmpda12x0fm/tmpxz7ummrq.py", line 22, in <module>
main()
File "/tmp/tmpda12x0fm/tmpxz7ummrq.py", line 2, in main
STR = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s942072006 | p02422 | u933096856 | 1505452563 | Python | Python3 | py | Runtime Error | 0 | 0 | 267 | str=input()
n=int(input())
for i in range(n):
s=input().split()
a=int(s[1])
b=int(s[2])
if s[0] == 'replace':
str=str[:a]+s[3]+str[b:]
elif s[0] == 'reverse':
str=str[:a]+reversed(str[a:b])+str[b:]
else:
print(str[a:b]) | Traceback (most recent call last):
File "/tmp/tmpxj3vmwth/tmph07ry5e7.py", line 1, in <module>
str=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s595879746 | p02422 | u506705885 | 1505641369 | Python | Python3 | py | Runtime Error | 0 | 0 | 351 |
s = input()
????
for i in range(int(input())):
????????cmd = input().split()
????????a,b = [int(x) for x in cmd[1:3]]
????
????????if cmd[0] == 'print':
????????????????print(s[a:b+1])
????????elif cmd[0] == 'reverse':
????????????????s = s[:a] + s[a:b+1][::-1] + s[b+1:]
????????elif cmd[0] == 'replace':
?????????????... | File "/tmp/tmprhtzydd2/tmpc8gr8k1_.py", line 3
????
^
SyntaxError: invalid syntax
| |
s990422415 | p02422 | u027634846 | 1505967819 | Python | Python3 | py | Runtime Error | 0 | 0 | 401 | word = input()
order_num = int(input())
orders = []
for i in range(order_num):
orders.append(input().split())
for o in orders:
order = o[0]
if order == 'replace':
word = word[:int(o[1])] + o[3] + word[int(o[2]+1)]
elif order == 'reverse':
word = word[:int(o[1])] + word[int(o[1]):int(o[2]... | Traceback (most recent call last):
File "/tmp/tmp3pwnxxmi/tmpovgs4iw8.py", line 1, in <module>
word = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s942216694 | p02422 | u150984829 | 1516365201 | Python | Python3 | py | Runtime Error | 0 | 0 | 181 | s=input()
for _ in range(int(input())):
a=input().split()
o=a[0];i=int(a[1]);j=int(a[2])+1
if'p'==o[0]:print(s[i:j])
else:
t=(s[i:j][::-1],a[3])['p'==o[2]]
s=s[0:i]+t+s[j:]
| Traceback (most recent call last):
File "/tmp/tmp78pf2je5/tmpwdbqsmo2.py", line 1, in <module>
s=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s600611620 | p02422 | u179070318 | 1517816245 | Python | Python3 | py | Runtime Error | 20 | 5600 | 363 | string = input()
n = int(input())
for i in range(n):
inp = [x for x in input().split()]
a = int(inp[1])
b = int(inp[2])
if inp[0] == 'print':
print(string[a:b+1])
elif inp[0] == 'reverse':
string = string[:a] + string[a:b+1][::-1] +string[b+1:]
elif inp[0] == 'replace':
s... | Traceback (most recent call last):
File "/tmp/tmpzbbh9mg7/tmp66hmq9hx.py", line 1, in <module>
string = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s636498995 | p02422 | u179070318 | 1517816277 | Python | Python3 | py | Runtime Error | 20 | 5596 | 363 | string = input()
n = int(input())
for i in range(n):
inp = [x for x in input().split()]
a = int(inp[1])
b = int(inp[2])
if inp[0] == 'print':
print(string[a:b+1])
elif inp[0] == 'reverse':
string = string[:a] + string[a:b+1][::-1] +string[b+1:]
elif inp[0] == 'replace':
s... | Traceback (most recent call last):
File "/tmp/tmp_3yuhye8/tmpnk1vlavu.py", line 1, in <module>
string = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s747484149 | p02422 | u179070318 | 1517816340 | Python | Python3 | py | Runtime Error | 20 | 5600 | 343 | string = input()
n = int(input())
for i in range(n):
inp = [x for x in input().split()]
a = int(inp[1])
b = int(inp[2])
if inp[0] == 'print':
print(string[a:b+1])
elif inp[0] == 'reverse':
string = string[:a] + string[a:b+1][::-1] +string[b+1:]
else:
string = string[:a] +... | Traceback (most recent call last):
File "/tmp/tmp5c9zq9a9/tmph4u9qv2q.py", line 1, in <module>
string = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s188788769 | p02422 | u179070318 | 1517816367 | Python | Python3 | py | Runtime Error | 20 | 5600 | 344 | string = input()
n = int(input())
for i in range(n):
inp = [x for x in input().split()]
a = int(inp[1])
b = int(inp[2])
if inp[0] == 'print':
print(string[a:b+1])
elif inp[0] == 'reverse':
string = string[:a] + string[a:b+1][::-1] +string[b+1:]
else:
string = string[:a] +... | Traceback (most recent call last):
File "/tmp/tmpo_5dlnei/tmpq0yq3wpy.py", line 1, in <module>
string = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s886306307 | p02422 | u165141947 | 1518467030 | Python | Python | py | Runtime Error | 0 | 0 | 290 | s=raw_input()
n=input()
for _ in range(n):
i=raw_input.split()
if i[0]=='print':
print s[int(i[1]):int(i[2])]
elif i[0]=='reverse':
for j in range(1+(int(i[1])+int(i[2]))/2):
s[int(i[2])-j]=s[int(i[1])+j]
else:
for k in range(int(i[1]),int(i[2])+1):
s[k]=i[4][k-int(i[1])]
| File "/tmp/tmp9myldl3p/tmprz5hye4h.py", line 8
for j in range(1+(int(i[1])+int(i[2]))/2):
^
SyntaxError: invalid non-printable character U+0008
| |
s311889175 | p02422 | u294922877 | 1518669541 | Python | Python3 | py | Runtime Error | 0 | 0 | 478 | def transformate(s, command):
command, *op = command.split()
op[0] = int(op[0])
op[1] = int(op[1])
if command == 'replace':
return s[0:op[0]] + op[2] + s[op[1]+1:]
elif command == 'reverse':
return s[0:op[0]] + s[op[0]:op[1]+1][::-1] + s[op[1]+1:]
elif command == 'print... | Traceback (most recent call last):
File "/tmp/tmp6rjnsd5b/tmp_pjvifbm.py", line 16, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s039933553 | p02422 | u876060624 | 1525089392 | Python | Python3 | py | Runtime Error | 0 | 0 | 365 | x = input()
for i in range(int(input())):
a = input().split()
if a[0] == 'print':
for i in range(1,len(a)):
a[i]=int(a[i])
print(x[a[1]:a[2]+1])
elif a[0] == 'replace':
for i in range(1,len(a)-1):
a[i]=int(a[i])
x = x[:a[1]] +a[3]+ x[a[2]:]
elif a[0] == 'reverse':
for i in range(1,len(a)):
a[i]... | Traceback (most recent call last):
File "/tmp/tmpydl7f9z4/tmpc7e0xalt.py", line 1, in <module>
x = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s671031024 | p02422 | u876060624 | 1525089439 | Python | Python3 | py | Runtime Error | 0 | 0 | 365 | x = input()
for i in range(int(input())):
a = input().split()
if a[0] == 'print':
for i in range(1,len(a)):
a[i]=int(a[i])
print(x[a[1]:a[2]+1])
elif a[0] == 'replace':
for i in range(1,len(a)-1):
a[i]=int(a[i])
x = x[:a[1]] +a[3]+ x[a[2]:]
elif a[0] == 'reverse':
for i in range(1,len(a)):
a[i]... | Traceback (most recent call last):
File "/tmp/tmpbk22bq3_/tmp5p_yag1p.py", line 1, in <module>
x = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s045602767 | p02422 | u604437890 | 1527491630 | Python | Python3 | py | Runtime Error | 20 | 5600 | 647 | def replace(str):
for i, c in enumerate(command[3], command[1]):
str[i] = c
return str
def reverse(str):
for i, c in enumerate(reversed(str[command[1]: command[2]+1]), command[1]):
str[i] = c
str = ''.join(str)
return str
def str_print(str):
str = ''.join(str)
print(str[com... | Traceback (most recent call last):
File "/tmp/tmp2_9p1_d2/tmphowvarux.py", line 16, in <module>
str = list(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s826053761 | p02422 | u485986915 | 1528105715 | Python | Python3 | py | Runtime Error | 0 | 0 | 351 | s = input()
n = int(input())
for i in range(n):
command = input().split()
if command == 'replace':
a,b = map(int(),command[1:3])
s = s[:a]+ command[3] + s[b+1:]
elif command == 'reverse':
a,b = map(int(),command[1:3])
s[a:b] = s[b:a]
else:
a,b = map(int(),comma... | Traceback (most recent call last):
File "/tmp/tmp_4gjpqim/tmpqvhv2er8.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s463530182 | p02422 | u485986915 | 1528106264 | Python | Python3 | py | Runtime Error | 0 | 0 | 375 | s = input()
n = int(input())
for i in range(n):
command = input().split()
if command[0] == 'replace':
a,b = map(int,command[1:3])
s = s[:a]+ command[3] + s[b+1:]
elif command[0] == 'reverse':
a,b = map(int,command[1:3])
s[a:b] = s[b:a]
elif command[0] == 'print':
... | Traceback (most recent call last):
File "/tmp/tmpp2nrm4gp/tmpwlumtz_a.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s956585270 | p02422 | u485986915 | 1528106339 | Python | Python3 | py | Runtime Error | 0 | 0 | 379 | s = input()
n = int(input())
for i in range(n):
command = input().split()
if command[0] == 'replace':
a,b = map(int,command[1:3])
s = s[:a]+ command[3] + s[b+1:]
elif command[0] == 'reverse':
a,b = map(int,command[1:3])
s[a:b+1] = s[b+1:a]
elif command[0] == 'print':
... | Traceback (most recent call last):
File "/tmp/tmp4nytjmj4/tmpvylwt7m2.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s043404080 | p02422 | u485986915 | 1528106382 | Python | Python3 | py | Runtime Error | 0 | 0 | 39 | s = s[0:a] + s[a:b+1][::-1] + s[b+1:]
| File "/tmp/tmpckyu3kaz/tmpwwcbat9r.py", line 1
s = s[0:a] + s[a:b+1][::-1] + s[b+1:]
IndentationError: unexpected indent
| |
s165282743 | p02422 | u922112509 | 1529400463 | Python | Python3 | py | Runtime Error | 0 | 0 | 679 | # Transformation
string = input()
commandAmount = int(input())
for i in range(commandAmount):
command = input().rstrip().split()
start = int(command[1])
end = int(command[2])
if command[0] == 'print':
# print(string[start : end + 1])
elif command[0] == 'reverse':
replacedString = l... | File "/tmp/tmpscnvopqx/tmpqt47h3d0.py", line 12
elif command[0] == 'reverse':
^
IndentationError: expected an indented block after 'if' statement on line 10
| |
s486011729 | p02422 | u123669391 | 1530457969 | Python | Python3 | py | Runtime Error | 0 | 0 | 251 | s = input()
for i in range(int(input())):
c = list(map(str, input().split()))
a, b = int(c[1]), int(c[2])
if c[0] == "print":
print(s[a:b+1])
elif c[0] == " reverse":
s = s[:a] + s[a:b+1][::-1] + s[b+1:]
else:
s = s[:a] + c[3] + c[b+1:]
| Traceback (most recent call last):
File "/tmp/tmpddvooqfn/tmpf052wcrz.py", line 1, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s980304397 | p02431 | u682153677 | 1535087988 | Python | Python3 | py | Runtime Error | 0 | 0 | 299 | # -*- coding: utf-8 -*-
from collections import deque
n = int(input())
word = deque()
for i in range(n):
command, num = int(input().split())
if command == 0:
word.append(num)
elif command == 1:
print('{0}'.format(word[num]))
elif command == 2:
word.pop()
| Traceback (most recent call last):
File "/tmp/tmp3qep5asx/tmptax451y6.py", line 5, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s845015924 | p02431 | u682153677 | 1535088127 | Python | Python3 | py | Runtime Error | 0 | 0 | 304 | # -*- coding: utf-8 -*-
from collections import deque
n = int(input())
word = deque()
for i in range(n):
command, num = map(int, input().split())
if command == 0:
word.append(num)
elif command == 1:
print('{0}'.format(word[num]))
elif command == 2:
word.pop()
| Traceback (most recent call last):
File "/tmp/tmpip908jft/tmp4sj07cvn.py", line 5, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s840848188 | p02431 | u629874472 | 1559050347 | Python | Python3 | py | Runtime Error | 0 | 0 | 184 | cnt = int(input())
a = []
for i in range(cnt):
op,n = map(int,input().split())
if op == 0:
a.append(n)
elif op ==1:
print(a[n])
else:
a.pop(-1)
| Traceback (most recent call last):
File "/tmp/tmpvt15673e/tmp_eqpo1tp.py", line 1, in <module>
cnt = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s572674337 | p02431 | u629874472 | 1559050893 | Python | Python3 | py | Runtime Error | 0 | 0 | 194 | cnt = int(input())
a = []
for i in range(cnt):
li = list(map(int,input().split()))
if li[0] == 0:
a.append(n)
elif li[0] ==1:
print(a[n])
else:
a.pop(-1)
| Traceback (most recent call last):
File "/tmp/tmpfbmcsi8z/tmp_nnulem8.py", line 1, in <module>
cnt = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s990216691 | p02431 | u841567836 | 1528786104 | Python | Python3 | py | Runtime Error | 0 | 0 | 348 | def pushBack(lists, x):
return lists.insert(-1, x)
def randomAccess(lists, p):
print(lists[p])
def popBack(lists):
return lists.pop(-1)
if __name__ == '__main__':
l = list()
n = int(input())
for i in range(n):
j= input().split()
if int(j[0]) == 0:
pushBack(l, x)
elif int(j[0]) == 1:
randomAccess(l... | Traceback (most recent call last):
File "/tmp/tmpqqq34v87/tmpqws2hra7.py", line 12, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s634621190 | p02432 | u629874472 | 1559053168 | Python | Python3 | py | Runtime Error | 0 | 0 | 344 | cnt = int(input())
a = []
for i in range(cnt):
li = list(map(int,input().split()))
if li[0] == 0:
if li[1] == 0:
a.insert(0,li[2])
else:
a.insert(-1,li[2])
if li[0] == 1:
print(a[li[1]])
if li[0] ==2:
if li[1]==0:
a.popleft()
el... | Traceback (most recent call last):
File "/tmp/tmp33j08g53/tmpzd13d3ep.py", line 1, in <module>
cnt = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s172599256 | p02432 | u255317651 | 1526717942 | Python | Python3 | py | Runtime Error | 0 | 0 | 615 | # -*- coding: utf-8 -*-
"""
Created on Sat May 19 15:10:55 2018
AOJ ITP2_1_B
@author: maezawa
"""
import numpy as np
q = int(input())
a = np.zeros(8000000, dtype=int)
start = 4000000
end = 4000001
for i in range(q):
ops = list(map(int,input().split()))
if ops[0] == 0:
if ops[1] == 0:
a[start... | Traceback (most recent call last):
File "/tmp/tmpufsthoso/tmppglghlw7.py", line 8, in <module>
q = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s891229994 | p02432 | u841567836 | 1528787011 | Python | Python3 | py | Runtime Error | 0 | 0 | 586 | def push(lists, d, x):
if d == 0:
lists.insert(0, x)
else:
lists.insert(len(lists), x)
return lists
def randomAccess(lists, p):
print(lists[p])
def pop(lists, d):
if d == 0:
lists.pop(0)
else:
lists.pop(len(lists) - 1)
return lists
if __name__ == '__main__... | Traceback (most recent call last):
File "/tmp/tmpnabnw9ux/tmpxtg2ywdb.py", line 21, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s371886987 | p02432 | u841567836 | 1528819104 | Python | Python3 | py | Runtime Error | 0 | 0 | 630 | from collections import deque
def push(duque, d, x):
if d == 0:
duque.append(x)
else:
duque.insert(len(duque), x)
return duque.appendleft(x)
def randomAccess(duque, p):
print(duque.index(p))
def pop(duque, d):
if d == 0:
duque.pop()
else:
duque.popleft()
re... | Traceback (most recent call last):
File "/tmp/tmpm4y_es02/tmpoae4vuje.py", line 22, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s108959312 | p02433 | u126478680 | 1528166769 | Python | Python3 | py | Runtime Error | 30 | 5604 | 1744 | class Node:
def __init__(self, val=None, prev=None, next=None):
self.val = val
self.prev = prev
self.next = next
class DoublyLinkedList():
def __init__(self, cur=None):
self.num = 0
self.cur = cur
self.first = cur
def insert(self, x):
if self.cur == ... | Traceback (most recent call last):
File "/tmp/tmpjnxntkmb/tmp12dtd570.py", line 55, in <module>
q = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s105153823 | p02433 | u592529978 | 1528353424 | Python | Python | py | Runtime Error | 0 | 0 | 242 | N = int(raw_input())
A = map(int,raw_input().split())
print ' '.join(map(str,A))
for i in range(1,N):
v = A[i]
j = i - 1
while j >=0 and A[j] > v:
A[j+1] = A[j]
j -= 1
A[j+1] = v
print ' '.join(map(str,A))
| File "/tmp/tmphw00pq4p/tmpukcernfx.py", line 3
print ' '.join(map(str,A))
^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s296369883 | p02433 | u592529978 | 1528353459 | Python | Python3 | py | Runtime Error | 0 | 0 | 242 | N = int(raw_input())
A = map(int,raw_input().split())
print ' '.join(map(str,A))
for i in range(1,N):
v = A[i]
j = i - 1
while j >=0 and A[j] > v:
A[j+1] = A[j]
j -= 1
A[j+1] = v
print ' '.join(map(str,A))
| File "/tmp/tmptucbpepi/tmpc61pprjr.py", line 3
print ' '.join(map(str,A))
^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s025440954 | p02433 | u592529978 | 1528355111 | Python | Python3 | py | Runtime Error | 0 | 0 | 1286 |
class Node:
def __init__(self, value):
self.value = value
self.next = None
self.prev = None
def run():
n = int(input())
tail = Node(None)
node = tail
for _ in range(n):
command = input()
if command.startswith('0'):
nn = Node(int(command[2:... | File "/tmp/tmpk8hq_r82/tmp54zly6a1.py", line 23
't = nn
^
SyntaxError: unterminated string literal (detected at line 23)
| |
s662351968 | p02433 | u548155360 | 1528960270 | Python | Python3 | py | Runtime Error | 0 | 0 | 286 | # coding=utf-8
A = []
cursor = 0
N = int(input())
for i in range(N):
query = map(int, input().split())
if query[0] == 0:
A.insert(cursor, query[1])
elif query[0] == 1:
cursor += query[1]
elif query[0] == 2:
A.pop(cursor)
[print(x) for x in A]
| Traceback (most recent call last):
File "/tmp/tmplyzy9ra9/tmph64xvrsp.py", line 6, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s249456943 | p02433 | u841567836 | 1529397775 | Python | Python3 | py | Runtime Error | 0 | 0 | 588 | import numpy as np
if __name__ == '__main__':
n = int(input())
npls = np.array(['END'])
c = 0
count = 0
for i in range(n):
q = input().split()
a, b = (q[0], q[1]) if len(q) == 2 else (q[0], None)
if a == '0':
npls = np.insert(npls, c, b)
count += 1
... | Traceback (most recent call last):
File "/tmp/tmppy8bu29j/tmpmox9wf5i.py", line 4, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s758209368 | p02435 | u126478680 | 1527268753 | Python | Python3 | py | Runtime Error | 20 | 5604 | 336 | n, q = list(map(int, input().split(' ')))
stacks = [[] for i in range(n)]
for i in range(q):
op = list(map(int, input().split(' ')))
if op[0] == 0:
stacks[op[1]].append(op[2])
elif op[0] == 1:
if len(stacks[op[1]]) != 0:
print(stacks[op[1]][-1])
elif op[0] == 2:
stac... | Traceback (most recent call last):
File "/tmp/tmpclqu8z1x/tmpxp1l_pm2.py", line 1, in <module>
n, q = list(map(int, input().split(' ')))
^^^^^^^
EOFError: EOF when reading a line
| |
s066986970 | p02435 | u841567836 | 1529642820 | Python | Python3 | py | Runtime Error | 30 | 6004 | 479 | from collections import deque
if __name__ == '__main__':
n, q = input().split()
n, q = int(n), int(q)
S = [deque([]) for i in range(n)]
for i in range(q):
query = input().split()
if query[0] == '0':
S[int(query[1])].append(query[2])
else:
if len(S) == ... | Traceback (most recent call last):
File "/tmp/tmpju821pn0/tmp3h3y1a4b.py", line 4, in <module>
n, q = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s234541394 | p02435 | u847467233 | 1529801470 | Python | Python3 | py | Runtime Error | 30 | 5996 | 347 | # AOJ TP2_2_A: Stack
# Python3 2018.6.24 bal4u
from collections import deque
n, q = map(int, input().split())
Q = []
for i in range(n): Q.append(deque())
for i in range(q):
a = input().split()
t = int(a[1])
if a[0] == '0': Q[t].append(a[2]) # push
elif a[0] == '1': print(Q[t][-1]) # top
else: Q[t].pop() ... | Traceback (most recent call last):
File "/tmp/tmpbhzfkq_l/tmp8z_lnqso.py", line 5, in <module>
n, q = map(int, input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s936552282 | p02435 | u255317651 | 1529832616 | Python | Python3 | py | Runtime Error | 20 | 5616 | 347 | # -*- coding: utf-8 -*-
"""
Created on Sun Jun 24 18:23:54 2018
ITP22A
@author: maezawa
"""
n, q = list(map(int, input().split()))
a = [[] for _ in range(n)]
for i in range(q):
c = list(map(int, input().split()))
if c[0] == 0:
a[c[1]].append(c[2])
elif c[0] == 1:
print(a[c[1]][-1])
els... | Traceback (most recent call last):
File "/tmp/tmpi_eumtl8/tmpjiqslxma.py", line 8, in <module>
n, q = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s529018225 | p02435 | u255317651 | 1529832697 | Python | Python3 | py | Runtime Error | 20 | 5620 | 371 | # -*- coding: utf-8 -*-
"""
Created on Sun Jun 24 18:23:54 2018
ITP22A
@author: maezawa
"""
n, q = list(map(int, input().split()))
a = [[] for _ in range(n)]
for i in range(q):
c = list(map(int, input().split()))
if c[0] == 0:
a[c[1]].append(c[2])
elif c[0] == 1:
if a[c[1]]:
pr... | Traceback (most recent call last):
File "/tmp/tmpziy80_2v/tmpfamtpm_o.py", line 8, in <module>
n, q = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s434867258 | p02436 | u921810101 | 1526791247 | Python | Python3 | py | Runtime Error | 30 | 6000 | 389 | from collections import deque
a = [int(i) for i in input().split()]
q = deque([])
for i in range(a[0]): q.append(deque([]))
for i in range(a[1]):
cmd = [int(i) for i in input().split()]
if cmd[0] == 0:
q[cmd[1]].append(cmd[2])
elif cmd[0] == 1:
if q[cmd[1]] != []: print(q[cmd[1]][0])
... | Traceback (most recent call last):
File "/tmp/tmp1eawga06/tmpv52gtrw0.py", line 3, in <module>
a = [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s636501740 | p02437 | u255317651 | 1529835543 | Python | Python3 | py | Runtime Error | 20 | 5624 | 844 | # -*- coding: utf-8 -*-
"""
Created on Sun Jun 24 18:23:54 2018
ITP22C
@author: maezawa
"""
n, q = list(map(int, input().split()))
a = [[] for _ in range(n)]
for i in range(q):
c = list(map(int, input().split()))
if c[0] == 0:
if a[c[1]]:
if a[c[1]][-1] < c[2]:
a[c[1]].appe... | Traceback (most recent call last):
File "/tmp/tmpbsn9g3rm/tmptzhiit6q.py", line 8, in <module>
n, q = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s709548975 | p02437 | u841567836 | 1530005227 | Python | Python3 | py | Runtime Error | 20 | 5620 | 1709 | class binaryTree:
def __init__(self, root = None):
self.value = root
self.left = None
self.right = None
def makeBntr(bnary, num):
if bnary is None:
return binaryTree(num)
elif bnary.value is None:
return binaryTree(num)
elif bnary.value < num:
bnary.lef... | Traceback (most recent call last):
File "/tmp/tmpsm5jb7hk/tmpt2xyh4l_.py", line 63, in <module>
n, q = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s680901173 | p02437 | u841567836 | 1530006470 | Python | Python3 | py | Runtime Error | 0 | 0 | 2067 | class binaryTree:
def __init__(self, root = None):
self.value = root
self.left = None
self.right = None
def makeBntr(bnary, num):
if bnary is None or bnary.value is None:
return binaryTree(num)
elif bnary.value is None:
return binaryTree(num)
elif bnary.value <... | File "/tmp/tmp603md1xe/tmp0ip9rzbp.py", line 79
print(bnary.value, bnary.left, bnary.right)print(bnary)
^^^^^
SyntaxError: invalid syntax
| |
s805878948 | p02437 | u841567836 | 1530006644 | Python | Python3 | py | Runtime Error | 20 | 5612 | 1783 | class binaryTree:
def __init__(self, root = None):
self.value = root
self.left = None
self.right = None
def makeBntr(bnary, num):
if bnary is None or bnary.value is None:
return binaryTree(num)
elif bnary.value is None:
return binaryTree(num)
elif bnary.value <... | Traceback (most recent call last):
File "/tmp/tmp93twtga2/tmpbddczkkt.py", line 65, in <module>
n, q = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s576446606 | p02437 | u841567836 | 1530006759 | Python | Python3 | py | Runtime Error | 2700 | 35328 | 1806 | class binaryTree:
def __init__(self, root = None):
self.value = root
self.left = None
self.right = None
def makeBntr(bnary, num):
if bnary is None or bnary.value is None:
return binaryTree(num)
elif bnary.value is None:
return binaryTree(num)
elif bnary.value <... | Traceback (most recent call last):
File "/tmp/tmpllb8p3or/tmpap64508k.py", line 65, in <module>
n, q = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s026810533 | p02439 | u126478680 | 1527307688 | Python | Python3 | py | Runtime Error | 0 | 0 | 173 | nums = list(map(int, input().split(' ')))
max = -float('inf')
min = flaot('inf')
for num in nums:
if num > max: max = num
if num < min: min = num
print(min, max)
| Traceback (most recent call last):
File "/tmp/tmppazzad02/tmpoo0bpxa4.py", line 1, in <module>
nums = list(map(int, input().split(' ')))
^^^^^^^
EOFError: EOF when reading a line
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.