Submission #75854150
Source Code Expand
h, w = map(int, input().split())
if h == 1 and w == 1:
print(0)
exit()
if h == 1 and w > 1:
print(*[1] + [2] * (w - 2) + [1])
exit()
if h > 1 and w == 1:
for i in range(h):
if i == 0 or i == h - 1:
print(1)
else:
print(2)
exit()
for i in range(h):
temp_lst = []
for j in range(w):
temp_num = 4
if i == 0 or i == h - 1:
temp_num -= 1
if j == 0 or j == w - 1:
temp_num -= 1
temp_lst.append(temp_num)
print(*temp_lst)
Submission Info
| Submission Time | |
|---|---|
| Task | B - Count Adjacent Cells |
| User | gett |
| Language | Python (PyPy 3.11-v7.3.20) |
| Score | 200 |
| Code Size | 577 Byte |
| Status | AC |
| Exec Time | 64 ms |
| Memory | 90640 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt |
| All | 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00-sample-01.txt | AC | 55 ms | 79612 KiB |
| 00-sample-02.txt | AC | 55 ms | 79448 KiB |
| 00-sample-03.txt | AC | 56 ms | 79732 KiB |
| 01-01.txt | AC | 56 ms | 79572 KiB |
| 01-02.txt | AC | 55 ms | 79600 KiB |
| 01-03.txt | AC | 55 ms | 79768 KiB |
| 01-04.txt | AC | 55 ms | 79484 KiB |
| 01-05.txt | AC | 54 ms | 79768 KiB |
| 01-06.txt | AC | 55 ms | 79640 KiB |
| 01-07.txt | AC | 54 ms | 79676 KiB |
| 01-08.txt | AC | 55 ms | 79400 KiB |
| 01-09.txt | AC | 55 ms | 79448 KiB |
| 01-10.txt | AC | 55 ms | 79896 KiB |
| 01-11.txt | AC | 55 ms | 79608 KiB |
| 01-12.txt | AC | 54 ms | 79612 KiB |
| 01-13.txt | AC | 64 ms | 90640 KiB |
| 01-14.txt | AC | 59 ms | 85828 KiB |
| 01-15.txt | AC | 57 ms | 80132 KiB |
| 01-16.txt | AC | 62 ms | 88924 KiB |
| 01-17.txt | AC | 56 ms | 79860 KiB |
| 01-18.txt | AC | 58 ms | 80632 KiB |
| 01-19.txt | AC | 56 ms | 79772 KiB |