22698_SeaBATTLE

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

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

Pro.ID

22698

Title

Sea BATTLE

Title链接

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

AC

0

Submit

1

Ratio

0.00%

时间&空间限制

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

    Mr. X is writing "Sea Battle" computer game. Now he needs a program that checks if the initial position of ships that a human player creates is correct.

    The field for the game is a matrix of size 10×10. The human player has to put 10 ships on the field. Each ship occupies from 1 to 4 cells of the field and has sizes 1×K or K×1, where K is between 1 and 4. The human player has to put into the field: one 4-cell ship, two 3-cell ships, three 2-cell ships and four 1-cell ships. None of the two of the ships can touch each other even by diagonal. Neither can a ship touch the border of the field. In other words, it is prohibited to occupy cells in the first/last row/column of the field.

    Your task is to check if the matrix is a correct initial position of ships for the "Sea Battle" game.

    输入

    Input data contains 10 lines containing 10 characters each. The character is either '1' or '.' .  '1' means that the cell is occupied by a ship, '.' means that the cell is free.

    输出

    Description

    Mr. X is writing "Sea Battle" computer game. Now he needs a program that checks if the initial position of ships that a human player creates is correct.

    The field for the game is a matrix of size 10×10. The human player has to put 10 ships on the field. Each ship occupies from 1 to 4 cells of the field and has sizes 1×K or K×1, where K is between 1 and 4. The human player has to put into the field: one 4-cell ship, two 3-cell ships, three 2-cell ships and four 1-cell ships. None of the two of the ships can touch each other even by diagonal. Neither can a ship touch the border of the field. In other words, it is prohibited to occupy cells in the first/last row/column of the field.

    Your task is to check if the matrix is a correct initial position of ships for the "Sea Battle" game.

    Input

    Input data contains 10 lines containing 10 characters each. The character is either '1' or '.' .  '1' means that the cell is occupied by a ship, '.' means that the cell is free.

    Output

    Output data has to contain a word 'correct' or 'incorrect'.

    Sample Input

    1.........
    ....11.11.
    .11.......
    .11.1.1.1.
    ....1.1.1.
    ....1.1...
    ..........
    .1..1.....
    ..1...1...
    ..........

    Sample Output

    incorrect

    Source

    样例输入

    1.........
    ....11.11.
    .11.......
    .11.1.1.1.
    ....1.1.1.
    ....1.1...
    ..........
    .1..1.....
    ..1...1...
    ..........

    样例输出

    incorrect

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部