You are given a rooted tree with vertices numerated from 1 to n . A tree is a connected graph without cycles. A rooted tree has a special vertex named root. Ancestors of the vertex i are all vertices on the path from the root to the vertex i, except…
Long Live the Queen Time Limit:250MS Memory Limit:4096KB 64bit IO Format:%I64d & %I64u Description The Queen of Byteland is very loved by her people. In order to show her their love, the Bytelanders have decided to conquer a new country which…
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2533 Root 11538 - Chess Queen Time limit: 2.000 seconds You probably know how the game of chess is played and how chess queen operates. Two chess qu…
Problem A Chess Queen Input: Standard Input Output: Standard Output You probably know how the game of chess is played and how chess queen operates. Two chess queens are in attacking position when they are on same row, column or diagonal of a chess bo…
C. Queen time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given a rooted tree with vertices numerated from 11 to nn. A tree is a connected graph without cycles. A rooted tree has a s…
143. Long Live the Queen time limit per test: 0.25 sec. memory limit per test: 4096 KB The Queen of Byteland is very loved by her people. In order to show her their love, the Bytelanders have decided to conquer a new country which will be named accor…