| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 12430 | Sudoku Validator |
|
| 12441 | Palindrome |
|
Description
Nowadays, Sudoku is a very popular game.
The Sudoku game is to fill in digits 1-9 into blank grids such that none repeated digits in any row, column and block in a Sudoku solution.

and you, are asked to make an sudoku validator,
such that it can check whether the sudoku is a question or a solution,
(if there is any blank box, it's a question; else, it's a solution)
you also need to check that the question/solution is valid or not,
it is guarantee that if the input sudoku is a question, it will have exactly 1 solution,
that is, you only need to check every row, column, block such there are none repeat digits (1-9) in each of them.
ouo.
For example, the input of the above sudoku will be like:
_____________
|xxx|39x|x1x|
|5x1|xxx|x4x|
|9xx|7xx|5xx|
-------------
|6x2|53x|x7x|
|xxx|x7x|xx8|
|7xx|8xx|9x3|
-------------
|8x3|x1x|x9x|
|x9x|2x6|xx7|
|4xx|xx3|x61|
_____________
and the output should be:
question, valid
Hints :You can use scanf("%s", char array) and loop to get input
Input
Input contains 13 lines,
and there are exactly 13 characters in each line,
the input character will only be one of "123456789x",
'x' represent the blank box.
The format of input is like:
_____________
|ooo|ooo|ooo|
|ooo|ooo|ooo|
|ooo|ooo|ooo|
-------------
|ooo|ooo|ooo|
|ooo|ooo|ooo|
|ooo|ooo|ooo|
-------------
|ooo|ooo|ooo|
|ooo|ooo|ooo|
|ooo|ooo|ooo|
_____________
where 'o' is one of the character in "123456789x"
See Sample Input for more details.
Output
Output contain only 1 line.
If the input is a question of sudoku, output "question" (without quotes),
if the input is a solution of sudoku, then output "solution" (without quotes).
Then if the question/solution is valid, then output "valid" (without quotes), with ", " between the previous output,
if the question/solution is invalid, then output "invalid" (without quotes), with ", " (without quotes) between the previous output.
Remember to add a newline character after your output.
See Sample Output for more details.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Palindrome is a string that is identical to its reverse, like "level" or "aba". Check whether a given string is a palindrome or not.
Input
The input consists of multiple lines. Each line contains a string. The length of each string is less than 100000. The number of test case is less than 1000.
Output
For each test case, output "Yes" if it's a palindrome or "No" if it's not a palindrome in a line.