回答編集履歴
1
ソース修正
test
CHANGED
@@ -153,3 +153,49 @@
|
|
153
153
|
|
154
154
|
|
155
155
|
ゆう出力になりますわ。ほな〜。
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
**補足:** まあ、ゆうてNumPy使わんでも、
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
```python
|
164
|
+
|
165
|
+
def check(i, j, a):
|
166
|
+
|
167
|
+
return (
|
168
|
+
|
169
|
+
(i == 0 or a[i][j] > a[i-1][j])
|
170
|
+
|
171
|
+
and
|
172
|
+
|
173
|
+
(i == M-1 or a[i][j] > a[i+1][j])
|
174
|
+
|
175
|
+
and
|
176
|
+
|
177
|
+
(j == 0 or a[i][j] > a[i][j-1])
|
178
|
+
|
179
|
+
and
|
180
|
+
|
181
|
+
(j == N-1 or a[i][j] > a[i][j+1])
|
182
|
+
|
183
|
+
)
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
for i in range(M):
|
190
|
+
|
191
|
+
for j in range(N):
|
192
|
+
|
193
|
+
if check(i, j, A):
|
194
|
+
|
195
|
+
print(f'A({i}, {j}): ', A[i][j])
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
```
|
200
|
+
|
201
|
+
でもええわいね。
|