Rezultati

Up. imeNalogaJezikRezultatČas oddaje
Muf Prehitevanje Python 3 0/100Napaka med izvajanjem / ob izhodu (RTE) 04. okt '18 @ 19:17

Test Točke Porabljen spomin Porabljen čas Status
#1 0/16 10,133 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 41, in <module>
    start.prev = None
AttributeError: 'NoneType' object has no attribute 'prev'
#2 0/16 10,137 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 41, in <module>
    start.prev = None
AttributeError: 'NoneType' object has no attribute 'prev'
#3 0/17 10,215 MiB 0,000 s Napačen odgovor
Tvoj izhod:
​aoopuhnpkp
aqvklyvmjs
vfaiesmibf
pjdziyyjop
mbhsodapop
Pravilen izhod:
​jvckhqlmxo
nephvkhmeq
aoopuhnpkp
aqvklyvmjs
vfaiesmibf
#4 0/17 12,691 MiB 1,181 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 41, in <module>
    start.prev = None
AttributeError: 'NoneType' object has no attribute 'prev'
#5 0/17 67,184 MiB 3,857 s Napačen odgovor
Tvoj izhod:
​saxtiqgnzc
wxcweekhak
kdwouwczhc
nephvkhmeq
<<<EOF>>>
Pravilen izhod:
​kafqveegbs
saxtiqgnzc
wxcweekhak
kdwouwczhc
nephvkhmeq
pkcxxcwnqw
qalsgworym
kndxntnvyv
zgcbiusoet
sdzhgyfhmn
#6 0/17 10,281 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 41, in <module>
    start.prev = None
AttributeError: 'NoneType' object has no attribute 'prev'

Ocenjevani program (asdasd.py):
import copy


def izpis():
    temp = start
    i = 0
    while temp != None:
        print(temp.name)
        temp = temp.next
        i+=1
        if i ==10:
            return

class person:
    def __init__(self, name, prev=None, nexty=None):
        self.name = name
        self.next = nexty
        self.prev = prev
# start -> [gajser cai nagl neki] <- end
#           1st    2nd  3rd  4th
count = int(input())-1
imeme = input()
lut = {}
start = person(imeme)
lut[imeme] = start
end = start

for i in range(count):
    imeme = input()
    end = person(imeme, end)
    end.prev.next = end
    lut[imeme] = end

for i in range(int(input())):
    kdo, koga = input().split()
    kdo_ptr = lut[kdo]
    koga_ptr = lut[koga]
    # If first falls
    if (kdo_ptr.prev == None):
        start = kdo_ptr.next
        start.prev = None
    elif (kdo_ptr.next == None):
        end = kdo_ptr.prev
        end.next = None
    else:
        kdo_ptr.prev.next = kdo_ptr.next
        kdo_ptr.next.prev = kdo_ptr.prev
    

    kdo_ptr.next = koga_ptr
    if koga_ptr.prev == None:

        kdo_ptr.prev = None
        start = kdo_ptr
    else:
        kdo_ptr.prev = koga_ptr.prev
        koga_ptr.prev.next = kdo_ptr
        koga_ptr.prev = kdo_ptr
izpis()