Submission #42932589


Source Code Expand

HA,WA = map(int,input().split())
A = [input() for _ in range(HA)]
HB,WB = map(int,input().split())
B = [input() for _ in range(HB)]
HX,WX = map(int,input().split())
X = [input() for _ in range(HX)]
c = sum(row.count('#') for row in X)


for si in range(41):
    for sj in range(41):
        Z = [['.']*50 for _ in range(50)]
        for ai in range(HA):
            for aj in range(WA):
                if A[ai][aj]=='#':
                    Z[ai+20][aj+20] = '#'
        for bi in range(HB):
            for bj in range(WB):
                if B[bi][bj]=='#':
                    Z[si+bi][sj+bj] = '#'
        zc = sum(row.count('#') for row in Z)
        if c != zc: continue
        def exist(xi,xj):
            for i in range(HX):
                for j in range(WX):
                    if Z[xi+i][xj+j] != X[i][j]:
                        return False
            return True
        for xi in range(41):
            for xj in range(41):
                if exist(xi,xj):
                    exit(print('Yes'))
print('No')

Submission Info

Submission Time
Task C - Ideal Sheet
User prd_xxx
Language PyPy3 (7.3.0)
Score 300
Code Size 1059 Byte
Status AC
Exec Time 572 ms
Memory 78680 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 205 ms 75120 KiB
example_01.txt AC 325 ms 75036 KiB
example_02.txt AC 267 ms 75196 KiB
example_03.txt AC 172 ms 74404 KiB
hand_00.txt AC 180 ms 74288 KiB
hand_01.txt AC 101 ms 74184 KiB
hand_02.txt AC 153 ms 74164 KiB
hand_03.txt AC 296 ms 75076 KiB
hand_04.txt AC 243 ms 76920 KiB
hand_05.txt AC 162 ms 73404 KiB
hand_06.txt AC 183 ms 73944 KiB
hand_07.txt AC 162 ms 73368 KiB
random2_00.txt AC 160 ms 74084 KiB
random2_01.txt AC 305 ms 74952 KiB
random2_02.txt AC 292 ms 75228 KiB
random2_03.txt AC 572 ms 78680 KiB
random2_04.txt AC 307 ms 74852 KiB
random2_05.txt AC 184 ms 74140 KiB
random2_06.txt AC 218 ms 75248 KiB
random2_07.txt AC 316 ms 75856 KiB
random2_08.txt AC 298 ms 74960 KiB
random2_09.txt AC 198 ms 74272 KiB
random_00.txt AC 194 ms 74660 KiB
random_01.txt AC 325 ms 75516 KiB
random_02.txt AC 329 ms 75948 KiB
random_03.txt AC 181 ms 74672 KiB
random_04.txt AC 222 ms 75088 KiB
random_05.txt AC 302 ms 74628 KiB
random_06.txt AC 303 ms 75412 KiB
random_07.txt AC 168 ms 74060 KiB
random_08.txt AC 159 ms 74460 KiB
random_09.txt AC 227 ms 75684 KiB