Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register
Language:
Sea battle
Time Limit: 1000MSMemory Limit: 65536K
Total Submissions: 1377Accepted: 477

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 10x10. 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 1xK or Kx1, 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

The input 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

The output 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

Northeastern Europe 2003, Western Subregion

[Submit]   [Go Back]   [Status]   [Discuss]

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator