Submission #2105532


Source Code Expand

W,H,N=map(int, raw_input().split())
C=[]
for i in range(N):
	x,y,a=map(int, raw_input().split())
	C.append((x,y,a))

R=[[ 0 for i in range(H)] for j in range(W)]


for i in C:
	if i[2]==1:
		for x in range(i[0]):
			for y in range(H):
				R[x][y]=1
	elif i[2]==2:
		for x in range(i[0],W):
			for y in range(H):
				R[x][y]=1
	elif i[2]==3:
		for x in range(W):
			for y in range(i[1]):
				R[x][y]=1
	elif i[2]==4:
		for x in range(W):
			for y in range(i[1],H):
				R[x][y]=1


ans=0
for i in R:
	ans+=len(filter(lambda n:n==0, i) )

print ans

Submission Info

Submission Time
Task B - Snuke's Coloring 2 (ABC Edit)
User KUMAWO
Language Python (2.7.6)
Score 200
Code Size 579 Byte
Status AC
Exec Time 67 ms
Memory 2696 KB

Judge Result

Set Name sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 13
Set Name Test Cases
sample sample_01.txt, sample_02.txt, sample_03.txt
All dir_01.txt, dir_02.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, sample_01.txt, sample_02.txt, sample_03.txt, small_01.txt, small_02.txt, small_03.txt, small_04.txt
Case Name Status Exec Time Memory
dir_01.txt AC 62 ms 2696 KB
dir_02.txt AC 64 ms 2696 KB
random_01.txt AC 67 ms 2696 KB
random_02.txt AC 34 ms 2696 KB
random_03.txt AC 45 ms 2696 KB
random_04.txt AC 36 ms 2696 KB
sample_01.txt AC 11 ms 2696 KB
sample_02.txt AC 11 ms 2696 KB
sample_03.txt AC 11 ms 2696 KB
small_01.txt AC 11 ms 2696 KB
small_02.txt AC 11 ms 2696 KB
small_03.txt AC 12 ms 2696 KB
small_04.txt AC 13 ms 2696 KB