質問編集履歴
1
test
CHANGED
File without changes
|
test
CHANGED
@@ -36,47 +36,45 @@
|
|
36
36
|
|
37
37
|
```python
|
38
38
|
|
39
|
-
P = np.full((5,5),0)
|
40
|
-
|
41
|
-
Q = np.full((
|
39
|
+
Q = np.full((3,3),0)
|
42
40
|
|
43
41
|
|
44
42
|
|
45
|
-
for a in range(
|
43
|
+
for a in range(3):
|
46
44
|
|
47
|
-
for b in range(
|
45
|
+
for b in range(3):
|
48
46
|
|
49
47
|
if K[a][b] == 1:
|
50
48
|
|
51
|
-
|
49
|
+
Q[a][b+1] += 1
|
52
50
|
|
53
51
|
elif K[a][b] == 2:
|
54
52
|
|
55
|
-
|
53
|
+
Q[a+1][b+1] += 1
|
56
54
|
|
57
55
|
elif K[a][b] == 3:
|
58
56
|
|
59
|
-
|
57
|
+
Q[a+1][b] += 1
|
60
58
|
|
61
59
|
elif K[a][b] == 4:
|
62
60
|
|
63
|
-
|
61
|
+
Q[a+1][b-1] += 1
|
64
62
|
|
65
63
|
elif K[a][b] == 5:
|
66
64
|
|
67
|
-
|
65
|
+
Q[a][b-1] += 1
|
68
66
|
|
69
67
|
elif K[a][b] == 6:
|
70
68
|
|
71
|
-
|
69
|
+
Q[a-1][b-1] += 1
|
72
70
|
|
73
71
|
elif K[a][b] == 7:
|
74
72
|
|
75
|
-
|
73
|
+
Q[a-1][b] += 1
|
76
74
|
|
77
75
|
elif K[a][b] == 8:
|
78
76
|
|
79
|
-
|
77
|
+
Q[a-1][b+1] += 1
|
80
78
|
|
81
79
|
|
82
80
|
|