QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#395126#3002. Busy Boardohiostatescarlet#Compile Error//C++171.1kb2024-04-21 05:49:302024-04-21 05:49:31

Judging History

你现在查看的是最新测评结果

  • [2024-04-21 05:49:31]
  • 评测
  • [2024-04-21 05:49:30]
  • 提交

answer




r, c = map(int, input().split())

a = [["OX".find(i) for i in input()] for j in range(r)]
t = [["OX".find(i) for i in input()] for j in range(r)]

same = True
for x in range(c):
    for y in range(r):
        if a[y][x] != t[y][x]:
            same = False

if same:
    print(1)
else:
    allx = True
    for x in range(c):
        for y in range(r):
            if not a[y][x]:
                allx = False

    if allx:
        print(0)
    else:
        vr = [0 for _ in range(r)]
        vc = [0 for _ in range(c)]

        total = 0
        for y in range(r):
            s = sum(t[y])
            total += s
            if s <= 1:
                vr[y] = 1

        for x in range(c):
            s = sum(t[y][x] for y in range(r))
            if s <= 1:
                vc[x] = 1


        poss = True
        for x in range(c):
            for y in range(r):
                if a[y][x] == t[y][x] or (not t[y][x] and vr[y] and vc[x]) or (t[y][x] and (vr[y] or vc[x])):
                    pass
                else:
                    poss = False

        print(1 if total > 0 and poss else 0)

Details

answer.code:4:1: error: ‘r’ does not name a type
    4 | r, c = map(int, input().split())
      | ^