• 时间不够了,先保存一下


     polyomino is a plane geometric figure formed by joining one or more equal squares edge to edge.
    - Wikipedia

    Given a large polyomino and a small polyomino, your task is to determine whether you can compose the large one with two copies of the small one. The polyominoes can be translated, but not flipped or rotated. The two pieces should not overlap. The leftmost picture below is a correct way of composing the large polyomino, but the right two pictures are not. In the middle picture, one of the pieces was rotated. In the rightmost picture, both pieces are exactly identical, but they're both rotated from the original piece (shown in the lower-right part of the picture).

    \epsfbox{p12291.eps}

    Input 

    There will be at most 20 test cases. Each test case begins with two integers n and m ( 1$ \le$m$ \le$n$ \le$10) in a single line. The next n lines describe the large polyomino. Each of these lines contains exactly n characters in ` *',` .'. A ` *' indicates an existing square, and a ` .' indicates an empty square. The next m lines describe the small polyomino, in the same format. These characters are guaranteed to form valid polyominoes (note that a polyomino contains at least one existing square). The input terminates with n = m = 0, which should not be processed.

    Output 

    For each case, print ` 1' if the corresponding composing is possible, print ` 0' otherwise.

    Sample Input 

    4 3
    .**.
    ****
    .**.
    ....
    **.
    .**
    ...
    3 3
    ***
    *.*
    ***
    *..
    *..
    **.
    4 2
    ****
    ....
    ....
    ....
    *.
    *.
    0 0
  • 相关阅读:
    软件测试模型
    功能测试用例是怎么写
    Web测试需要注意的点
    WEB测试方法总结-笔记
    安全性测试的测试点
    删除功能测试的测试点
    压力测试的测试点
    异常测试的测试点
    解决Plugin org.apache.maven.plugins:maven-archetype-plugin:RELEASE or one of its dependencies...
    中国联通:本公司将继续在纽约证交所上市交易
  • 原文地址:https://www.cnblogs.com/alexanderone/p/3853901.html
Copyright © 2020-2023  润新知