题解 | #二维数组操作#

二维数组操作

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

while True:
    try:
        a = list(map(int,input().split()))
        b = list(map(int,input().split()))
        c = list(map(int,input().split()))
        d = list(map(int,input().split()))
        e = list(map(int,input().split()))

        size_r,size_c = a[0],a[1]
        x1,y1,x2,y2 = b[0],b[1],b[2],b[3]
        r = c[0]
        c = d[0]
        x,y = e[0],e[1]
        # check q1
        if size_r<=9 and size_r>=0 and size_c<=9 and size_c>=0:
            print(0)

            #check q2
            print(0) if x1 in range(0,size_r) and x2 in range(0,size_r) and y1 in range(0,size_c) and y2 in range(0,size_c) else print(-1)

            #check q3
            print(0) if r in range(0,size_r) and size_r<9 else print(-1)

            #check q4
            print(0) if c in range(0,size_c) and size_c<9 else print(-1)

            #check q5
            print(0) if x in range(0,size_r) and y in range(0,size_c) else print(-1)

        else:
            print(-1)
            print(-1)
            print(-1)
            print(-1)
            print(-1)
        

    except:
        break

全部评论

相关推荐

zaakfung:26届不应该春招吗 为啥还实习
点赞 评论 收藏
分享
不知道怎么取名字_:看来现在卷的,这种单位都开始提高要求了
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务