Submission #1304841
Source Code Expand
pos_black_mapping = {} pos_num_mapping = {} H, W, N = map(int, raw_input().split()) for i in range(N): a, b = map(int, raw_input().split()) a, b = a-1, b-1 if (a, b) in pos_black_mapping: continue pos_black_mapping[a, b] = 1 for da in range(-1, 2): for db in range(-1, 2): na, nb = a+da, b+db if (0 < na < H-1) and (0 < nb < W-1): if not (na, nb) in pos_num_mapping: pos_num_mapping[na, nb] = 0 pos_num_mapping[na, nb] += 1 ans = [0 for _ in range(10)] for a, b in pos_num_mapping.keys(): ans[pos_num_mapping[a, b]] += 1 ans[0] = (W-2)*(H-2) - sum(ans[1:]) for v in ans: print v
Submission Info
Submission Time | |
---|---|
Task | D - Snuke's Coloring |
User | namakemono |
Language | Python (2.7.6) |
Score | 400 |
Code Size | 721 Byte |
Status | AC |
Exec Time | 2281 ms |
Memory | 186780 KB |
Judge Result
Set Name | Sample | All | ||
---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | ||
Status | AC |
|
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 | 1336 ms | 37560 KB |
02.txt | AC | 1972 ms | 122912 KB |
03.txt | AC | 345 ms | 16316 KB |
04.txt | AC | 11 ms | 2696 KB |
05.txt | AC | 1202 ms | 63832 KB |
06.txt | AC | 1248 ms | 63832 KB |
07.txt | AC | 2281 ms | 184220 KB |
08.txt | AC | 2276 ms | 186780 KB |
09.txt | AC | 2255 ms | 186780 KB |
10.txt | AC | 11 ms | 2696 KB |
11.txt | AC | 1941 ms | 125600 KB |
12.txt | AC | 2267 ms | 185628 KB |
13.txt | AC | 15 ms | 2820 KB |
14.txt | AC | 2096 ms | 181296 KB |
15.txt | AC | 1931 ms | 125728 KB |
empty.txt | AC | 11 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 |