Rezultati

Up. imeNalogaJezikRezultatČas oddaje
kosmati-mucki-2019 Moderna umetnost Python 3 100/100OK 09. maj '19 @ 18:56

Test Točke Porabljen spomin Porabljen čas Status
#1 [več] 20/20 8,668 MiB 0,000 s OK
#2 [več] 20/20 8,730 MiB 0,000 s OK
#3 [več] 20/20 8,578 MiB 0,000 s OK
#4 [več] 20/20 8,605 MiB 0,000 s OK
#5 [več] 20/20 8,727 MiB 0,000 s OK

Ocenjevani program (quoi.py):
w, h, n = map(int, input().split())

m = 0
platno = [[0 for _ in range(w)] for _ in range(h)]


def za_barvati(a, b, c, d):
    a = max(a, 1)
    b = max(b, 1)

    c = min(c, w)
    d = min(d, h)

    return a, b, c, d


for i in range(n):
    a, b, c, d = map(int, input().split())

    if c < a:
        a,c = c,a
    if d < b:
        b,d = d,b

    if (a > w) or (b > h) or (c < 1) or (d < 1):
        continue
    else:
        m += 1

        x1,y1,x2,y2 = za_barvati(a,b,c,d)

        for x in range(x1, x2+1):
            for y in range(y1, y2+1):
                platno[y-1][x-1] += 1

legenda = " .:-=+*$#%@"
print("+" + "-" * w + "+")
for y in range(h):
    vrsta = "|"
    for znak in platno[y]:
        if znak <= 10:
            vrsta += legenda[znak]
        else:
            vrsta += '@'
    vrsta += "|"
    print(vrsta)
print("+" + "-" * w + "+")
print(str(m) + " pravokotnikov na belem")