Rezultati

Up. imeNalogaJezikRezultatČas oddaje
boku-yes-pico-2019 Moderna umetnost Python 3 100/100OK 09. maj '19 @ 18:35

Test Točke Porabljen spomin Porabljen čas Status
#1 [več] 20/20 8,523 MiB 0,000 s OK
#2 [več] 20/20 9,797 MiB 0,000 s OK
#3 [več] 20/20 9,879 MiB 0,000 s OK
#4 [več] 20/20 9,945 MiB 0,000 s OK
#5 [več] 20/20 9,805 MiB 0,000 s OK

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

table = [[0]*w for _ in range(h)]
s = ' .:-=+*$#%@'

def coord(t):
    i, j = t
    i = max(1, i)
    i = min(w, i)
    j = max(1, j)
    j = min(h, j)
    return i, j

def convert(n):
    n = min(n, 10)
    return s[n]

c = 0

for i in range(n):
    ai, bi, ci, di = map(int, input().split())
    if min(ai, ci) > w or min(bi, di) > h or max(ai, ci) < 1 or max(bi, di) < 1:
        c += 1
        continue
    t1, t2 = map(coord, [(ai, bi), (ci, di)])
    ai, bi = t1
    ci, di = t2
    # print(ai, bi, ci, di)
    for i in range(min(bi, di)-1, max(bi, di)):
        for j in range(min(ai, ci)-1, max(ai, ci)):
            table[i][j] += 1

print('+', end='')
print('-'*w, end='')
print('+\n', end='')
for i in range(h):
    print('|', end='')
    for j in range(w):
        print(convert(table[i][j]), end='')
    print('|\n', end='')
print('+', end='')
print('-'*w, end='')
print('+\n', end='')
print('{} pravokotnikov na belem'.format(n-c))