牛客华为机试HJ83
作者:互联网
1. 题目描述
2. Solution 1
1、思路分析
2、代码实现
import sys
if sys.platform != "linux":
file_in = open("input/HJ83.txt")
sys.stdin = file_in
"""
7 4
2 2 1 0
5
4
7 4
0
0
0
-1
-1
"""
while True:
try:
m, n = map(int, input().strip().split())
x1, y1, x2, y2 = map(int, input().strip().split())
row = int(input().strip())
col = int(input().strip())
x, y = map(int, input().strip().split())
if 0 <= m <= 9 and 0 <= n <= 9:
print(0)
else:
print(-1)
if 0 <= x1 <= (m - 1) and 0 <= y1 <= (n - 1) and \
0 <= x2 <= (m - 1) and 0 <= y2 <= (n - 1):
print(0)
else:
print(-1)
if (m + 1) <= 9 and row < m:
print(0)
else:
print(-1)
if (n + 1) <= 9 and col < n:
print(0)
else:
print(-1)
if 0 <= x <= (m - 1) and 0 <= y <= (n - 1):
print(0)
else:
print(-1)
except:
break
标签:map,int,sys,牛客,split,strip,input,机试,HJ83 来源: https://www.cnblogs.com/junstat/p/16177296.html