ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Турниры > CEN303_2016Questions > задача:


HW032. 51014 - Nine Men's Morris game

CEN303_2016Questions

Старт: 28.окт.2016 в 17:00:00
Финиш: 01.ноя.2016 в 05:00:00
Турнир завершён!
• Турнирная таблица

Гость
• Вопросы к жюри (1)

Задачи турнира

• FE2. 50988 - Laplacian Filter
• FE3. 51075 - Shortest Path for Bishop
• HW011. 51008 - Sum of Regional M...
• HW012. 51009 - Sum of the nth row
• HW021. 51011 - Decoding the Path
• HW022. 51012 - Palindrome-k
• HW023. 50741 - DNA Distance
• HW031. 51015 - Student Scholarships
• HW032. 51014 - Nine Men's Mor...
• HW033. 50925 - Optimizing Elevator...
• HW051. 51019 - Finding the hidden...
• HW052. 51020 - Number of nodes r...
• HW061. 50448 - Paint Buckets
• HW062. 51021 - Number of Nodes
• HW071. 51042 - The most frequent ...
• HW072. 51043 - Genome Sequencing
• HW081. 51044 - Number of Trees

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan.

Nine Men's Morris game

In Nine Men's Morris game, the players try to place their pieces on adjacent points so that they can remove one of the opponent pieces. For example the pieces on b2, d2 and f2 are adjacent on a line. Similarly, the pieces on d7, d5 and d6 are also adjacent on a line. But the pieces on b4, c4 and e4 are not adjacent on a line.

Question: Write a program that reads the positions of 4 pieces and decides if any three are adjacent on a line.

Input specification: You will be given the coordinates of 4 pieces, a letter and an integer separated by a space.

Output specification: Show "Yes" if any three are adjacent on a line, or "No" otherwise.

Sample Input 1
a7 d6 d7 g7

Sample Input 2
b4 c4 e4 g4
Sample Output 1
Yes
Sample Output 2
No

Explanation: In the first sample, the pieces a7, d7, and g7 are aligned on a line.
In sample 2, no three pieces are aligned on a line.



Для отправки решений необходимо выполнить вход.

www.contester.ru