题解 | #二维数组操作#
二维数组操作
http://www.nowcoder.com/practice/2f8c17bec47e416897ce4b9aa560b7f4
- 思路:为了避免判断代码冗余让人心态炸裂,使用mu和nu代表行和列的下标范围
while True:
try:
m, n = map(int, input().split(" "))
x1, y1, x2, y2 = map(int, input().split(" "))
x, y = int(input()), int(input())
x3, y3 = map(int, input().split(" "))
mu, nu = [i for i in range(m)], [i for i in range(n)]
print(0 if (0 <= m <= 9) and (0 <= n <= 9) else -1)
print(0 if (x1 in mu) and (x2 in mu) and (y1 in nu) and (y2 in nu) else -1)
print(0 if (m < 9) and (x in mu) else -1)
print(0 if (n < 9) and (y in nu) else -1)
print(0 if (x3 in mu) and (y3 in nu) else - 1)
except:
break