Rezultati

Up. imeNalogaJezikRezultatČas oddaje
moh-in-o-oklepajfenikszaklepaj-2019 Moderna umetnost Python 3 100/100OK 09. maj '19 @ 18:13

Test Točke Porabljen spomin Porabljen čas Status
#1 [več] 20/20 8,672 MiB 0,000 s OK
#2 [več] 20/20 8,754 MiB 0,000 s OK
#3 [več] 20/20 8,570 MiB 0,000 s OK
#4 [več] 20/20 8,570 MiB 0,000 s OK
#5 [več] 20/20 8,637 MiB 0,000 s OK

Ocenjevani program (moderna_umetnost.py):
w, h, n = map(int, input().split())
matrika = [[0 for _ in range(w)] for _ in range(h)]
st = 0
simboli = ' .:-=+*$#%@'
for _ in range(n):
    a, b, c, d = [x - 1 for x in map(int, input().split())]
    if a > c:
        a, c = c, a
    if b > d:
        b, d = d, b
    if a >= w or c < 0 or b >= h or d < 0:
        continue
    a = max(0, min(a, w-1))
    c = max(0, min(c, w-1))
    b = max(0, min(b, h-1))
    d = max(0, min(d, h-1))

    colors = False
    for y in range(a, c+1):
        for x in range(b, d+1):
            matrika[x][y] = min(10, matrika[x][y] + 1)
            if colors is False: colors = True
    st += int(colors)

print('+' + w*'-' + '+')
for x in matrika:
    print('|' + ''.join([simboli[i] for i in x]) + '|')
print('+' + w*'-' + '+')
print('{0} pravokotnikov na belem'.format(st))