Submission #43002883


Source Code Expand

def I():
    h, w = map(int, input().split())
    s = 0
    for _ in range(h):
        s = (s << 20) + int(input().replace("#", "1").replace(".", "0"), 2)
    return s // (s & -s)

a, b, x = I(), I(), I()
for i in range(300):
    if a | (b << i) == x or (a << i) | b == x:
        print("Yes")
        break
else:
    print("No")

Submission Info

Submission Time
Task C - Ideal Sheet
User Kiri8128
Language PyPy3 (7.3.0)
Score 300
Code Size 342 Byte
Status AC
Exec Time 70 ms
Memory 61900 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 4
AC × 32
Set Name Test Cases
Sample example_00.txt, example_01.txt, example_02.txt, example_03.txt
All example_00.txt, example_01.txt, example_02.txt, example_03.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, random2_00.txt, random2_01.txt, random2_02.txt, random2_03.txt, random2_04.txt, random2_05.txt, random2_06.txt, random2_07.txt, random2_08.txt, random2_09.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt
Case Name Status Exec Time Memory
example_00.txt AC 70 ms 61508 KiB
example_01.txt AC 47 ms 61564 KiB
example_02.txt AC 48 ms 61484 KiB
example_03.txt AC 45 ms 61284 KiB
hand_00.txt AC 48 ms 61524 KiB
hand_01.txt AC 49 ms 61616 KiB
hand_02.txt AC 47 ms 61580 KiB
hand_03.txt AC 42 ms 61624 KiB
hand_04.txt AC 46 ms 61508 KiB
hand_05.txt AC 48 ms 61628 KiB
hand_06.txt AC 45 ms 61260 KiB
hand_07.txt AC 51 ms 61120 KiB
random2_00.txt AC 45 ms 61268 KiB
random2_01.txt AC 46 ms 61520 KiB
random2_02.txt AC 47 ms 61644 KiB
random2_03.txt AC 46 ms 61664 KiB
random2_04.txt AC 47 ms 61596 KiB
random2_05.txt AC 47 ms 61440 KiB
random2_06.txt AC 48 ms 61632 KiB
random2_07.txt AC 49 ms 61592 KiB
random2_08.txt AC 52 ms 61608 KiB
random2_09.txt AC 48 ms 61416 KiB
random_00.txt AC 46 ms 61488 KiB
random_01.txt AC 46 ms 61748 KiB
random_02.txt AC 47 ms 61548 KiB
random_03.txt AC 48 ms 61532 KiB
random_04.txt AC 50 ms 61652 KiB
random_05.txt AC 48 ms 61900 KiB
random_06.txt AC 50 ms 61660 KiB
random_07.txt AC 43 ms 61368 KiB
random_08.txt AC 47 ms 61492 KiB
random_09.txt AC 44 ms 61528 KiB