Rezultati

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

Test Točke Porabljen spomin Porabljen čas Status
#1 [več] 20/20 8,613 MiB 0,000 s OK
#2 [več] 20/20 8,738 MiB 0,000 s OK
#3 [več] 20/20 8,625 MiB 0,000 s OK
#4 [več] 20/20 8,766 MiB 0,000 s OK
#5 [več] 20/20 8,672 MiB 0,000 s OK

Ocenjevani program (moderna.py):
import sys
data = sys.stdin.readlines()
#data = open("/home/putka-kjejenovictk-2019/.PyCharmCE2018.3/config/scratches/moderna").readlines()

w,h,n = list(map(int,data[0].strip().split()))
odtenki = [[0 for i in range(w)] for j in range(h)]

pobarvanih=0
for vrstica in data[1:]:
    a,b,c,d = list(map(int,vrstica.strip().split()))
    if a > c:
        levi = c
        desni = a
    else:
        levi = a
        desni = c
    if b > d:
        spodnji = b
        zgornji = d
    else:
        spodnji = d
        zgornji = b
    if levi > w or desni < 1 or zgornji > h or spodnji < 1:
        continue

    if desni >w:
        desni = w
    if levi < 1:
        levi = 1
    if zgornji < 1:
        zgornji = 1
    if spodnji > h:
        spodnji = h

    for y in range(zgornji-1,spodnji):
        for x in range(levi-1,desni):
            odtenki[y][x] = odtenki[y][x] + 1
    pobarvanih +=1

znaki = [" ",".",":","-","=","+","*","$","#","%","@"]

def convert(x):
    return znaki[min(x,10)]

print("+" + "-"*w + "+")
for i in range(h):
    print("|" + "".join(list(map(convert,odtenki[i]))) +"|")
print("+" + "-"*w + "+")
print(str(pobarvanih) + " pravokotnikov na belem")