HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Array and Matrices > problem:


50371 - Modified Karnaugh-Map

Guest
• Review clarifications (1)

Volume problems

• 50998 - CEN112 Homework, quiz av...
• 50804 - Marathon
• 50835 - Club Presidency
• 50526 - Gold Market
• 50458 - Weekly Report
• 50872 - Top M Grades
• 50868 - Sort Frequencies
• 50405 - Accounts Receivable
• 50371 - Modified Karnaugh-Map
• 50908 - Buy 1 Get 1
• 50906 - The Smallest Pair
• 51043 - Genome Sequencing
• 51042 - The most frequent k-mer
• 51149 - One Piece Arena
• 51069 - Last Digit of a Fibonacci Nu...
• 50659 - Covariance Matrix
• 50977 - Gaussian Elimination

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
By Ardit Meti.

Modified Karnaugh-Map

Your professor wants you to find which value A,B,C or D changes in two different indexes. e.g. if he gives 11 and 10,

  • for 11: A=1; B=0; C=1; D=1;
  • for 10: A=1; B=0: C=1; D=0;
so you should print D.

Question:

  • You are given 2 numbers. You will give the result only if they are in same row or column, you can't pick 0 and 5 for example.
  • Also the numbers must be adjacent or border numbers, for ex. 4 and 6; 0 and 8. You can't have 0 and 12 or 0 and 3.
  • The indexes 0-15 are as shown in figure.

Question: Write a program that gets two numbers which are between 0 and 15. Then, your program finds which letter A,B,C or D is different or changes in those indexes.

Input specification
You will be two different numbers between 0 and 15.

Output specification
Show one letter (capital): which value (0 or 1) is different or changes in those indexes. If any of the two restrictions are violated print "ERROR"

 Sample Input I     Sample Input II   
 0 2
 5 15
 Sample Output I     Sample Output II   
 C

 ERROR


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

www.contester.ru