s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
stringlengths
1
5
memory
stringlengths
1
7
code_size
stringlengths
1
6
code
stringlengths
1
539k
s675569578
p02264
u564464686
1524819352
Python
Python3
py
Runtime Error
0
0
391
s=0 A=input().split() n=(int)(A[0]) t=(int)(A[1]) x=[0 for i in range(2*n)] for i in range(n): B=input().split() k=2*i x[k]=(B[0]) x[k+1]=(int)(B[1]) while len(x)>0: s=x[1]-t if s>0: sum+=t x.append(x[0]) x.append(s) del x[0] del x[0] if s<=0: ...
s021068423
p02264
u150984829
1524896392
Python
Python3
py
Runtime Error
0
0
278
import sys from collections import deque def m(): s=sys.stdin.readlines() q=int(s[0].split()[1]) f=lambda x,y:(x,int(y)) d=deque(f(*e.split())for e in s[1:]) t,a=0,[] while d: k,v=d.popleft() if v>q:v-=q;t+=q;d+[[k,v]] else:t+=v;a+=[f'{k} {t}\n'] print(a[:-1]) m()
s485966979
p02264
u055885332
1524900007
Python
Python3
py
Runtime Error
0
0
483
#16D8101014F 久留米 竜之介 Python from collections import deque n,time=map(int,input().split()) timenow = 0 p=[] q=[] queue=[] #p1,p2.... Queue=[] #time for i in range (n): line=input().split() q.append(int(line.pop())) p.append(line.pop()) print(len(p)) while len(p) is not 0: Ptmp=p.deque() if Ptmp<=100: timenow+=P...
s459091030
p02264
u055885332
1524902084
Python
Python3
py
Runtime Error
20
5600
626
#16D8101014F 久留米 竜之介 Python n,time=map(int,input().split()) timenow = 0 p=[] q=[] queue=[] #p1,p2.... Queue=[] #time for i in range (n): line=input().split() q.append(int(line.pop())) p.append(line.pop()) head=0 tail=len(p)-1 while head is not tail: #print(p) #print(q) #print(head,tail) Ptmp=q[head] if Ptmp<=...
s797547289
p02264
u724548524
1524975790
Python
Python3
py
Runtime Error
0
0
363
n, p = map(int, input().split()) ps = [] for i in range(n): ps.append(input().split()) ps[i][1] = int(ps[i][1]) t = 0 i = 0 j = 0 while len(ps) > 0: if ps[i][1] > p: ps[i][1] -= p t += p i = (i + 1) % n elif ps[i][1] != 0: t += ps[i][1] print("{0} {1}".format(ps[i...
s950370922
p02264
u255317651
1524991574
Python
Python3
py
Runtime Error
0
0
1045
# -*- coding: utf-8 -*- """ Created on Sun Apr 29 14:42:43 2018 @author: maezawa """ def print_array(g): ans = str(g[0]) if len(g) > 1: for i in range(1,len(g)): ans += ' '+str(g[i]) print(ans) name=[] time=[] current_time = 0 n, q = list(map(int, input().split())) for i in range(n)...
s949157861
p02264
u255317651
1524991605
Python
Python3
py
Runtime Error
0
0
1045
# -*- coding: utf-8 -*- """ Created on Sun Apr 29 14:42:43 2018 @author: maezawa """ def print_array(g): ans = str(g[0]) if len(g) > 1: for i in range(1,len(g)): ans += ' '+str(g[i]) print(ans) name=[] time=[] current_time = 0 n, q = list(map(int, input().split())) for i in range(n)...
s720912149
p02264
u255317651
1524991710
Python
Python3
py
Runtime Error
0
0
1044
# -*- coding: utf-8 -*- """ Created on Sun Apr 29 14:42:43 2018 @author: maezawa """ def print_array(g): ans = str(g[0]) if len(g) > 1: for i in range(1,len(g)): ans += ' '+str(g[i]) print(ans) name=[] time=[] current_time = 0 n, q = list(map(int, input().split())) for i in range(n)...
s689753925
p02264
u255317651
1524991923
Python
Python3
py
Runtime Error
0
0
1040
# -*- coding: utf-8 -*- """ Created on Sun Apr 29 14:42:43 2018 @author: maezawa """ def print_array(g): ans = str(g[0]) if len(g) > 1: for i in range(1,len(g)): ans += ' '+str(g[i]) print(ans) name=[] time=[] current_time = 0 n, q = list(map(int, input().split())) for i in range(n)...
s102187155
p02264
u255317651
1524992013
Python
Python3
py
Runtime Error
0
0
1040
# -*- coding: utf-8 -*- """ Created on Sun Apr 29 14:42:43 2018 @author: maezawa """ def print_array(g): ans = str(g[0]) if len(g) > 1: for i in range(1,len(g)): ans += ' '+str(g[i]) print(ans) name=[] time=[] current_time = 0 n, q = list(map(int, input().split())) for i in range(n)...
s654923190
p02264
u064313887
1525094404
Python
Python3
py
Runtime Error
0
0
794
class Process: def __init__(self,n,head,tail): self.n = n self.head = head self.tail = tail self.name = [] self.time = [] def void enqueue(self,x): self.data = x tail = (tail+1) % n def dequeue(self): self.x = self.[head] head = (head+1) % n return x ...
s576149476
p02264
u405027099
1525174696
Python
Python3
py
Runtime Error
0
0
417
a=input().split() n=int(a[0]) q=int(a[1]) b=[0 for i in range(2*n)] cnt=0 for i in range(n): B=input().split() b[2*i]=B[0] b[2*i+1]=int(B[1]) while len(b)>0: if b[1]-100>0: tmp1=b[0] tmp2=b[1]-100 del b[0] del b[0] b.append(tmp1) b.append(tmp2) cnt...
s931750062
p02264
u088372268
1525355002
Python
Python3
py
Runtime Error
20
5604
1490
class Queue(): def __init__(self, size=10): self.queue = [None] * size self.head = self.tail = 0 self.MAX = size self.num_items = 0 def is_empty(self): return self.num_items == 0 def is_full(self): return self.num_items == self.MAX def enqueue(self, x):...
s721949024
p02264
u810922275
1527034662
Python
Python3
py
Runtime Error
0
0
347
from collections import deque import numpy as np n,q=map(int,input().split()) s=0 queue=deque([]) for i in range(n): name,time=input().split() queue.append([name,int(time)]) while len(queue)>0: t=queue.popleft() if t[1]>q: s=s+q t[1]=t[1]-q queue.append(t) else: s=s+...
s567931957
p02264
u810922275
1527034670
Python
Python
py
Runtime Error
0
0
347
from collections import deque import numpy as np n,q=map(int,input().split()) s=0 queue=deque([]) for i in range(n): name,time=input().split() queue.append([name,int(time)]) while len(queue)>0: t=queue.popleft() if t[1]>q: s=s+q t[1]=t[1]-q queue.append(t) else: s=s+...
s336472898
p02264
u657361950
1529630782
Python
Python3
py
Runtime Error
0
0
2099
import java.util.Scanner; public class Main { static class Node<E> { public E value; public Node<E> next; public Node(E value) { this.value = value; this.next = null; } } static class SimpleQueue<E> { private Node<E> head; private Node<E> tail; int size; public SimpleQueue() { siz...
s553533115
p02264
u153665391
1529886683
Python
Python3
py
Runtime Error
0
0
894
process_num, qms = map(int, input().split()) raw_procs = [input() for i in range(process_num)] if __name__ == '__main__': procs = [] for row in raw_procs: name, time = row.split() procs.push = { "name": name, "time": int(time), } total_time = 0 current_...
s234344135
p02264
u682153677
1530423336
Python
Python3
py
Runtime Error
0
0
577
# -*- coding: utf-8 -*- def simu(pro, q): end_time = 0 while bool(pro): if pro[1] > q: end_time += q pro.append(pro[0]) pro.append(pro[1] - q) pro.pop(0) pro.pop(1) elif pro[1] <= q: end_time += pro[1] print(...
s367531533
p02264
u682153677
1530423797
Python
Python3
py
Runtime Error
0
0
547
# -*- coding: utf-8 -*- def simu(pro, q): end_time = 0 while bool(pro): if pro[1] > q: end_time += q pro.append(pro[0]) pro.append(pro[1] - q) pro.pop(0) * 2 elif pro[1] <= q: end_time += pro[1] print('{0} {1...
s403653552
p02264
u682153677
1530423882
Python
Python3
py
Runtime Error
0
0
547
# -*- coding: utf-8 -*- def simu(pro, q): end_time = 0 while bool(pro): if pro[1] > q: end_time += q pro.append(pro[0]) pro.append(pro[1] - q) pro.pop(0) * 2 elif pro[1] <= q: end_time += pro[1] print('{0} {1...
s710626654
p02264
u912237403
1373785675
Python
Python
py
Runtime Error
0
0
1212
#coding: utf-8 class Queue: class Cell: def __init__(self,data,link=None): self.data=data self.link=link def __init__(self): self.size=0 self.front=None self.rear=None def enqueue(self,x): if self.size==0: self.front = self.r...
s467279928
p02264
u912237403
1373789590
Python
Python
py
Runtime Error
0
0
1233
#coding: utf-8 import sys class Queue: class Cell: def __init__(self, x, y = None): self.data = x self.next = y def __init__(self): self.size = 0 self.rear = None def enqueue(self, x): if self.size == 0: self.rear = Queue.Cell(x) ...
s112267070
p02264
u633068244
1395990682
Python
Python
py
Runtime Error
0
0
323
n,q = map(int, raw_input().split()) que = [map(str, raw_input().split()) for i in range(n)] for i in range(n):que[i][1] = int(que[i][1]) mxt = sum([y for x,y in que]) t = 0 i = 0 while t < mxt: i %= n c = que[i][1] if c <= q: t += c que.pop(i) n -= 1 print a[0],t else: t += q que[i][1] = c - q i +...
s996177350
p02264
u633068244
1395990886
Python
Python
py
Runtime Error
0
0
334
n,q = map(int, raw_input().split()) que = [map(str, raw_input().split()) for i in range(n)] for i in range(n):que[i][1] = int(que[i][1]) mxt = sum([y for x,y in que]) t = 0 i = 0 while t < mxt: if que[i][1] <= q: t += que[i][1] que.pop(i) n -= 1 print que[i][0],t else: t += q que[i][1] = que[i][1] - q...
s650015596
p02264
u633068244
1395991660
Python
Python
py
Runtime Error
0
0
382
n,q = map(int, raw_input().split()) que = [map(str, raw_input().split()) for i in range(n)] for i in range(n):que[i][1] = int(que[i][1]) mxt = sum([y for x,y in que]) t = 0 i = 0 while t < mxt: if i = n: i = 0 if que[i][1] <= q: t += que[i][1] print que[i][0],t que.pop(i) n -= 1 ...
s764533521
p02265
u007270338
1531051351
Python
Python3
py
Runtime Error
20
5616
1315
#coding:utf-8 dic = {} nil = -1 class Doubly: def __init__(self,key,l=nil,r=nil): self.l = l self.r = r self.key = key def Insert(self,key): obj = Doubly(key) obj.l = fake fakeR = fake.r fake.r = obj obj.r = fakeR fakeR.l = obj di...
s793616428
p02265
u007270338
1531051910
Python
Python3
py
Runtime Error
20
5616
1440
#coding:utf-8 dic = {} nil = -1 class Doubly: def __init__(self,key,l=nil,r=nil): self.l = l self.r = r self.key = key def Insert(self,key): obj = Doubly(key) obj.l = fake fakeR = fake.r fake.r = obj obj.r = fakeR fakeR.l = obj if...
s560247241
p02265
u500386459
1531127038
Python
Python3
py
Runtime Error
0
0
295
list = [] count = int(input()) for ver in range(count): try: conditions,num = input().split() except ValueError: print(conditions) if(conditions == "insert"): list.append(num) elif(conditions == "delete"): list.remove(num) for ver in range(len(list)): print(list[ver],end=" ")
s454318986
p02265
u500386459
1531127095
Python
Python3
py
Runtime Error
0
0
306
list = [] count = int(input()) for ver in range(count): try: conditions,num = input().split() except ValueError: print(conditions) if(conditions == "insert"): list.append(num) elif(conditions == "delete"): list.remove(num) for ver in range(len(list)): print(list[ver],end=" ") print('/n')
s965999438
p02265
u500386459
1531127200
Python
Python3
py
Runtime Error
0
0
304
list = [] count = int(input()) for ver in range(count): try: conditions,num = input().split() except ValueError: print(conditions) if(conditions == "insert"): list.append(num) elif(conditions == "delete"): list.remove(num) for ver in range(len(list)): print(list[ver],end=" ") print("")
s290772812
p02265
u500386459
1531127407
Python
Python3
py
Runtime Error
0
0
407
list = [] count = int(input()) for ver in range(count): try: conditions,num = input().split() except ValueError: print(conditions) if(conditions == "insert"): list.append(num) elif(conditions == "delete"): list.remove(num) elif(conditions == "insertFirst"): list.insert(0,num) elif(conditions == "dele...
s704796503
p02265
u500386459
1531127512
Python
Python3
py
Runtime Error
0
0
400
list = [] count = int(input()) for ver in range(count): try: conditions,num = input().split() except ValueError: print(conditions) if(conditions == "insert"): list.append(num) elif(conditions == "delete"): list.remove(num) elif(conditions == "deleteFirst"): del list[0] elif(conditions == "deleteLast"...
s148793184
p02265
u908984540
1531206920
Python
Python3
py
Runtime Error
30
5996
448
from collections import deque if __name__ == '__main__': n = int(input()) dll = deque() for _ in range(n): command = input().split() if command[0] == 'insert': dll.appendleft(command[1]) elif command[0] == 'delete': dll.remove(command[1]) elif command...
s804495357
p02265
u564464686
1531904721
Python
Python3
py
Runtime Error
0
0
401
n=int(input()) list=[] for i in range(n): A=input().split() if A[0]=="insert": a=int(A[1]) list.insert(0,a) elif A[0]=="delete": a=int(A[1]) list.remove(a) else: if A[0]=="deleteFirst": list.pop(0) elif A[0]=="deleteLast": n=len(lis...
s454622402
p02265
u564464686
1531905042
Python
Python3
py
Runtime Error
20
5600
430
n=int(input()) list=[] for i in range(n): A=input().split() if A[0]=="insert": a=int(A[1]) list.insert(0,a) elif A[0]=="delete": a=int(A[1]) list.remove(a) else: if A[0]=="deleteFirst": list.pop(0) elif A[0]=="deleteLast": n=len(lis...
s516665464
p02265
u256678932
1534836264
Python
Python3
py
Runtime Error
20
5632
2338
class DoublyLinkedListNode: def __init__(self, num): self.num = num self.next = None self.prev = None def setNext(self, node): self.next = node def setPrev(self, node): self.prev = node def getNum(self): return self.num def getNext(self): ...
s433553240
p02265
u308033440
1535084713
Python
Python3
py
Runtime Error
0
0
658
from collections import deque # 命令数入力 n = int(input()) # 命令入力 order_list = [input().split() for i in range(n)] # 双方向連結リスト doubly_linked_list = deque() for _ in range(n): #order = input().split() if order[0] == "insert": doubly_linked_list.appendleft(order[1]) elif order[0] == "del...
s431065712
p02265
u581154076
1535100725
Python
Python3
py
Runtime Error
30
6004
401
from collections import deque d = deque() for _ in range(int(input())): s = input() try: com, val = s.split() val = int(val) except ValueError: com = s if com == 'insert': d.appendleft(val) elif com == 'delete': d.remove(val) elif com == 'deleteFirst...
s469796740
p02265
u665238221
1535608092
Python
Python3
py
Runtime Error
30
5996
303
from collections import deque q = deque() for _ in range(int(input())): c, *k = input().split() k = k[0] if k else None if c == 'insert': q.appendleft(k) elif c == 'delete': q.remove(k) elif c == 'deleteFirst': q.popleft() else: q.pop() print(*q)
s038879995
p02265
u665238221
1535608633
Python
Python3
py
Runtime Error
0
0
363
from collections import deque q = deque() for _ in range(int(input())): c, *k = input().split() k = k[0] if k else None if c[0] == 'i': q.appendleft(k) elif c[0] == 'd': if c[6] == 'F': q.popleft() elif c[6] == 'L': q.pop() else: if k i...
s279897943
p02265
u665238221
1535609048
Python
Python3
py
Runtime Error
0
0
335
from collections import deque from sys import stdin q = deque() input() for s in stdin: c, *k = s.split() k = k[0] if k else None if c[0] == 'i': q.appendleft(k) elif c[0] == 'delete': if k in q: q.remove(k) if c == 'deleteFirst': q.popleft() else: q.p...
s328035170
p02265
u356729014
1535690686
Python
Python3
py
Runtime Error
0
0
363
n = map(int,input()) a = [input(sep=" ")[1]] for i in range(n): command = input() if(command == "deleteFirst"): a.pop(0) elif(command == "deleteLast"): a.pop() else: command,num = command.split(sep = " ") num = int(num) if(command == "delete"): a.remov...
s631595738
p02265
u356729014
1535691022
Python
Python3
py
Runtime Error
0
0
421
n = map(int,input()) a = [int(input().split(sep=" ")[1])] for i in range(n): command = input() if(command == "deleteFirst"): a.pop(0) elif(command == "deleteLast"): a.pop() else: command,num = command.split(sep = " ") num = int(num) if(command == "delete"): ...
s269004143
p02265
u356729014
1535691099
Python
Python3
py
Runtime Error
0
0
425
n = map(int,input()) a = [int(input().split(sep=" ")[1])] for i in range(n - 1): command = input() if(command == "deleteFirst"): a.pop(0) elif(command == "deleteLast"): a.pop() else: command,num = command.split(sep = " ") num = int(num) if(command == "delete"): ...
s264750208
p02265
u356729014
1535692336
Python
Python3
py
Runtime Error
20
5592
463
n = int(input()) a = [int(input().split(sep=" ")[1])] for i in range(n - 1): command = input() if(command == "deleteFirst"): a.pop(0) elif(command == "deleteLast"): a.pop() else: command,num = command.split(sep = " ") num = int(num) if(command == "delete"): ...
s085204653
p02265
u554503378
1541050358
Python
Python3
py
Runtime Error
20
5608
425
n = int(input()) num_list = [] for _ in range(n): cmd = (input().split()) if cmd[0] == 'insert': num_list.insert(0,int(cmd[1])) elif cmd[0] == 'delete': idx = num_list.index(int(cmd[1])) del(num_list[idx]) elif cmd[0] == 'deleteFirst': del(num_list[0]) elif cmd[0] ...
s402519078
p02265
u554503378
1541051254
Python
Python3
py
Runtime Error
0
0
357
n = int(input()) num_list = [] for _ in range(n): cmd = (input().split()) if cmd[0] == 'insert': num_list.insert(0,cmd[1]) elif cmd[0] == 'delete': if cmd[1] in num_list: num_list.remove(cmd[0]) elif cmd[0] == 'deleteFirst': del(num_list[0]) else: num_l...
s340000591
p02265
u356729014
1545367294
Python
Python3
py
Runtime Error
0
0
2522
from sys import stdin import sys class node: def __init__(self,num,pre = None,nextnode = None): self.num = num self.prenode = pre self.nextnode = nextnode class doubly_linked_list: import sys begin_node = None end_node = None def insert(self,num): if(self.e...
s827312878
p02265
u803657704
1545889173
Python
Python3
py
Runtime Error
0
0
2372
import sys import time class NodeList: class Node: def __init__(self, left, x, right): self.key = x self.right = right self.left = left def __repr__(self): return str(self.key) def printDetail(self): print(str(se...
s056466203
p02265
u803657704
1545889390
Python
Python3
py
Runtime Error
0
0
2367
import sys import time class NodeList: class Node: def __init__(self, left, x, right): self.key = x self.right = right self.left = left def __repr__(self): return str(self.key) def printDetail(self): print(str(se...
s053085192
p02265
u771410206
1545962528
Python
Python3
py
Runtime Error
20
5608
357
n = int(input()) A = [list(map(str,input().split())) for _ in range(n)] B = [] for i in range(n): if A[i][0] == 'insert': B.insert(0,int(A[i][1])) elif A[i][0] == 'delete': B.remove(int(A[i][1])) elif A[i][0] == 'deleteFirst': del B[0] elif A[i][0] == 'deleteLast': del B...
s595672897
p02265
u065504661
1546168859
Python
Python3
py
Runtime Error
0
0
1267
class Node: def __init__(self, key): self._key = key self._prev = None self._next = None def list_search(head, key): cur = head._next while cur._key != None and cur._key != key: cur = cur._next return cur def initiation(): head = Node(None) head._prev = head head._next = head return head def de...
s418798158
p02265
u065504661
1546168867
Python
Python3
py
Runtime Error
0
0
1267
class Node: def __init__(self, key): self._key = key self._prev = None self._next = None def list_search(head, key): cur = head._next while cur._key != None and cur._key != key: cur = cur._next return cur def initiation(): head = Node(None) head._prev = head head._next = head return head def de...
s303954609
p02265
u874395007
1546434993
Python
Python3
py
Runtime Error
20
6012
661
from collections import deque n = int(input()) d = deque() for _i in range(n): line = input().split() order = line[0] if order in ('insert', 'delete'): key = int(line[1]) if order == 'insert': d.appendleft(key) elif order == 'delete': d.remove(key) elif order == 'deleteF...
s515533582
p02265
u809233245
1546475965
Python
Python3
py
Runtime Error
20
5608
376
n = int(input()) cmds = [input().split(' ') for _ in range(n)] dl_list = [] for cmd in cmds: if cmd[0] == 'insert': dl_list.insert(0, int(cmd[1])) elif cmd[0] == 'delete': dl_list.remove(int(cmd[1])) elif cmd[0] == 'deleteFirst': del dl_list[0] elif cmd[0] == 'deleteLast': ...
s753925998
p02265
u452220492
1551524744
Python
Python3
py
Runtime Error
0
0
169
n = int(input()) l = [] for i in range(n): c, d = input().split() if c[0] == 'i': l.append(d) else: l.remove(d) print(" ".join(sorted(l)))
s736819209
p02265
u452220492
1551525149
Python
Python3
py
Runtime Error
20
5592
314
n = int(input()) l = [] for i in range(n): s = input() if s == "deleteFirst": l.pop(0) continue if s == "deleteLast": l.pop() continue c, d = s.split() if c == 'insert': l.append(d) elif c == "delete": l.remove(d) print(" ".join(l[::-1]))
s185052488
p02265
u452220492
1551533130
Python
Python3
py
Runtime Error
20
5604
1178
class Node: def __init__(self, d, next): self.d = d self.next = next def __str__(self): if self.next is None: return "(" + self.d + ")" else: return "(" + self.d + "," + str(self.next) + ")" # import time n = int(input()) node = None for i in range(n): ...
s589604356
p02265
u799595944
1556788050
Python
Python3
py
Runtime Error
0
0
2117
class Node(): def __init__(self,value,prv,nxt): self.value = value self.prv = prv self.nxt = nxt class LinkedList(): def __init__(self,head,tail): self.head = head self.tail = tail def insert(self,value): if self.head == None: self.head = Node(v...
s564722441
p02265
u799595944
1556788613
Python
Python3
py
Runtime Error
30
5608
2304
class Node(): def __init__(self,value,prv,nxt): self.value = value self.prv = prv self.nxt = nxt class LinkedList(): def __init__(self,head,tail): self.head = head self.tail = tail def insert(self,value): if self.head == None: self.head = Node(v...
s808862834
p02265
u336705996
1559022641
Python
Python3
py
Runtime Error
0
0
287
n = int(input()) a = [input() for _ in range(n)] queue = [] for command in a: if 'insert 'in command: queue.append(command.replace('insert ', '')) elif 'delete 'in command: queue.remove(command.replace('delete ', '')) print(' '.join(map(str, reversed(queue)))
s482127124
p02265
u336705996
1559181547
Python
Python3
py
Runtime Error
30
6000
436
from collections import deque n = int(input()) a = [input() for _ in range(n)] queue = deque() for command in a: if 'insert 'in command: queue.append(command.replace('insert ', '')) elif 'delete 'in command: queue.remove(command.replace('delete ', '')) elif 'deleteFirst' in command: ...
s262932945
p02265
u822165491
1559291655
Python
Python3
py
Runtime Error
0
0
3055
class Node: def __init__(self, key, prev, next): self.key = key self.prev = prev self.next = next class MyDLL: def __init__(self): self.linkedlist = [] self.length = 0 def isEmpty(self): if self.length==0: return True return Fals...
s369664889
p02265
u822165491
1559374424
Python
Python3
py
Runtime Error
0
0
3769
class Node: def __init__(self, key, prev, next): self.key = key self.prev = prev self.next = next class MyDLL: def __init__(self): self.linkedlist = [] self.length = 0 def isEmpty(self): if self.length==0: return True return Fals...
s716776693
p02265
u566160059
1559403152
Python
Python3
py
Runtime Error
0
0
335
n = int(input()) commands = [input().split() for _ in range(n)] l = [] for com in commands: val = com[1] com = com[0] if com=='insert': l.insert(0, val) elif com=='delete': l.remove(val) elif com=='deleteFirst': l.pop(0) elif com=='deleteLast': l.pop() s = ' '.jo...
s811314578
p02265
u566160059
1559403546
Python
Python3
py
Runtime Error
20
5604
319
n = int(input()) commands = [input().split() for _ in range(n)] l = [] for com in commands: if com[0]=='insert': l.insert(0, com[1]) elif com[0]=='delete': l.remove(com[1]) elif com[0]=='deleteFirst': l.pop(0) elif com[0]=='deleteLast': l.pop() s = ' '.join(l) print(s)
s241512951
p02265
u566160059
1559403826
Python
Python3
py
Runtime Error
0
0
349
n = int(input()) commands = [input().split() for _ in range(n)] l = [] for com in commands: print(l) if com[0]=='insert': l.insert(0, com[1]) elif com[0]=='delete': try: l.remove(com[1]) elif com[0]=='deleteFirst': l.pop(0) elif com[0]=='deleteLast': l.po...
s081013215
p02265
u566160059
1559404745
Python
Python3
py
Runtime Error
0
0
407
from collections import deque n = int(input()) commands = [input().split() for _ in range(n)] l = deque([]) for com in commands: if com[0]=='insert': l.insert(0, com[1]) elif com[0]=='delete': try: l.remove(com[1]) except: pass elif com[0]=='deleteFirst': ...
s721013568
p02265
u566160059
1559407067
Python
Python3
py
Runtime Error
30
6004
357
from collections import deque n = int(input()) commands = [input() for _ in range(n)] # splitとかしてると間に合わない l = deque() for com in commands: if com[0]=='i': l.appendleft(com[7:]) elif com[6]=='F': l.popleft() elif com[6]=='L': l.pop() else: l.remove(com[7:]) s = ' '.join...
s001622452
p02265
u566160059
1559407102
Python
Python3
py
Runtime Error
30
6008
357
from collections import deque n = int(input()) commands = [input() for _ in range(n)] # splitとかしてると間に合わない l = deque() for com in commands: if com[0]=='i': l.appendleft(com[7:]) elif com[6]=='F': l.popleft() elif com[6]=='L': l.pop() else: l.remove(com[7:]) s = ' '.join...
s767513042
p02265
u822165491
1559449034
Python
Python3
py
Runtime Error
0
0
2537
class Node: def __init__(self, key): self.key = key self.prev = None self.next = None class MyDLL: def __init__(self): # 番兵:仮想的な先頭 self.sentinel = Node(None) self.sentinel.prev = self.sentinel self.sentinel.next = self.sentinel def insert(se...
s489061059
p02265
u535719732
1559567584
Python
Python3
py
Runtime Error
0
0
382
from collections import deque n = int(input()) dList = deque() for _ in range(n): op = list(map(str,input().split())) if(op[0] == "insert"): dList.appendleft(op[1]) elif(op[0] == "delete"): try: dList.remove(op[1]) except: pass elif(op[0] == "deleteFirst"): dList.popleft() eli...
s507764972
p02265
u135880652
1559568964
Python
Python3
py
Runtime Error
0
0
478
from collections import deque n = int(input()) dlist = deque() for i in range(n): arr = input().split() cmd = '' key = 0 cmd = arr[0] if len(arr) > 1: key = arr[1] if cmd == 'insert': dlist.appendleft(key) elif cmd == 'delete': try: dlist.remove(key) ...
s990645531
p02265
u319740114
1559584922
Python
Python3
py
Runtime Error
0
0
502
array = [] def func_insert(num): array.insert(0, num) def func_delete(num): array.remove(num) def func_deleteFirst(): array.pop(0) def func_deleteLast(): array.pop() n = int(input()) for _ in range(n): command, key = input().split() if command == 'insert': func_insert(key) elif...
s279304965
p02265
u319740114
1559585169
Python
Python3
py
Runtime Error
20
5600
519
array = [] def func_insert(num): array.insert(0, num) def func_delete(num): array.remove(num) def func_deleteFirst(): array.pop(0) def func_deleteLast(): array.pop() n = int(input()) for _ in range(n): command = input().split() if command[0] == 'insert': func_insert(command[1]) ...
s335152730
p02265
u507118101
1419911209
Python
Python
py
Runtime Error
20
4220
302
n = input() array = [] for i in range(n): inst = raw_input().split() if inst[0] == "insert": array.insert(0,inst[1]) if inst[0] == "delete": array.remove(inst[1]) if inst[0] == "deleteFirst": del array[0] if inst[0] == "deleteLast": del array[len(array)-1] print " ".join(i for i in array)
s083232437
p02265
u507118101
1420127021
Python
Python
py
Runtime Error
0
0
328
n = input() array = [] for i in range(n): inst = raw_input().split() if inst[0] == "insert": array.insert(0,inst[1]) if inst[0] == "delete": if inst[1] in array: array.remove(inst[1]) if inst[0] == "deleteFirst": array.pop[0] if inst[0] == "deleteLast": array.pop([len(array)-1]) print " ".join(i for i i...
s145182070
p02265
u507118101
1420127190
Python
Python
py
Runtime Error
0
0
326
n = input() array = [] for i in range(n): inst = raw_input().split() if inst[0] == "insert": array.insert(0,inst[1]) if inst[0] == "delete": if inst[1] in array: array.remove(inst[1]) if inst[0] == "deleteFirst": array.pop[0] if inst[0] == "deleteLast": array.pop(len(array)-1) print " ".join(i for i in ...
s135674345
p02265
u567380442
1421368695
Python
Python3
py
Runtime Error
30
6728
364
from collections import deque import sys dlist = deque() func = {'insert':dlist.appendleft, 'delete':dlist.remove, 'deleteFirst':dlist.popleft, 'deleteLast':dlist.pop} n = int(sys.stdin.readline()) for line in sys.stdin: command = line.split() if len(command) == 2: command[1] = int(command[1]) f...
s578387919
p02265
u481221703
1421636353
Python
Python
py
Runtime Error
0
0
304
n=int(raw_input()) l = [] for x in xrange(n): cmd, a = raw_input().split() cmd = str(cmd) a = int(a) if cmd is "insert": l.insert(0, a) elif cmd is "delete": l.pop(a) elif cmd is "deleteFirst": l.pop(0) elif cmd is "deleteLast": l.pop() print l
s925941852
p02265
u481221703
1421636503
Python
Python
py
Runtime Error
0
0
307
n=int(raw_input()) l = [] for x in xrange(n): cmd = raw_input().split() cmd = str(cmd[0]) if cmd is "insert": l.insert(0, int(cmd[1]) elif cmd is "delete": l.pop(int(cmd[1]) elif cmd is "deleteFirst": l.pop(0) elif cmd is "deleteLast": l.pop() print l
s495709897
p02265
u481221703
1421640152
Python
Python
py
Runtime Error
0
0
327
n=int(raw_input()) l = [] for x in xrange(n): msg = raw_input().split() cmd = str(msg[0]) if cmd == "insert": l.insert(0, int(msg[1])) elif cmd == "delete": l.pop(int(msg[1])) elif cmd == "deleteFirst": l.pop(0) elif cmd == "deleteLast": l.pop() for x in l: p...
s201237298
p02265
u481221703
1421640435
Python
Python
py
Runtime Error
20
4212
320
n=int(raw_input()) l = [] for x in xrange(n): msg = raw_input().split() cmd = msg[0] if cmd == "insert": l.insert(0, msg[1]) elif cmd == "delete": l.remove(msg[1]) elif cmd == "deleteFirst": l.pop(0) elif cmd == "deleteLast": l.pop() for x in l: print int(x),
s226619569
p02265
u481221703
1421640893
Python
Python
py
Runtime Error
20
4216
315
n=int(raw_input()) l = [] for x in xrange(n): msg = raw_input().split() cmd = msg[0] if cmd == "insert": l.insert(0, msg[1]) elif cmd == "delete": l.remove(msg[1]) elif cmd == "deleteFirst": l.pop(0) elif cmd == "deleteLast": l.pop() for x in l: print x,
s168585116
p02265
u481221703
1421645685
Python
Python
py
Runtime Error
0
0
308
n=int(raw_input()) l = [] for x in xrange(n): m = raw_input().split() cmd = m[0] if cmd == "insert": l.insert(0, m[1]) elif cmd == "delete": if msg[1] in l: l.remove(m[1]) elif cmd[7] == "F": l.pop(0) else: l.pop() for x in l: print x,
s263511193
p02265
u481221703
1421645972
Python
Python
py
Runtime Error
0
0
345
n=int(raw_input()) l = [] for x in xrange(n): m = raw_input().split() cmd = m[0][-4] if c == "s": l.insert(0, m[1]) elif c == "i": l.pop(0) elif c == "L": l.pop() else: try: l.remove(m[1]) except Exception, e: pass ...
s296034245
p02265
u879226672
1426873219
Python
Python
py
Runtime Error
10
4592
388
from collections import deque n=int(raw_input()) que = deque() for i in xrange(n): o = raw_input() if o == 'deleteFirst': del que[0] elif o == 'deleteLast': del que[-1] else: c,p = o.split() p = int(p) if c == 'insert': que.appendleft(p) elif c...
s251929031
p02265
u879226672
1426873679
Python
Python
py
Runtime Error
20
4596
412
# -*- coding: utf-8 -*- from collections import deque n=int(raw_input()) que = deque() for i in xrange(n): o = raw_input() if o == 'deleteFirst': del que[0] elif o == 'deleteLast': del que[-1] else: c,p = o.split() p = int(p) if c == 'insert': que.appe...
s836072404
p02265
u408260374
1431623040
Python
Python3
py
Runtime Error
30
6732
402
from collections import deque que = deque() for i in range(int(input())): command = input() if command == 'deleteFirst': que.popleft() elif command == 'deleteLast': que.pop() else: c, n = command.split() if c == 'insert': que.appendleft(int(n)) elif c ...
s722836916
p02265
u689297737
1432224208
Python
Python
py
Runtime Error
20
4344
2376
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_3_C # Doubly Linked List # Result: import sys class DoublyLikedList(object): def __init__(self): self.head = None self.tail = None def __str__(self): vals = [] pointer = self.head while pointer != None: ...
s452319717
p02265
u604774382
1433155300
Python
Python
py
Runtime Error
10
4216
298
n = int( raw_input( ) ) eles = [] for i in range( n ): op = raw_input( ).split( " " ) if "insert" == op[0]: eles.insert( 0, op[1] ) elif "delete" == op[0]: eles.remove( op[1] ) elif "deleteFirst" == op[0] : del eles[0] elif "deleteLast" == op[0]: eles.pop( ) print( " ".join( eles ) )
s073148789
p02265
u604774382
1433156909
Python
Python
py
Runtime Error
0
0
332
n = int( raw_input( ) ) eles = [] for i in range( n ): op = raw_input( ).split( " " ) if "insert" == op[0]: eles.insert( 0, op[1] ) elif "delete" == op[0]: for val in eles: if op[1] == val: eles.pop( i ) elif "deleteFirst" == op[0] : del eles[0] elif "deleteLast" == op[0]: eles.pop( ) print( " ".jo...
s449762330
p02265
u604774382
1433160553
Python
Python
py
Runtime Error
0
0
385
import sys n = int( raw_input( ) ) eles = [] lines = sys.stdin.readlines() for line in lines: op = line.split( " " ) op[1] = op[1].strip( ) if "insert" == op[0]: eles.insert( 0, op[1] ) elif "delete" == op[0]: if op[1].rstrip( ) in eles: eles.remove( op[1] ) elif "deleteFirst" == op[0] : del eles[0] eli...
s878451648
p02265
u604774382
1433160647
Python
Python
py
Runtime Error
0
0
359
import sys n = int( raw_input( ) ) eles = [] for line in sys.stdin: op = line.split( " " ) op[1] = op[1].strip( ) if "insert" == op[0]: eles.insert( 0, op[1] ) elif "delete" == op[0]: if op[1].rstrip( ) in eles: eles.remove( op[1] ) elif "deleteFirst" == op[0] : del eles[0] elif "deleteLast" == op[0]: ...
s069549351
p02265
u140201022
1433309728
Python
Python
py
Runtime Error
0
0
267
n=int(raw_input()) while n: n-=1 s=map(str,raw_input().split()) if s[0][0]=='i': ans.insert(0,s[1]) elif s[0][-3]=='r': ans.pop(0) elif s[0][-3]=='a': ans.pop(0) else: ans.remove(s[1]) for i in ans: print i,
s204536467
p02265
u140201022
1433311073
Python
Python
py
Runtime Error
0
0
347
ans=[] n=int(raw_input()) while n: n-=1 s=map(str,raw_input().split()) if s[0][0]=='i': ans.insert(0,s[1]) elif s[0][-3]=='r': ans.pop(0) elif s[0][-3]=='a': ans.pop() else: for i,j in enumerate(ans): if j==s[1]: ans.pop(i) ...
s519409197
p02265
u140201022
1433349313
Python
Python
py
Runtime Error
20
4596
348
import sys import collections n=int(raw_input()) ans=collections.deque() while n: n-=1 s=sys.stdin.readline().rstrip().split(' ') if s[0][0]=='i': ans.appendleft(s[1]) elif s[0][-3]=='r': ans.popleft() elif s[0][-3]=='a': ans.pop() else: ans.remove(s[1]) sys.stdou...
s849680961
p02265
u749752649
1434260375
Python
Python
py
Runtime Error
20
4236
710
class LinkedList(): def __init__(self): self.linked_list = [] def insert(self,x): self.linked_list.insert(0,x) def delete(self,x): self.linked_list.remove(x) def deleteFirst(self): self.linked_list.pop(0) def deleteLast(self): self.linked_list.pop(-1) def get(self): return ' '.join(s...
s677066717
p02265
u609407244
1436261798
Python
Python3
py
Runtime Error
30
6732
440
import collections n = int(input()) que = collections.deque() for _ in range(n): command = input() if 'insert' in command: command, num = command.split() que.appendleft(int(num)) elif 'deleteFirst' in command: que.popleft() elif 'deleteLast' in command: que.pop() elif...
s174167682
p02265
u609407244
1436263121
Python
Python3
py
Runtime Error
0
0
498
import sys import collections n = int(input()) que = collections.deque() for _ in range(n): command = sys.stdin.readline().strip() if 'i' == command[0]: command, num = command que.appendleft(num) elif 'deleteFirst\n' == command: que.popleft() elif 'deleteLast\n' == command: ...