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

Разделы > Linear Data Structures: Arrays > задача:


51014 - Nine Men's Morris game

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

Задачи раздела

• 51125 - Filling an Array 3
• 51085 - xyx Divisible by k
• 51087 - Are they the same?
• 51091 - Guess the number - 1
• 51015 - Student Scholarships
• 51008 - Sum of Regional Maxes
• 51020 - Number of nodes removed
• 51141 - Most valuable stock items
• 51014 - Nine Men's Morris game
• 51019 - Finding the hidden message
• 51100 - Minimum time to exit building
• 51089 - Multiply a row and add it to ...
• 50525 - Ordering Pizza
• 50531 - File Decryption
• 50360 - National Elections
• 50469 - Letter Grades
• 50468 - Draw Matrix - 2

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

Если у вас есть предложения или пожелания по работе 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