Rezultati

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

Test Točke Porabljen spomin Porabljen čas Status
#1 [več] 20/20 8,680 MiB 0,000 s OK
#2 [več] 20/20 9,961 MiB 0,000 s OK
#3 [več] 20/20 9,895 MiB 0,000 s OK
#4 [več] 20/20 9,813 MiB 0,000 s OK
#5 [več] 20/20 9,898 MiB 0,000 s OK

Ocenjevani program (art.py):
import sys

w, h, n = map(int,sys.stdin.readline().strip().split(" "))

M = [[0 for i in range(w)] for j in range(h)]


d = {0: " ", 1:".", 2:':', 3:"-", 4:"=", 5:"+", 6:"*", 7:"$", 8:"#", 9:"%", 10:"@"}

p=0

for t in range(n):
	ai, bi, ci, di = map(int,sys.stdin.readline().strip().split(" ")) 
	if((ai<1 and ci<1) or (ai>w and ci>w) or (bi<1 and di<1) or (bi>h and di>h)):
		continue
	p += 1
	if ai < 1:
		ai = 1
	if bi < 1:
		bi = 1
	if ci < 1:
		ci = 1
	if di < 1:
		di = 1
	if ai > w:
		ai = w
	if bi > h:
		bi = h
	if ci > w:
		ci = w
	if di > h:
		di = h 
		
	x = min(ai, ci)
	y = min(bi, di)
	dd = abs(ci - ai)
	ss = abs(di - bi)
	
	for i in range(x-1, x+dd):
		for j in range(y-1, y+ss):
			if M[j][i] <10:
				M[j][i] += 1
	

print('+',end='')
for i in range(w):
	print('-',end='')
print('+')
for i in range(h):
	print('|',end='')
	for j in range(w):
		print(d[M[i][j]], end='')
	print('|')

print('+',end='')
for i in range(w):
	print('-',end='')
print('+')
print(str(p)+' pravokotnikov na belem')