A paper cube can be made up from six paper squares Given an projection (map) of the cube, you are to determine its correctness. A projection is correct, if a cube can be made up from it.
The first line is the number of test cases, followed by a blank line. For each test case, input contains a projection represented as a 6 × 6 grid containing six ones and 30 zeroes, separated by spaces. 1’s represent the paper squares. All squares are placed immediately to each other, so that each square is connected with at least one other square. Each test case will be separated by a single line.
For each test case, your program should print ‘correct’ if cube can be made up from the given project, or ‘incorrect’ otherwise. Print a blank line between the outputs for two consecutive test cases.
範例輸入 1
2 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 1 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
範例輸出 1
correct incorrect
Pro 專屬功能: 查看這題在歷屆 CPE 出現過幾次 — 升級以解鎖.