質問編集履歴

1

2020/04/11 06:46

投稿

yonhark0
yonhark0

スコア11

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((5,5),0)
39
+ Q = np.full((3,3),0)
42
40
 
43
41
 
44
42
 
45
- for a in range(5):
43
+ for a in range(3):
46
44
 
47
- for b in range(5):
45
+ for b in range(3):
48
46
 
49
47
  if K[a][b] == 1:
50
48
 
51
- ACC[a][b+1] += 1
49
+ Q[a][b+1] += 1
52
50
 
53
51
  elif K[a][b] == 2:
54
52
 
55
- ACC[a+1][b+1] += 1
53
+ Q[a+1][b+1] += 1
56
54
 
57
55
  elif K[a][b] == 3:
58
56
 
59
- ACC[a+1][b] += 1
57
+ Q[a+1][b] += 1
60
58
 
61
59
  elif K[a][b] == 4:
62
60
 
63
- ACC[a+1][b-1] += 1
61
+ Q[a+1][b-1] += 1
64
62
 
65
63
  elif K[a][b] == 5:
66
64
 
67
- ACC[a][b-1] += 1
65
+ Q[a][b-1] += 1
68
66
 
69
67
  elif K[a][b] == 6:
70
68
 
71
- ACC[a-1][b-1] += 1
69
+ Q[a-1][b-1] += 1
72
70
 
73
71
  elif K[a][b] == 7:
74
72
 
75
- ACC[a-1][b] += 1
73
+ Q[a-1][b] += 1
76
74
 
77
75
  elif K[a][b] == 8:
78
76
 
79
- ACC[a-1][b+1] += 1
77
+ Q[a-1][b+1] += 1
80
78
 
81
79
 
82
80