QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#395127 | #3002. Busy Board | ohiostatescarlet# | WA | 399ms | 26896kb | Python3 | 1.1kb | 2024-04-21 05:49:54 | 2024-04-21 05:49:55 |
Judging History
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
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 318ms
memory: 23268kb
input:
769 998 OOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOO...
output:
0
result:
ok answer is 0
Test #2:
score: 0
Accepted
time: 399ms
memory: 26896kb
input:
977 998 OOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOO...
output:
0
result:
ok answer is 0
Test #3:
score: -100
Wrong Answer
time: 392ms
memory: 26088kb
input:
941 973 XOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXOXXXXXXXOXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...
output:
0
result:
wrong answer expected 1, found 0