Rezultati

Up. imeNalogaJezikRezultatČas oddaje
nevem-2019 Moderna umetnost Python 3 0/100Napaka med izvajanjem / ob izhodu (RTE) 09. maj '19 @ 19:02

Test Točke Porabljen spomin Porabljen čas Status
#1 [več] 0/20 8,680 MiB 0,000 s Napačen odgovor
Tvoj izhod:
​|@@@@@|
|@@@@@|
|@@@@@|
|@@@@@|
+-----+
10 pravokotnikov na belem
<<<EOF>>>
Pravilen izhod:
​|@@@@@|
|@@@@@|
|@@@@@|
|@@@@@|
+-----+
64 pravokotnikov na belem
<<<EOF>>>
#2 [več] 0/20 8,520 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 56, in <module>
    update(canvas, prav)
  File "source.py3", line 32, in update
    if canvas[j-1][i-1]<10:
IndexError: list index out of range
#3 [več] 0/20 8,688 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 56, in <module>
    update(canvas, prav)
  File "source.py3", line 32, in update
    if canvas[j-1][i-1]<10:
IndexError: list index out of range
#4 [več] 0/20 8,680 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 56, in <module>
    update(canvas, prav)
  File "source.py3", line 32, in update
    if canvas[j-1][i-1]<10:
IndexError: list index out of range
#5 [več] 0/20 8,672 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Traceback (most recent call last):
  File "source.py3", line 56, in <module>
    update(canvas, prav)
  File "source.py3", line 32, in update
    if canvas[j-1][i-1]<10:
IndexError: list index out of range

Ocenjevani program (art.py):
l=input().split()
w=int(l[0])
h=int(l[1])
n=int(l[2])

def prazan(w, h):
    l=[]
    for i in range(h):
        l1=[]
        for j in range(w):
            l1.append(0)
        l.append(l1)
    return l

canvas=prazan(10, 20)


def dobijprav(a, b, c, d):
    prav=[min(a, c), min(b, d), abs(a-c), abs(b-d)]
    #print(prav)
    return prav

def update(canvas, prav):
    if prav[0]<1:
        prav[0]=1
    if prav[1]<1:
        prav[1]=1
    
    for j in range(prav[0], min(prav[0]+prav[2]+1, w+1)):
        for i in range(prav[1], min(prav[1]+prav[3]+1, h+1)):
            if canvas[j-1][i-1]<10:
                canvas[j-1][i-1]+=1
    #print(canvas)

def draw(canvas, w, h):
    maxx=0
    d={0:' ', 1:'.', 2:':', 3:'-', 4:'=', 5:'+', 6:'*', 7:'$', 8:'#', 9:'%', 10:'@'}
    print('+' + '-'*w + '+')
    for j in range(h):
        red='|'
        for i in range(w):
            red=red+d[canvas[i][j]]
            if canvas[i][j]>maxx:
                maxx=canvas[i][j]
        red+='|'
        print(red)
    print('+' + '-'*w + '+')
    print(maxx, 'pravokotnikov na belem')
    


for i in range(n):
    l1=input().split()
    prav=dobijprav(int(l1[0]), int(l1[1]), int(l1[2]), int(l1[3]))
    update(canvas, prav)
draw(canvas, w, h)