Submission #1992369


Source Code Expand

from collections import Counter
h, w, n = map(int, input().split())
c = []
for k in range(n):
    i, j = map(lambda x: int(x) - 1,input().split())
    for l in range(3):
        for m in range(3):
            p = i - l
            o = j - m 
            if p < 0 or p > h - 3: continue
            if o < 0 or o > w - 3: continue
            c.append((p, o))

c = Counter(Counter(c).values())
print((h - 2) * (w - 2) - sum(c.values()))
for i in range(1, 10):
    print(c[i])

Submission Info

Submission Time
Task D - Snuke's Coloring
User peace_of_junk
Language Python (3.4.3)
Score 400
Code Size 490 Byte
Status AC
Exec Time 1419 ms
Memory 198520 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status AC
AC × 19
Set Name Test Cases
Sample
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, empty.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
01.txt AC 1164 ms 96156 KB
02.txt AC 1320 ms 147976 KB
03.txt AC 301 ms 27068 KB
04.txt AC 21 ms 3316 KB
05.txt AC 862 ms 52784 KB
06.txt AC 985 ms 52812 KB
07.txt AC 1311 ms 195452 KB
08.txt AC 1363 ms 198520 KB
09.txt AC 1374 ms 198520 KB
10.txt AC 21 ms 3316 KB
11.txt AC 1391 ms 161656 KB
12.txt AC 1322 ms 197792 KB
13.txt AC 25 ms 3820 KB
14.txt AC 1370 ms 198500 KB
15.txt AC 1419 ms 161528 KB
empty.txt AC 20 ms 3316 KB
sample_01.txt AC 21 ms 3316 KB
sample_02.txt AC 21 ms 3316 KB
sample_03.txt AC 21 ms 3316 KB