题解 | #二维数组操作#

二维数组操作

http://www.nowcoder.com/practice/2f8c17bec47e416897ce4b9aa560b7f4

# 逻辑题,慢慢试错

while 1:
    try:
        m,n = [int(i) for i in input().split()]
        if max(m,n)>9:#Q1
            print(-1)
        else:
            print(0)
        x1,y1,x2,y2 = [int(i) for i in input().split()]
        if max(x1,x2)>=m&nbs***bsp;max(y1,y2)>=n:#Q2
            print(-1)
        else:
            print(0)
        x=int(input())
        if x>8&nbs***bsp;m>8&nbs***bsp;x>=m:#Q3
            print(-1)
        else:
            print(0)
        y=int(input())
        if y>8&nbs***bsp;n>8&nbs***bsp;y>=n:#Q4
            print(-1)
        else:
            print(0)
        x3,y3 = [int(i) for i in input().split()]
        if x3>=m&nbs***bsp;y3 >= n:#Q5
            print(-1)
        else:
            print(0)
    except:
        break

全部评论

相关推荐

评论
点赞
收藏
分享
牛客网
牛客企业服务