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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s904173219 | p02265 | u144068724 | 1492102943 | Python | Python3 | py | Runtime Error | 0 | 0 | 454 |
n = int(input())
output = []
for i in range(n):
order,data = map(input().split())
# if order == "insert":
# output.append(int(data))
# elif order == "deleteFirst":
# output.pop()
# elif order == "deleteLast":
# output.popleft()
# elif order == "delete":
# try:
# o... | Traceback (most recent call last):
File "/tmp/tmpytrzvpaa/tmpse1ehr5e.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s663707825 | p02265 | u144068724 | 1492102993 | Python | Python3 | py | Runtime Error | 0 | 0 | 458 |
n = int(input())
output = []
for i in range(n):
order,data = map(int,input().split())
# if order == "insert":
# output.append(int(data))
# elif order == "deleteFirst":
# output.pop()
# elif order == "deleteLast":
# output.popleft()
# elif order == "delete":
# try:
# ... | Traceback (most recent call last):
File "/tmp/tmp3wzwiu7x/tmp6w1wk3tj.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s714114343 | p02265 | u144068724 | 1492103136 | Python | Python3 | py | Runtime Error | 0 | 0 | 460 |
n = int(input())
output = []
for i in range(n):
order = map(str,input().split())
if order[0] == "insert":
output.append(int(order[1]))
elif order[0] == "deleteFirst":
output.pop()
elif order[0] == "deleteLast":
output.popleft()
# elif order == "delete":
# try:
# ... | Traceback (most recent call last):
File "/tmp/tmpeeqj122r/tmpnv_2q6pq.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s075083687 | p02265 | u215151081 | 1492348028 | Python | Python3 | py | Runtime Error | 0 | 0 | 360 | import collections from deque
dq = deque()
num = int(input())
for i in range(num):
order = imput().split()
if com[0] == 'insert':
dq.appendleft(com[1])
elif com[0] == 'deleteFirst':
dq.popleft()
elif com[0] == 'deleteLast':
dq.pop()
else:
if com[1] in dq:
... | File "/tmp/tmpla_487n1/tmpbwz45m4w.py", line 1
import collections from deque
^^^^
SyntaxError: invalid syntax
| |
s692533963 | p02265 | u215151081 | 1492348137 | Python | Python3 | py | Runtime Error | 0 | 0 | 350 | import collections from deque
dq = deque()
for i in range(int(input())):
order = imput().split()
if com[0] == 'insert':
dq.appendleft(com[1])
elif com[0] == 'deleteFirst':
dq.popleft()
elif com[0] == 'deleteLast':
dq.pop()
else:
if com[1] in dq:
dq.remov... | File "/tmp/tmpsmjqdf9o/tmpvdhubd4k.py", line 1
import collections from deque
^^^^
SyntaxError: invalid syntax
| |
s606164995 | p02265 | u215151081 | 1492348444 | Python | Python3 | py | Runtime Error | 0 | 0 | 350 | from collections import deque
dq = deque()
for i in range(int(input())):
order = imput().split()
if com[0] == 'insert':
dq.appendleft(com[1])
elif com[0] == 'deleteFirst':
dq.popleft()
elif com[0] == 'deleteLast':
dq.pop()
else:
if com[1] in dq:
dq.remov... | Traceback (most recent call last):
File "/tmp/tmpyzb04i4f/tmpmmxre0k0.py", line 4, in <module>
for i in range(int(input())):
^^^^^^^
EOFError: EOF when reading a line
| |
s907046979 | p02265 | u215151081 | 1492348807 | Python | Python3 | py | Runtime Error | 0 | 0 | 358 | from collections import deque
dq = deque()
for i in range(int(input())):
order = imput().split()
if order[0] == 'insert':
dq.appendleft(com[1])
elif order[0] == 'deleteFirst':
dq.popleft()
elif order[0] == 'deleteLast':
dq.pop()
else:
if order[1] in dq:
... | Traceback (most recent call last):
File "/tmp/tmp59psyh_3/tmphq0dfdyl.py", line 4, in <module>
for i in range(int(input())):
^^^^^^^
EOFError: EOF when reading a line
| |
s613548511 | p02265 | u215151081 | 1492349181 | Python | Python3 | py | Runtime Error | 0 | 0 | 414 | from collections import deque
import sys
dq = deque()
num = int(input())
line = sys.stdin.readlines()
for i in range(num):
order = line[i].split()
if order[0] == 'insert':
dq.appendleft(com[1])
elif order[0] == 'deleteFirst':
dq.popleft()
elif order[0] == 'deleteLast':
dq... | Traceback (most recent call last):
File "/tmp/tmpo9x63fks/tmpvab8azwk.py", line 5, in <module>
num = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s377397309 | p02265 | u297744593 | 1493450807 | Python | Python3 | py | Runtime Error | 20 | 7628 | 377 | #4.4
a = int(input())
val = []
for i in range(0, a):
tmp = list(input().split())
if tmp[0] == 'insert':
val.insert(0, int(tmp[1]))
elif tmp[0] == 'delete':
index = val.index(int(tmp[1]))
val.pop(index)
elif tmp[0] == 'deleteFirst':
val.pop(0)
elif tmp[0] == 'deleteLa... | Traceback (most recent call last):
File "/tmp/tmpiz4wqsn1/tmpg9vmfk50.py", line 2, in <module>
a = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s428222582 | p02265 | u796784914 | 1493461453 | Python | Python | py | Runtime Error | 10 | 6328 | 602 | class MyList(list):
def __init__(self):
self.__init__ = list
def cmd(self,command):
if command == 'deleteFirst':
self.pop(0)
elif command == 'deleteLast':
self.pop(-1)
else:
ope, num = command.split()
num = int(num)
if ... | File "/tmp/tmpjswvsxgl/tmp0wa0ld7n.py", line 26
print l[i],
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s524248008 | p02265 | u616085665 | 1493467607 | Python | Python3 | py | Runtime Error | 0 | 0 | 326 | n = input()
l = []
for i in range(int(n)):
command = input()
print(command)
if command[0] == 'i':
l.insert([(command[6:])])
else:
if command[7] == " ":
if command[6:] in l:
l.remove(command[6:])
else:
if command[7] == 'L':
l.pop()
else:
l.pop(0)
for i in l[:-1]:
print(i, end=' ')
print(... | Traceback (most recent call last):
File "/tmp/tmphcu4etss/tmpioxx4fws.py", line 1, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s663226032 | p02265 | u616085665 | 1493467648 | Python | Python3 | py | Runtime Error | 0 | 0 | 310 | n = input()
l = []
for i in range(int(n)):
command = input()
if command[0] == 'i':
l.insert([(command[6:])])
else:
if command[7] == " ":
if command[6:] in l:
l.remove(command[6:])
else:
if command[7] == 'L':
l.pop()
else:
l.pop(0)
for i in l[:-1]:
print(i, end=' ')
print(l[-1]) | Traceback (most recent call last):
File "/tmp/tmpfrwxrppy/tmpf77r7jgj.py", line 1, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s929608551 | p02265 | u616085665 | 1493467858 | Python | Python3 | py | Runtime Error | 0 | 0 | 321 | n = input()
l = []
for i in range(int(n)):
command = input()
print(command)
if command[0] == 'i':
l.insert(command[7:])
else:
if command[6] == " ":
if command[7:] in l:
l.remove(command[7:])
else:
if command[7] == 'L':
l.pop()
else:
l.pop(0)
for i in l[:-1]:
print(i, end=' ')
print(l[-1]... | Traceback (most recent call last):
File "/tmp/tmpbigkr2u2/tmp7edij5qq.py", line 1, in <module>
n = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s590822198 | p02265 | u825178626 | 1495154819 | Python | Python3 | py | Runtime Error | 40 | 7888 | 372 | # coding: utf-8
# Here your code !
import collections
s=int(input())
deq =collections.deque()
for i in range(s):
n=input().split()
if n[0]=="insert":
deq.appendleft(n[1])
elif n[0]=="delete":
deq.remove(n[1])
elif n[0]=="deleteFirst":
deq.popleft()
elif n[0]=="deleteLast":
... | Traceback (most recent call last):
File "/tmp/tmppx9rlnco/tmpfgo1b50r.py", line 4, in <module>
s=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s531504451 | p02265 | u939814144 | 1495185942 | Python | Python3 | py | Runtime Error | 30 | 7888 | 434 | from collections import deque
def doubly_lined_list(n, A):
Q = deque()
for i in range(n):
if A[i][0] == 'insert':
Q.appendleft(A[i][1])
elif A[i][0] == 'delete':
Q.remove(A[i][1])
elif A[i][0] == 'deleteFirst':
Q.popleft()
elif A[i][0] == 'deleteLast':
Q.pop()
print(' '.join(Q))
if __name__ =... | Traceback (most recent call last):
File "/tmp/tmpxsy18ig3/tmpba_mvxpp.py", line 19, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s464460625 | p02265 | u782850499 | 1495425191 | Python | Python3 | py | Runtime Error | 30 | 7712 | 473 | def insert_ele(x):
lin.insert(0,x)
def delete_ele(x):
lin.remove(x)
def deleteFirst():
lin.pop(0)
def deleteLast():
lin.pop()
cnt = input()
lin = []
for i in range(int(cnt)):
com = input().split()
if com[0] == "insert":
insert_ele(int(com[1]))
if com[0] == "delete":
delete_... | Traceback (most recent call last):
File "/tmp/tmp12nyg1bk/tmp2td8qch9.py", line 10, in <module>
cnt = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s061636132 | p02265 | u603049633 | 1495966335 | Python | Python3 | py | Runtime Error | 30 | 7932 | 368 | from collections import deque
if __name__ == '__main__':
n = int(input())
L = deque()
for i in range(n):
cmdline = input().split()
if cmdline[0] == "insert":
L.appendleft(cmdline[1])
elif cmdline[0] == "delete":
L.remove(cmdline[1])
elif cmdline[0] == "deleteFirst":
L.popleft()
elif cmdline[0] ... | Traceback (most recent call last):
File "/tmp/tmpf0u59h1o/tmpuwpk_yqy.py", line 4, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s188995772 | p02265 | u603049633 | 1495967643 | Python | Python3 | py | Runtime Error | 30 | 7968 | 327 | from collections import deque
n = int(input())
L = deque()
for i in range(n):
cmdline = input().split()
if cmdline[0] == "insert":
L.appendleft(cmdline[1])
elif cmdline[0] == "delete":
L.remove(cmdline[1])
elif cmdline[0] == "deleteFirst":
L.popleft()
elif cmdline[0] == "deleteLast":
L.pop()
print(" ".j... | Traceback (most recent call last):
File "/tmp/tmpvpkf7q2c/tmpx875k5z5.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s912157455 | p02265 | u279605379 | 1496018305 | Python | Python3 | py | Runtime Error | 0 | 0 | 384 | #ALDS1_3-C Elementary data structures - Doubly Linked List
n=int(input())
L=[]
for i in range(n):
cmd=input().split()
if(cmd[0]=="insert"):
[cmd[1]]+L
if(cmd[0]=="delete" and cmd[1] in L):
L.remove(cmd[1])
if(cmd[0]=="deleteFirst"):
L.pop(0)
if(cmd[0]=="deleteLast"):
... | Traceback (most recent call last):
File "/tmp/tmpiaqc474r/tmp994hj_iy.py", line 2, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s810604215 | p02265 | u279605379 | 1496019119 | Python | Python3 | py | Runtime Error | 0 | 0 | 374 | #ALDS1_3-C Elementary data structures - Doubly Linked List
n=int(input())
cmds={"insert":lambda cmd,L: [cmd[1]]+L,
"delete":lambda cmd,L: L.remove(cmd[1]),
"deleteFirst":lambda cmd,L: L.pop(0),
"deleteLast": lambda cmd,L: L.pop()
}
L=[]
for i in range(n):
cmd=input().split()
L = cmds[cmd[... | Traceback (most recent call last):
File "/tmp/tmp5clcbj93/tmpdfalvph_.py", line 2, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s072592547 | p02265 | u279605379 | 1496034004 | Python | Python3 | py | Runtime Error | 30 | 7708 | 368 | #ALDS1_3-C Elementary data structures - Doubly Linked List
n=int(input())
cmds={"insert":lambda cmd: L.insert(0,cmd[1]),
"delete":lambda cmd: L.remove(cmd[1]),
"deleteFirst":lambda cmd: L.pop(0),
"deleteLast": lambda cmd: L.pop()
}
L=[]
for i in range(n):
cmd=input().split()
cmds[cmd[0]](... | Traceback (most recent call last):
File "/tmp/tmpkas_g8zw/tmp23sygoc8.py", line 2, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s061757882 | p02265 | u657007612 | 1496067277 | Python | Python3 | py | Runtime Error | 0 | 0 | 2540 | import sys
class Deque:
class Node: # ??????????????????
def __init__(self, x, y=None, z=None):
self.key = x
self.next = y
self.prev = z
def search(self, x): # listSearch??¨???????????????????????????????????????
if(self.key == x or self.key is No... | Traceback (most recent call last):
File "/tmp/tmpaw8ak05x/tmp_85xvaoq.py", line 80, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s780078050 | p02265 | u657007612 | 1496068300 | Python | Python3 | py | Runtime Error | 4850 | 176224 | 2559 | import sys
class Deque:
class Node: # ??????????????????
def __init__(self, x, y=None, z=None):
self.key = x
self.next = y
self.prev = z
def search(self, x): # listSearch??¨???????????????????????????????????????
if(self.key == x or self.key is No... | Traceback (most recent call last):
File "/tmp/tmpxv6fduv_/tmpcbzoy9tn.py", line 80, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s645067843 | p02265 | u279605379 | 1496099021 | Python | Python3 | py | Runtime Error | 0 | 0 | 415 | #ALDS1_3-C Elementary data structures - Doubly Linked List
import collections
q = collections.deque()
cmds={"insert":lambda cmd: q.appendleft(cmd[1]),
"delete":lambda cmd: q.remove(cmd[1]) if (q.count(cmd[1]) > 0) else "none",
"deleteFirst":lambda cmd: L.popleft(),
"deleteLast": lambda cmd: L.pop()
... | Traceback (most recent call last):
File "/tmp/tmp8zb59g7e/tmpx27g3_kz.py", line 10, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s699055240 | p02265 | u279605379 | 1496099043 | Python | Python3 | py | Runtime Error | 0 | 0 | 415 | #ALDS1_3-C Elementary data structures - Doubly Linked List
import collections
q = collections.deque()
cmds={"insert":lambda cmd: q.appendleft(cmd[1]),
"delete":lambda cmd: q.remove(cmd[1]) if (q.count(cmd[1]) > 0) else "none",
"deleteFirst":lambda cmd: L.popleft(),
"deleteLast": lambda cmd: L.pop()
... | Traceback (most recent call last):
File "/tmp/tmpacqq4exg/tmp_kkd68ll.py", line 10, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s539151743 | p02265 | u091533407 | 1498003751 | Python | Python3 | py | Runtime Error | 20 | 7664 | 557 | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 21 08:50:28 2017
@author: syaga
"""
COMMAND = ["insert", "delete", "deleteFirst", "deleteLast"]
if __name__ == "__main__":
n = int(input())
com = []
for i in range(n):
com.append(input().split())
ans = []
for i in com:
if i[0] == COMM... | Traceback (most recent call last):
File "/tmp/tmpt35bmdeq/tmpmrgy5nn9.py", line 11, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s248111920 | p02265 | u091533407 | 1498004421 | Python | Python3 | py | Runtime Error | 0 | 0 | 642 | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 21 09:13:28 2017
@author: syaga
"""
COMMAND = ["insert", "delete", "deleteFirst", "deleteLast"]
if __name__ == "__main__":
n = int(input())
com = []
for i in range(n):
com.append(input().split())
ans = []
for i in com:
if i[0] == COMM... | Traceback (most recent call last):
File "/tmp/tmp5r51t5zl/tmpwq6lu7qe.py", line 11, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s123892180 | p02265 | u813534019 | 1498183401 | Python | Python | py | Runtime Error | 10 | 6420 | 388 | n=int(raw_input())
lst = []
for _ in range(n):
cmd = raw_input().split()
if cmd[0] == "insert":
lst.insert(0, int(cmd[1]))
elif cmd[0] == "delete":
lst.remove(int(cmd[1]))
if cmd[0] == "deleteFirst":
if len(lst) > 0:
lst.pop(0)
if cmd[0] == "deleteLast":
i... | File "/tmp/tmpadft5k4_/tmpny4_mya8.py", line 15
print " ".join(map(str,lst))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s392616819 | p02265 | u813534019 | 1498183489 | Python | Python | py | Runtime Error | 10 | 6376 | 388 | n=int(raw_input())
lst = []
for _ in range(n):
cmd = raw_input().split()
if cmd[0] == "insert":
lst.insert(0, int(cmd[1]))
elif cmd[0] == "delete":
lst.remove(int(cmd[1]))
if cmd[0] == "deleteFirst":
if len(lst) > 0:
lst.pop(0)
if cmd[0] == "deleteLast":
i... | File "/tmp/tmprzzi1t78/tmptkdb7y_o.py", line 15
print " ".join(map(str,lst))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s464155058 | p02265 | u591588652 | 1498223915 | Python | Python3 | py | Runtime Error | 40 | 7992 | 431 | from collections import deque
n = int(input())
a = deque()
for i in range(n):
s = input().split(" ")
if s[0] == "insert":
a.appendleft(int(s[1]))
elif s[0] == "delete":
a.remove(int(s[1]))
elif s[0] == "deleteLast":
a.pop()
elif s[0] == "deleteFirst":
a.popleft()
b = ... | Traceback (most recent call last):
File "/tmp/tmphj08te8i/tmps05lp97e.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s485725250 | p02265 | u197615397 | 1498372138 | Python | Python3 | py | Runtime Error | 0 | 0 | 329 | from collections import deque
dq = deque()
for _ in [None]*int(input()):
s = input()
if s == "deleteFirst":
dq.popleft()
elif s == "deleteLast":
dq.pop()
else:
a, b = s.split()
if a == "insert":
dq.insert(0, b)
else:
dq.remove(b)
print(" ".... | Traceback (most recent call last):
File "/tmp/tmptg36v4c7/tmp2yqnsjzz.py", line 3, in <module>
for _ in [None]*int(input()):
^^^^^^^
EOFError: EOF when reading a line
| |
s628615813 | p02265 | u197615397 | 1498372508 | Python | Python3 | py | Runtime Error | 30 | 7928 | 330 | from collections import deque
dq = deque()
for _ in [None]*int(input()):
s = input()
if s == "deleteFirst":
dq.popleft()
elif s == "deleteLast":
dq.pop()
else:
a, b = s.split()
if a == "insert":
dq.appendleft(b)
else:
dq.remove(b)
print(" "... | Traceback (most recent call last):
File "/tmp/tmp26uaqkhy/tmpg6wgy47q.py", line 3, in <module>
for _ in [None]*int(input()):
^^^^^^^
EOFError: EOF when reading a line
| |
s734037914 | p02265 | u735204496 | 1499005068 | Python | Python | py | Runtime Error | 0 | 0 | 1552 | import sys
class Node:
def __init__(self, num):
self.prev = None
self.next = None
self.num = num
def delete(self):
if self.prev is not None:
self.prev.next = self.next
if self.next is not None:
self.next.prev = self.prev
class LinkedList:... | File "/tmp/tmpgq2vq_vw/tmpphoo0vbz.py", line 54
print str(linked_list)
^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s294644353 | p02265 | u735204496 | 1499005120 | Python | Python | py | Runtime Error | 0 | 0 | 1557 | import sys
class Node:
def __init__(self, num):
self.prev = None
self.next = None
self.num = num
def delete(self):
if self.prev is not None:
self.prev.next = self.next
if self.next is not None:
self.next.prev = self.prev
class LinkedList:... | File "/tmp/tmpae9bs71j/tmpdpzm1wwm.py", line 54
print str(linked_list)
^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s766324413 | p02265 | u735204496 | 1499009091 | Python | Python | py | Runtime Error | 0 | 0 | 708 | import sys
def main():
linked_list = []
c_num = int(sys.stdin.readline().strip())
for i in range(0, c_num):
line = sys.stdin.readline().strip().split(" ")
op = line[0]
n = int(line[1])
if op == "insert":
linked_list.insert(0, n)
if op == "delete":
... | File "/tmp/tmpy1x0ko69/tmp1qon_o9c.py", line 24
print s.strip()
^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s364116769 | p02265 | u858885710 | 1499036002 | Python | Python | py | Runtime Error | 0 | 0 | 2342 |
class Node(object):
def __init__(self, num, prv = None, nxt = None):
self.num = num
self.prv = prv
self.nxt = nxt
class DoublyLinkedList(object):
def __init__(self):
self.start = self.last = None
def insert(self, num):
new_elem = Node(num)
if self.start is... | Traceback (most recent call last):
File "/tmp/tmpmovlb0dw/tmpjgmaiiaq.py", line 94, in <module>
_main()
File "/tmp/tmpmovlb0dw/tmpjgmaiiaq.py", line 76, in _main
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s337369103 | p02265 | u278938795 | 1499063385 | Python | Python | py | Runtime Error | 10 | 6252 | 435 | import sys
l = []
n = int(sys.stdin.readline().strip())
def delete(lst,x):
lst.remove(x)
def deleteFirst(lst):
lst.pop(0)
def deleteLast(lst):
lst.pop(len(lst)-1)
for i in range(n):
c = sys.stdin.readline().strip().split(" ")
if c[0]=="insert":
l.append(int(c[1]))
elif c[0]=="delete":
delete(l,int(c[1]))
... | Traceback (most recent call last):
File "/tmp/tmphpu9czor/tmp6pju7h4w.py", line 5, in <module>
n = int(sys.stdin.readline().strip())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s308256379 | p02265 | u821624310 | 1499427630 | Python | Python3 | py | Runtime Error | 30 | 7664 | 465 | n = int(input())
array = []
for i in range(n):
cmd, *key = input().split()
if type(key) == list:
for i in key:
key = i
if cmd == "insert":
array.insert(0, key)
elif cmd == "delete":
array.remove(key)
elif cmd == "deleteFirst":
del array[0]
else:
... | Traceback (most recent call last):
File "/tmp/tmpv74ynicu/tmp_2k110kj.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s187044046 | p02265 | u821624310 | 1499427702 | Python | Python3 | py | Runtime Error | 20 | 7712 | 465 | n = int(input())
array = []
for i in range(n):
cmd, *key = input().split()
if type(key) == list:
for i in key:
key = i
if cmd == "insert":
array.insert(0, key)
elif cmd == "delete":
array.remove(key)
elif cmd == "deleteFirst":
del array[0]
else:
... | Traceback (most recent call last):
File "/tmp/tmp5pyujag_/tmpfbc1rkf8.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s982374246 | p02265 | u193453446 | 1500017933 | Python | Python3 | py | Runtime Error | 100 | 15708 | 3036 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
???????????£????????????
??\?????????????????????????????????????????£???????????????????£??????????????????????
insert x: ??£?????????????????????????????? x ?????????????´?????¶?????¶???????
delete x: ?????? x ??????????????????????´??????£???????????????????????????... | Traceback (most recent call last):
File "/tmp/tmp8wmfzik4/tmp29mlccqm.py", line 78, in <module>
num = int(input().strip())
^^^^^^^
EOFError: EOF when reading a line
| |
s071234378 | p02265 | u193453446 | 1500018978 | Python | Python3 | py | Runtime Error | 30 | 7720 | 878 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
???????????£????????????
??\?????????????????????????????????????????£???????????????????£??????????????????????
insert x: ??£?????????????????????????????? x ?????????????´?????¶?????¶???????
delete x: ?????? x ??????????????????????´??????£???????????????????????????... | Traceback (most recent call last):
File "/tmp/tmpq92vo79q/tmpihbwr92o.py", line 14, in <module>
num = int(input().strip())
^^^^^^^
EOFError: EOF when reading a line
| |
s956975721 | p02265 | u193453446 | 1500019347 | Python | Python3 | py | Runtime Error | 0 | 0 | 972 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
???????????£????????????
??\?????????????????????????????????????????£???????????????????£??????????????????????
insert x: ??£?????????????????????????????? x ?????????????´?????¶?????¶???????
delete x: ?????? x ??????????????????????´??????£???????????????????????????... | Traceback (most recent call last):
File "/tmp/tmp_p25a5hp/tmpznu734_p.py", line 14, in <module>
num = int(input().strip())
^^^^^^^
EOFError: EOF when reading a line
| |
s259950720 | p02265 | u264972437 | 1500377284 | Python | Python3 | py | Runtime Error | 0 | 0 | 284 | n = int(input())
data = []
for i in range(n):
command,x = input().split()
if command == 'insert':
data.insert(0,x)
elif command == 'delete':
if x in data:
data.remove(x)
elif command == 'deleteFirst':
data.pop(0)
elif command == 'deleteLast':
data.pop()
print(*data) | Traceback (most recent call last):
File "/tmp/tmpia53ihag/tmpzrsrkkvj.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s899167939 | p02265 | u914146430 | 1500961555 | Python | Python3 | py | Runtime Error | 0 | 0 | 361 | n=int(input())
for i in range(n):
cmd=input().split()
if cmd[0]=="insert":
dl_list.insert(0,cmd[1])
elif cmd[0]=="delete":
try:
dl_list.remove(cmd[1])
except:
print("Error")
elif cmd[0]=="deleteFirst":
del dl_list[0]
elif cmd[0]=="deleteLast":... | Traceback (most recent call last):
File "/tmp/tmp5sg1kr0a/tmp_o1g8zg3.py", line 1, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s800178612 | p02265 | u914146430 | 1500962049 | Python | Python3 | py | Runtime Error | 0 | 0 | 371 | n=int(input())
dl_list=[]
for i in range(n):
cmd=input().split()
if cmd[0]=="insert":
dl_list.insert(0,cmd[1])
elif cmd[0]=="delete":
try:
dl_list.remove(cmd[1])
except:
pass
elif cmd[0]=="deleteFirst":
del dl_list[0]
elif cmd[0]=="deleteLast... | File "/tmp/tmpwfo4b58p/tmp8dkgxt6f.py", line 19
print(" ".join(dl_list)
^
SyntaxError: '(' was never closed
| |
s970951811 | p02265 | u760630500 | 1501429130 | Python | Python3 | py | Runtime Error | 0 | 0 | 682 |
class DoublyLinkedList:
def insert(L, key):
L.insert(0, key)
def delete(L, key):
idx = L.index(key)
L.pop(idx)
def deleteFirst(L):
L.pop(0)
def deleteLast(L):
L.pop()
N = int(input())
C = []
for i in range(N):
C.append(input().split())
DLL =... | Traceback (most recent call last):
File "/tmp/tmpoq2ts2e6/tmpqfsns8b6.py", line 16, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s659937343 | p02265 | u760630500 | 1501429244 | Python | Python3 | py | Runtime Error | 0 | 0 | 664 |
class DoublyLinkedList:
def insert(L, key):
L.insert(0, key)
def delete(L, key):
idx = L.index(key)
L.pop(idx)
def deleteFirst(L):
L.pop(0)
def deleteLast(L):
L.pop()
N = int(input())
C = []
for i in range(N):
C.append(input().split())
DLL =... | Traceback (most recent call last):
File "/tmp/tmpwxgxwbc6/tmp3w3ft5v1.py", line 16, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s600794997 | p02265 | u760630500 | 1501429905 | Python | Python3 | py | Runtime Error | 20 | 7756 | 697 |
class DoublyLinkedList:
def insert(self, L, key):
L.insert(0, key)
def delete(self, L, key):
idx = L.index(key)
L.pop(idx)
def deleteFirst(self, L):
L.pop(0)
def deleteLast(self, L):
L.pop()
N = int(input())
C = []
for i in range(N):
C.append(... | Traceback (most recent call last):
File "/tmp/tmpjru9ni71/tmpp208pyau.py", line 16, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s531723286 | p02265 | u519227872 | 1501588815 | Python | Python3 | py | Runtime Error | 30 | 7804 | 1220 | n = int(input())
class cell:
def __init__(self, data, before, _next):
self.data = data
self.before = before
self._next = _next
def search(ddl, data):
for ind,item in enumerate(ddl):
if item.data == data:
return ind
return None
def getItem(ddl, index):
if le... | Traceback (most recent call last):
File "/tmp/tmprm04yrm9/tmp7jvm3u75.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s306681254 | p02265 | u519227872 | 1501589069 | Python | Python3 | py | Runtime Error | 20 | 7796 | 1247 | n = int(input())
class cell:
def __init__(self, data, before, _next):
self.data = data
self.before = before
self._next = _next
def search(ddl, data):
for ind,item in enumerate(ddl):
if item.data == data:
return ind
return None
def getItem(ddl, index):
if le... | Traceback (most recent call last):
File "/tmp/tmpegyfmxbv/tmpzorwukpz.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s587762377 | p02265 | u260980560 | 1501649637 | Python | Python3 | py | Runtime Error | 30 | 7944 | 987 | from collections import deque
n = int(input())
deq = deque()
sub_deq = {}
for i in range(n):
cmd = input()
if cmd == 'deleteFirst':
while 1:
data = deq.pop()
if data[1]:
data[1] = 0
break
elif cmd == 'deleteLast':
while 1:
d... | Traceback (most recent call last):
File "/tmp/tmp5la6rv4i/tmpsc0k8v7m.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s406525844 | p02265 | u519227872 | 1501685117 | Python | Python3 | py | Runtime Error | 30 | 8028 | 470 | from collections import deque
from sys import stdin
n = int(input())
ddl = deque()
for i in stdin:
inp = i.split()
if len(inp) == 2:
op, data = inp
data = int(data)
else: op, data = inp[0], None
if op == 'insert':
ddl.appendleft(data,)
elif op == 'delete':
ddl.remove(... | Traceback (most recent call last):
File "/tmp/tmpm3xeoy3r/tmpi05kkodn.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s106813722 | p02265 | u491916705 | 1502102092 | Python | Python | py | Runtime Error | 10 | 6292 | 490 | n = int(raw_input())
linked = []
for i in range(n):
command = raw_input()
if command == 'deleteFirst':
linked.pop(0)
elif command == 'deleteLast':
linked.pop()
elif 'insert' in command:
_, num = command.split()
linked.insert(0, num)
elif 'delete' in command:
... | File "/tmp/tmppk1g93an/tmpt4k3swq8.py", line 20
print linked[i],
^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s226697917 | p02265 | u539803218 | 1502167399 | Python | Python3 | py | Runtime Error | 30 | 7748 | 377 | n=input()
l=[]
for i in range(int(n)):
m = input().split()
if m[0] == "insert":
l.insert(0, int(m[1]))
elif m[0] == "delete":
l.remove(int(m[1]))
elif m[0] == "deleteFirst":
l.pop(0)
else:
l.pop()
if len(l) > 1:
for i in range(l... | Traceback (most recent call last):
File "/tmp/tmpd9f0sr0h/tmpgi6d5dcl.py", line 1, in <module>
n=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s464111027 | p02265 | u539803218 | 1502167485 | Python | Python3 | py | Runtime Error | 20 | 7696 | 369 | n=input()
l=[]
for i in range(int(n)):
m = input().split()
if m[0] == "insert":
l.insert(0, int(m[1]))
elif m[0] == "delete":
l.remove(int(m[1]))
elif m[0] == "deleteFirst":
l.pop(0)
else:
l.pop()
if len(l) > 1:
[print(l[i],end=... | Traceback (most recent call last):
File "/tmp/tmpzt61nczi/tmpivpzbp38.py", line 1, in <module>
n=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s002645868 | p02265 | u510829608 | 1502244399 | Python | Python3 | py | Runtime Error | 30 | 7964 | 352 | from collections import deque
n = int(input())
dq = deque()
for _ in range(n):
command = input().split()
if command[0] == 'delete':
dq.remove(int(command[1]))
elif command[0] == 'insert':
dq.appendleft(int(command[1]))
elif command[0] == 'deleteFirst':
dq.popleft()
else:
... | Traceback (most recent call last):
File "/tmp/tmp8oz7537c/tmpbp1wp_8e.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s984933265 | p02265 | u153665391 | 1505006642 | Python | Python3 | py | Runtime Error | 0 | 0 | 391 | N = int(input())
Commands = []
for i in range(N):
c, n = input().strip().split()
Commands.append([c, int(n)])
A = []
for c in Commands:
if c[0] == 'insert':
A.insert(0, c[1])
elif c[0] == 'delete':
A.remove(c[1])
elif c[0] == 'deleteFirst':
A.delete(0)
elif c[0] == 'del... | Traceback (most recent call last):
File "/tmp/tmp40_8oprv/tmphjgj4nvt.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s425227652 | p02265 | u153665391 | 1505006681 | Python | Python3 | py | Runtime Error | 0 | 0 | 391 | N = int(input())
Commands = []
for i in range(N):
c, n = input().strip().split()
Commands.append([c, int(n)])
A = []
for c in Commands:
if c[0] == 'insert':
A.insert(0, c[1])
elif c[0] == 'delete':
A.remove(c[1])
elif c[0] == 'deleteFirst':
A.delete(0)
elif c[0] == 'del... | Traceback (most recent call last):
File "/tmp/tmpf60344_o/tmpxgzl0c08.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s408674090 | p02265 | u153665391 | 1505007994 | Python | Python3 | py | Runtime Error | 30 | 7784 | 441 | N = int(input())
Commands = []
for i in range(N):
l = input().split()
if len(l) > 1:
Commands.append([l[0], int(l[1])])
else:
Commands.append([l[0]])
A = []
for c in Commands:
if c[0] == 'insert':
A.insert(0, c[1])
elif c[0] == 'delete':
A.remove(c[1])
elif c[0]... | Traceback (most recent call last):
File "/tmp/tmpn_bng0d0/tmpqs712rp_.py", line 1, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s764565355 | p02265 | u354053070 | 1505190898 | Python | Python3 | py | Runtime Error | 30 | 8024 | 359 | from collections import deque
queue = deque([])
n = int(input())
for _ in range(n):
command = input()
if command == "deleteFirst":
_ = queue.popleft()
elif command == "deleteLast":
_ = queue.pop()
elif "delete" in command:
queue.remove(command[-1])
else:
queue.appendl... | Traceback (most recent call last):
File "/tmp/tmp56dguo38/tmppcnq_8ev.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s141182621 | p02265 | u354053070 | 1505191049 | Python | Python3 | py | Runtime Error | 30 | 8004 | 401 | from collections import deque
queue = deque([])
n = int(input())
for _ in range(n):
command = input()
if command == "deleteFirst":
_ = queue.popleft()
elif command == "deleteLast":
_ = queue.pop()
elif "delete" in command:
_, x = command.split()
queue.remove(x)
else:
... | Traceback (most recent call last):
File "/tmp/tmp4oi4wktd/tmpmssrbwx6.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s501498074 | p02265 | u027634846 | 1506786955 | Python | Python3 | py | Runtime Error | 60 | 7772 | 491 | def order_each(orders):
import sys
linked = []
for i in orders:
order = i[0]
if order == "insert":
linked.insert(0, i[1])
elif order == "delete":
linked.remove(i[1])
elif order == "deleteFirst":
linked.pop(0)
elif order == "deleteLa... | Traceback (most recent call last):
File "/tmp/tmpq9lqz7jb/tmpl1ovl_28.py", line 20, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s130667133 | p02265 | u027634846 | 1506789875 | Python | Python3 | py | Runtime Error | 30 | 8004 | 521 | def order_each(orders):
from collections import deque
linked = deque([])
for i in orders:
order = i[0]
if order == "insert":
linked.appendleft(i[1])
elif order == "delete":
linked.remove(i[1])
elif order == "deleteFirst":
linked.popleft()
... | Traceback (most recent call last):
File "/tmp/tmpzqzb1t_w/tmpah9wa01r.py", line 20, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s920595465 | p02265 | u027634846 | 1507234994 | Python | Python3 | py | Runtime Error | 30 | 8096 | 521 | def order_each(orders):
from collections import deque
linked = deque([])
for i in orders:
order = i[0]
if order == "insert":
linked.appendleft(i[1])
elif order == "delete":
linked.remove(i[1])
elif order == "deleteFirst":
linked.popleft()
... | Traceback (most recent call last):
File "/tmp/tmplhhxzgp0/tmpwut8taud.py", line 20, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s266125584 | p02265 | u701472721 | 1508835470 | Python | Python3 | py | Runtime Error | 0 | 0 | 1958 | NEXT = 2
DATA = 1
PREV = 0
def dll_processor(operations):
front = None
end = None
for o in operations:
if o[0] == "insert":
front, end = insert(front, end, o[1])
elif o[0] == "delete":
front, end = delete(front, end, o[1])
elif o[0] == "deleteFirst":
... | File "/tmp/tmptxaaxu8m/tmpsds_6ksi.py", line 84
if __name__ ==
^
SyntaxError: invalid syntax
| |
s578414661 | p02265 | u701472721 | 1508835509 | Python | Python3 | py | Runtime Error | 0 | 0 | 2040 | #include<stdio.h>
#include<stdlib.h>
struct node{
int key;
struct node *next;
struct node *prev;
};
typedef struct node * NodePointer;
NodePointer nil;
void init()
{
nil = NULL;
}
void insert(int key)
{
struct node *newcell;
newcell = (struct node*)malloc(sizeof(struct node));
if (newcell == NULL) {
puts... | File "/tmp/tmp1qkjvu82/tmph_bwytf0.py", line 4
struct node{
^^^^
SyntaxError: invalid syntax
| |
s385715986 | p02265 | u514487486 | 1509193066 | Python | Python3 | py | Runtime Error | 20 | 7704 | 399 | n = int(input())
list = []
for _ in range(n):
command = input().split()
if command[0] == 'insert':
num = int(command[1])
list.insert(0, num)
elif command[0] == 'delete':
num = int(command[1])
list.remove(num)
elif command[0] == 'deleteFirst':
list.pop(0)
elif ... | Traceback (most recent call last):
File "/tmp/tmpwiost04n/tmpgx2_sepa.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s899161271 | p02265 | u514487486 | 1509193334 | Python | Python3 | py | Runtime Error | 0 | 0 | 385 | dq = deque()
num = int(sys.stdin.readline())
line = sys.stdin.readlines()
for i in range(num):
order = line[i].split()
if order[0] == 'insert':
dq.appendleft(order[1])
elif order[0] == 'deleteFirst':
dq.popleft()
elif order[0] == 'deleteLast':
dq.pop()
else:
if ord... | Traceback (most recent call last):
File "/tmp/tmp57lyhs00/tmp_jfxbz2h.py", line 1, in <module>
dq = deque()
^^^^^
NameError: name 'deque' is not defined
| |
s337165189 | p02265 | u262566745 | 1509287063 | Python | Python3 | py | Runtime Error | 30 | 7972 | 460 | from collections import deque
queue = deque([])
n = int(input())
for i in range(n):
commands = input().split(" ")
command = commands[0]
if command == "insert":
queue.appendleft(commands[1])
elif command == "delete":
queue.remove(commands[1])
elif command == "deleteFirst":
... | Traceback (most recent call last):
File "/tmp/tmpytir6ql2/tmpal5iuzmh.py", line 5, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s990622894 | p02265 | u262566745 | 1509288529 | Python | Python3 | py | Runtime Error | 0 | 0 | 451 | from collections import deque
queue = deque()
for _ in range(int(input())):
commands = input().split(" ")
if command[0] == "insert":
queue.appendleft(commands[1])
elif command[0] == "delete":
try:
queue.remove(commands[1])
except ValueError:
pass
elif co... | Traceback (most recent call last):
File "/tmp/tmp48or_t9a/tmp90398oc2.py", line 5, in <module>
for _ in range(int(input())):
^^^^^^^
EOFError: EOF when reading a line
| |
s929091736 | p02265 | u368364462 | 1509336951 | Python | Python3 | py | Runtime Error | 30 | 8016 | 442 | from collections import deque
n = int(input())
d = deque()
for _ in range(n):
com = input()
if ( len(com) == 8):
com , i = com.split()
if (com[0] == 'i'):
d.appendleft(int(i))
elif (com[0] == 'd'):
if (len(com) == 6):
d.remove(int(i))
elif (com[6] == 'F'):
... | Traceback (most recent call last):
File "/tmp/tmpyvtxb9z6/tmpoym45eln.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s673900965 | p02265 | u368364462 | 1509337293 | Python | Python3 | py | Runtime Error | 70 | 7944 | 452 | from collections import deque
n = int(input())
d = deque()
for _ in range(n):
com = input()
if (com[0] == 'i'):
com ,i = com.split()
d.appendleft(int(i))
elif (com[0] == 'd'):
if (com[7].isdigit()):
com, i = com.split()
d.remove(int(i))
elif (com[6]... | Traceback (most recent call last):
File "/tmp/tmpks5d_mak/tmpyc4zkk1u.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s729066308 | p02265 | u110907458 | 1509504385 | Python | Python3 | py | Runtime Error | 30 | 8080 | 386 | from collections import deque
n = int(input())
cmd = [input().split() for i in range(n)]
stack = deque()
for i in range(n):
if cmd[i][0] == "insert":
stack.appendleft(cmd[i][1])
elif cmd[i][0] == "delete":
stack.remove(cmd[i][1])
elif cmd[i][0] == "deleteFirst":
stack.popleft()
... | Traceback (most recent call last):
File "/tmp/tmpe7nqno42/tmpp3v17txo.py", line 3, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s208062988 | p02265 | u798803522 | 1509541536 | Python | Python3 | py | Runtime Error | 0 | 0 | 404 | from collections import deque
query = int(input())
l = deque()
for _ in range(query):
command = input()
if command == "deleteFirst":
l.popleft()
elif command == "deleteLast":
l.pop()
else:
command, value = command.split(" ")
if command == "insert":
deque.appen... | Traceback (most recent call last):
File "/tmp/tmp1wk_6jmg/tmprjbu_mv7.py", line 2, in <module>
query = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s866744306 | p02265 | u027634846 | 1509547649 | Python | Python3 | py | Runtime Error | 70 | 8096 | 522 | def order_each(orders):
from collections import deque
linked = deque([])
for i in orders:
order = i[0]
if order == "insert":
linked.appendleft(i[1])
elif order == "delete":
linked.remove(i[1])
elif order == "deleteFirst":
linked.popleft()
... | Traceback (most recent call last):
File "/tmp/tmpzq7a1gct/tmpy1bzjug3.py", line 21, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s534908263 | p02265 | u027634846 | 1509547669 | Python | Python3 | py | Runtime Error | 30 | 8000 | 518 | from collections import deque
def order_each(orders):
linked = deque([])
for i in orders:
order = i[0]
if order == "insert":
linked.appendleft(i[1])
elif order == "delete":
linked.remove(i[1])
elif order == "deleteFirst":
linked.popleft()
... | Traceback (most recent call last):
File "/tmp/tmprwu7jey0/tmpnf1pvfwl.py", line 21, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s560372403 | p02265 | u846136461 | 1510300077 | Python | Python | py | Runtime Error | 10 | 6440 | 338 | n = int(raw_input())
A = []
for i in range(n):
com = raw_input().split()
if com[0] == "insert":
A.insert(0, int(com[1]))
elif com[0] == "delete":
index = A.index(int(com[1]))
del A[index]
elif com[0] == "deleteFirst":
del A[0]
else:
del A[-1]
for i in range(len(A)):
if i != len(A)-1:
print(A[i]),
e... | Traceback (most recent call last):
File "/tmp/tmplj9_qtct/tmpc1xea0co.py", line 1, in <module>
n = int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s263891970 | p02265 | u846136461 | 1510300567 | Python | Python | py | Runtime Error | 0 | 0 | 417 | n = int(raw_input())
A = []
for i in range(n):
com = raw_input().split()
if com[0][0] == "i": #com[0] == "insert"
A.insert(0, int(com[1]))
elif com[0][6] == " ": #com[0] == "delete"
if int(com[1]) in A:
index = A.index(int(com[1]))
del A[index]
elif com[0][6] == "F": #com[0] == "deleteFirst"
del A[0]
... | Traceback (most recent call last):
File "/tmp/tmp7g82747e/tmpgng89rls.py", line 1, in <module>
n = int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s477189593 | p02265 | u027634846 | 1510385411 | Python | Python3 | py | Runtime Error | 30 | 7924 | 768 | from collections import deque
def insert(linked, x):
if x not in linked:
linked.appendleft(x)
return linked
def delete(linked, x):
if x in linked:
linked.remove(x)
return linked
def deleteFirst(linked):
del linked[0]
return linked
def deleteLast(linked):
del li... | Traceback (most recent call last):
File "/tmp/tmpmxsc19dy/tmp82bc79u5.py", line 27, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s692286892 | p02265 | u311946635 | 1511846471 | Python | Python3 | py | Runtime Error | 20 | 5596 | 313 | k = int(input())
l=[]
x=[]
for i in range(k):
buff = input()
if "deleteFirst" in buff:
x.pop(0)
elif "deleteLast" in buff:
x.pop(len(x)-1)
elif "insert" in buff:
x.insert(0, list(buff).pop())
elif "delete" in buff:
x.remove(list(buff).pop())
print(" ".join(x)) | Traceback (most recent call last):
File "/tmp/tmprbubleeb/tmppm9k6kht.py", line 1, in <module>
k = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s159666428 | p02265 | u928329738 | 1512244989 | Python | Python3 | py | Runtime Error | 30 | 5600 | 319 | n = int(input())
dlist = []
for i in range(n):
code = input().split()
if code[0] == "insert":
dlist.insert(0,code[1])
if code[0] == "delete":
dlist.remove(code[1])
if code[0] == "deleteFirst":
dlist.pop(0)
if code[0] == "deleteLast":
dlist.pop()
print(*dlist,sep=" ") | Traceback (most recent call last):
File "/tmp/tmpwleajigj/tmp52acyqkq.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s938927003 | p02265 | u311946635 | 1512283324 | Python | Python3 | py | Runtime Error | 30 | 6000 | 368 | from collections import deque
if __name__ == '__main__':
n = int(input())
L = deque()
for i in range(n):
cmdline = input().split()
if cmdline[0] == "insert":
L.appendleft(cmdline[1])
elif cmdline[0] == "delete":
L.remove(cmdline[1])
elif cmdline[0] == "deleteFirst":
L.popleft()
elif cmdline[0] ... | Traceback (most recent call last):
File "/tmp/tmpgynp6zh2/tmpowhfa8md.py", line 4, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s223080195 | p02265 | u662418022 | 1516445298 | Python | Python3 | py | Runtime Error | 0 | 0 | 1669 | # -*- coding: utf-8 -*-
class Node(object):
def __init__(self, key, prev=None, nex=None):
self.key = key
self.prev = prev
self.next = nex
class DoublyLinkedLiset(object):
def __init__(self):
self.nil = Node(None)
self.nil.next = self.nil
self.nil.prev = self... | Traceback (most recent call last):
File "/tmp/tmppx2p64o2/tmptn5j4cbo.py", line 57, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s210857389 | p02265 | u662418022 | 1516448912 | Python | Python3 | py | Runtime Error | 30 | 6000 | 475 | # -*- coding: utf-8 -*-
from collections import deque
if __name__ == '__main__':
n = int(input())
L = deque()
for _ in range(n):
command = input().split(" ")
if command[0] == "insert":
L.appendleft(command[1])
elif command[0] == "delete":
L.remove(command[1... | Traceback (most recent call last):
File "/tmp/tmp3azaupa8/tmph1ytluzc.py", line 6, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s651087934 | p02265 | u426534722 | 1516453114 | Python | Python3 | py | Runtime Error | 0 | 0 | 431 | import sys
from collections import deque
readline = sys.stdin.readline
dq = deque()
for _ in range(int(input())):
ss = readline()
if ss == "deleteFirst":
del dq[0]
elif ss == "deleteLast":
del dq[-1]
else:
c, s = ss.split()
s = int(s)
if c == "insert":
... | Traceback (most recent call last):
File "/tmp/tmpe4ejgpct/tmp0d0h57xo.py", line 5, in <module>
for _ in range(int(input())):
^^^^^^^
EOFError: EOF when reading a line
| |
s095140231 | p02265 | u150984829 | 1516516502 | Python | Python3 | py | Runtime Error | 20 | 5596 | 174 | s=[]
for _ in range(int(input())):
e=input()
if e[0]=='i':s=[e.split()[1]]+s
else:
n=len(s)
if n==6:s.remove(e.split()[1])
elif n%2:s=s[1:]
else:s.pop()
print(*s)
| Traceback (most recent call last):
File "/tmp/tmp74_xl5lb/tmpndx6jbux.py", line 2, in <module>
for _ in range(int(input())):
^^^^^^^
EOFError: EOF when reading a line
| |
s967755757 | p02265 | u150984829 | 1516518896 | Python | Python3 | py | Runtime Error | 20 | 5596 | 171 | s=[]
for _ in range(int(input())):
e=input()
if'i'==e[0]:s=[e.split()[1]]+s
else:
if' '==e[6]:s.remove(e.split()[1])
elif len(e)%2:s=s[1:]
else:s.pop()
print(*s)
| Traceback (most recent call last):
File "/tmp/tmpv04kwt2b/tmpy5hsy9ho.py", line 2, in <module>
for _ in range(int(input())):
^^^^^^^
EOFError: EOF when reading a line
| |
s628343459 | p02265 | u749243807 | 1516942792 | Python | Python3 | py | Runtime Error | 0 | 0 | 2829 | class Node(object):
def __init__(self, num, prev = None, nxt = None):
self.num = num;
self.prev = prev;
self.nxt = nxt;
class Double_Linked_List(object):
def __init__(self):
self.first = self.last = None;
def insert(self, num):
node = Node(num);
first = self... | Traceback (most recent call last):
File "/tmp/tmpxp_p04_5/tmpjx3x010j.py", line 98, in <module>
main();
^^^^^^
File "/tmp/tmpxp_p04_5/tmpjx3x010j.py", line 77, in main
count = int(input());
^^^^^^^
EOFError: EOF when reading a line
| |
s714685800 | p02265 | u742466022 | 1517129252 | Python | Python3 | py | Runtime Error | 30 | 6004 | 531 | from collections import deque
n=int(input())
command=[0 for i in range(n)]
k=[0 for i in range(n)]
k_queue= deque([])
for i in range(n):
s=input()
if s=="deleteFirst" or s=="deleteLast":
command[i],k[i]=s,0
else:
command[i],k[i]=s.split()
if command[i]=="insert":
k_queue.a... | Traceback (most recent call last):
File "/tmp/tmp6s3nrtil/tmp4tw661e2.py", line 3, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s743155473 | p02265 | u011621222 | 1517470009 | Python | Python3 | py | Runtime Error | 0 | 0 | 720 | import collections
#getting input
commands = []
while True:
try:
line = str(input())
except EOFError:
break
commands.append(line)
commands.pop(0)
'''while True:
line = input()
if line == '': break
commands.append(line)
commands.pop(0)'''
#executing commands
output = collectio... | Traceback (most recent call last):
File "/tmp/tmpvlzp1wsd/tmpfpxwsdd6.py", line 11, in <module>
commands.pop(0)
IndexError: pop from empty list
| |
s658084827 | p02265 | u650712316 | 1518150595 | Python | Python3 | py | Runtime Error | 30 | 6000 | 377 | # coding: UTF-8
from collections import deque
dll = deque()
n = int(input())
for _ in range(n):
raw = input().split()
command = raw[0]
if command == 'delete':
value = raw[1]
dll.remove(value)
elif command == 'insert':
value = raw[1]
dll.appendleft(value)
elif command == 'deleteFirst':
d... | Traceback (most recent call last):
File "/tmp/tmp07q76c6d/tmpu_ba5_5y.py", line 6, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s064100654 | p02265 | u508054630 | 1520593298 | Python | Python3 | py | Runtime Error | 30 | 5600 | 335 | n = int(input())
L = []
i = 0
while i < n:
s = list(map(str, input().split(' ')))
if s[0] == 'insert':
L.insert(0, int(s[1]))
elif s[0] == 'delete':
L.remove(int(s[1]))
elif s[0] == 'deleteFirst':
del L[0]
elif s[0] == 'deleteLast':
del L[-1]
i += 1
print(' '.join... | Traceback (most recent call last):
File "/tmp/tmpmhbfz1u8/tmppcqvpavj.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s321565280 | p02265 | u702650865 | 1521859689 | Python | Python3 | py | Runtime Error | 0 | 0 | 585 |
import sys
#import numpy as np
import copy
N = int(input())
list = []
for i in range(N):
# insert, delete, deleteFirst, deleteLast
line = input().rstrip().split(' ')
if line[0]=='insert':
list.append((int)(line[1]))
elif line[0]=='delete':
for j in range(len(list)):
if lis... | Traceback (most recent call last):
File "/tmp/tmpkg5li76_/tmpxu640sm8.py", line 6, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s857165269 | p02265 | u702650865 | 1521860040 | Python | Python3 | py | Runtime Error | 0 | 0 | 585 |
import sys
#import numpy as np
import copy
N = int(input())
list = []
for i in range(N):
# insert, delete, deleteFirst, deleteLast
line = input().rstrip().split(' ')
if line[0]=='insert':
list.append((int)(line[1]))
elif line[0]=='delete':
for j in range(len(list)):
if lis... | Traceback (most recent call last):
File "/tmp/tmpl9yk2t94/tmpx02y99aa.py", line 6, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s700827841 | p02265 | u702650865 | 1521861796 | Python | Python3 | py | Runtime Error | 30 | 6004 | 1237 |
import sys
#import numpy as np
from collections import deque
#import collections
N = int(input())
list = deque()
for i in range(N):
# insert, delete, deleteFirst, deleteLast
line = input().rstrip().split(' ')
if line[0]=='insert':
#list.append((int)(line[1]))
list.appendleft((int)(line[... | Traceback (most recent call last):
File "/tmp/tmpldfh9cpy/tmpqvmki3p8.py", line 7, in <module>
N = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s420216721 | p02265 | u702650865 | 1521862753 | Python | Python3 | py | Runtime Error | 0 | 0 | 1323 |
import sys
#import numpy as np
from collections import deque
#import collections
N = int(input())
list = deque()
for i in range(N):
# insert, delete, deleteFirst, deleteLast
line = input().rstrip().split(' ')
if line[0][0]=='i':
#list.append((int)(line[1]))
list.appendleft((int)(line[1]... | File "/tmp/tmpc03kj_im/tmpredw4cio.py", line 18
else
^
SyntaxError: expected ':'
| |
s683063178 | p02265 | u009288816 | 1522501157 | Python | Python3 | py | Runtime Error | 4420 | 512788 | 1998 | import sys
class ListElement:
def __init__(self,num):
self.num = num
self.next = self.prev = None
class doubleLinkedList:
def __init__(self):
self.list = None
def insert(self,num):
temp = ListElement(num)
temp.next = self.list
self.list = temp
def delFir... | ||
s594504925 | p02265 | u009288816 | 1522501201 | Python | Python3 | py | Runtime Error | 4570 | 512788 | 1998 | import sys
class ListElement:
def __init__(self,num):
self.num = num
self.next = self.prev = None
class doubleLinkedList:
def __init__(self):
self.list = None
def insert(self,num):
temp = ListElement(num)
temp.next = self.list
self.list = temp
def delFir... | ||
s047927893 | p02265 | u566311709 | 1523352065 | Python | Python3 | py | Runtime Error | 0 | 0 | 252 | from collections import deque
d = deque()
for _ in range(int(input())):
a = input()
if "i" == a[0]: d.appendleft(int(a[1]))
elif "F" == a[6]: d.popleft()
elif "L" == a[6]: d.pop()
else:
try: d.remove(int(a[1]))
except: pass
print(*d)
| Traceback (most recent call last):
File "/tmp/tmpsaxif2m7/tmplavlz1zq.py", line 3, in <module>
for _ in range(int(input())):
^^^^^^^
EOFError: EOF when reading a line
| |
s562537643 | p02265 | u605879293 | 1523445841 | Python | Python3 | py | Runtime Error | 30 | 6000 | 347 | from collections import deque
n = int(input())
result = deque()
func = {'insert':result.appendleft,\
'delete':result.remove,\
'deleteFirst':result.popleft,\
'deleteLast':result.pop}
for i in range(n):
c = input().split()
if len(c) > 1:
func[c[0]](int(c[1]))
else:
fu... | Traceback (most recent call last):
File "/tmp/tmp260sdswu/tmpbmojfq31.py", line 3, in <module>
n = int(input())
^^^^^^^
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.