22170_MaxSymmetrySub-Array

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

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

Pro.ID

22170

Title

Max Symmetry Sub-Array

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Here is a n x n array, each element is a character (a~z or A~Z), find out the size of the max symmetry array.

    Symmetry array is such an array that it is symmetry by the "left-down to right-up" line. The element on the corresponding place should be the same. For example, here is a 3*3 array, the element on (1, 3) and (3, 1) are both "a", the element on (1, 2) and (2, 1) are both "c", the element on (2, 3) and (3, 2) are both "b".

    abx
    cyb
    zca

    输入

    There are several test cases in the input file. Each case begins with an integer n ( 0 < n < 2001 ), followed by n lines which has n character. There won't be any blank spaces between characters or the end of line. The input file is ended with a 0.

    输出

    Description

    Here is a n x n array, each element is a character (a~z or A~Z), find out the size of the max symmetry array.

    Symmetry array is such an array that it is symmetry by the "left-down to right-up" line. The element on the corresponding place should be the same. For example, here is a 3*3 array, the element on (1, 3) and (3, 1) are both "a", the element on (1, 2) and (2, 1) are both "c", the element on (2, 3) and (3, 2) are both "b".

    abx
    cyb
    zca

    Input

    There are several test cases in the input file. Each case begins with an integer n ( 0 < n < 2001 ), followed by n lines which has n character. There won't be any blank spaces between characters or the end of line. The input file is ended with a 0.

    Output

    Each test case output one line, the size of the max symmetry sub-array.

    Sample Input

    3
    abx
    cyb
    zca
    4
    aaba
    cbab
    abbc
    cacb
    0

    Sample Output

    3
    3

    Hint

    In the second test case, the max symmetry sub-array is:

    cba
    abb
    cac

    Source

    样例输入

    3
    abx
    cyb
    zca
    4
    aaba
    cbab
    abbc
    cacb
    0

    样例输出

    3
    3

    提示

    In the second test case, the max symmetry sub-array is:

    cba
    abb
    cac


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部