Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Pseudographical recognizer
Description Let us define a The character Write a program that, given a pseudographical image, determines if it contains exactly one line segment – horizontal, vertical, or diagonal. Input The input contains several test cases. The first line contains the number of test cases T (1 ≤ T ≤ 100). Next follow the descriptions of each test case. The first line of the test case description contains two integers N and M (1 ≤ N, M ≤ 10), the number of rows and columns of the matrix, respectively. Each of the following N lines of the description contains exactly M symbols ‘.’, ‘‑’, ‘|’, ‘\’, or ‘/’. Output The output consists of Sample Input 5 5 5 ..... \.... .\... ..\.. ..... 3 3 /.. ./. ../ 3 6 .|.... .|.--- .|.... 3 3 ... ... ... 1 1 / Sample Output CORRECT INCORRECT INCORRECT INCORRECT CORRECT Source Northeastern Europe 2005, Western Subregion |

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

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator