10106_Transformations

2022-5-16 18:16| 发布者: Hocassian| 查看: 82| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504557230700-Problem List-采集的数据-后羿采集器.html

Pro.ID

10106

Title

Transformations

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=10106

AC

89

Submit

239

Ratio

37.24%

时间&空间限制

  • Time Limit: 600/300 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    A square pattern of size N × N (1 ≤ N ≤ 10) black and white square tiles is transformed into another square pattern. Write a program that will recognize the minimum transformation that has been applied to the original pattern given the following list of possible transformations:

    • #1: 90 Degree Rotation: The pattern was rotated clockwise 90 degrees.

    • #2: 180 Degree Rotation: The pattern was rotated clockwise 180 degrees.

    • #3: 270 Degree Rotation: The pattern was rotated clockwise 270 degrees.

    • #4: Reflection: The pattern was reflected horizontally (turned into a mirror image of itself by reflecting around a vertical line in the middle of the image).

    • #5: Combination: The pattern was reflected horizontally and then subjected to one of the rotations (#1-#3).

    • #6: No Change: The original pattern was not changed.

    • #7: Invalid Transformation: The new pattern was not obtained by any of the above methods.

    In the case that more than one transform could have been used, choose the one with the minimum number above.

    输入

    Line 1: A single integer, N

    Line 2..N+1: N lines of N characters (each either '@' or '-'); this is the square before transformation

    Line N+2..2*N+1: N lines of N characters (each either '@' or '-'); this is the square after transformation

    输出

    Description

    A square pattern of size N × N (1 ≤ N ≤ 10) black and white square tiles is transformed into another square pattern. Write a program that will recognize the minimum transformation that has been applied to the original pattern given the following list of possible transformations:

    • #1: 90 Degree Rotation: The pattern was rotated clockwise 90 degrees.

    • #2: 180 Degree Rotation: The pattern was rotated clockwise 180 degrees.

    • #3: 270 Degree Rotation: The pattern was rotated clockwise 270 degrees.

    • #4: Reflection: The pattern was reflected horizontally (turned into a mirror image of itself by reflecting around a vertical line in the middle of the image).

    • #5: Combination: The pattern was reflected horizontally and then subjected to one of the rotations (#1-#3).

    • #6: No Change: The original pattern was not changed.

    • #7: Invalid Transformation: The new pattern was not obtained by any of the above methods.

    In the case that more than one transform could have been used, choose the one with the minimum number above.

    Input

    Line 1: A single integer, N

    Line 2..N+1: N lines of N characters (each either '@' or '-'); this is the square before transformation

    Line N+2..2*N+1: N lines of N characters (each either '@' or '-'); this is the square after transformation

    Output

    A single line containing the the number from 1 through 7 (described above) that categorizes the transformation required to change from the 'before' representation to the 'after' representation.

    Sample Input

    3
    @-@
    ---
    @@-
    @-@
    @--
    --@

    Sample Output

    1

    Source

    样例输入

    3
    @-@
    ---
    @@-
    @-@
    @--
    --@

    样例输出

    1

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部