Submission #2707715


Source Code Expand

Copy
import numpy as np
w,h,n=map(int,raw_input().split())
mp = np.zeros((w,h))
for i in range(n):
  xi,yi,ai=map(int,raw_input().split())
  if ai==1: # x < xi
    mp[:xi,:] = 1
  elif ai==2: # x > xi
    mp[xi:,:] = 1
  elif ai==3: # y < yi
    mp[:,:yi] = 1
  elif ai==4: # y > yi
    mp[:,yi:] = 1
print w*h - np.sum(mp)

Submission Info

Submission Time
Task B - すぬけ君の塗り絵 2 イージー / Snuke's Coloring 2 (ABC Edit)
User naoya_t
Language Python2 (2.7.6)
Score 200
Code Size 333 Byte
Status
Exec Time 253 ms
Memory 19308 KB

Test Cases

Set Name Score / Max Score Test Cases
sample 0 / 0 sample_01.txt, sample_02.txt, sample_03.txt
All 200 / 200 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 253 ms 19308 KB
dir_02.txt 92 ms 10540 KB
random_01.txt 92 ms 10540 KB
random_02.txt 92 ms 10540 KB
random_03.txt 94 ms 10540 KB
random_04.txt 92 ms 10540 KB
sample_01.txt 91 ms 10416 KB
sample_02.txt 91 ms 10416 KB
sample_03.txt 92 ms 10416 KB
small_01.txt 90 ms 10416 KB
small_02.txt 92 ms 10416 KB
small_03.txt 91 ms 10540 KB
small_04.txt 92 ms 10540 KB