A tragicomic party (plz help me)

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2007
Posts: 2
Reputation: amin3d is an unknown quantity at this point 
Solved Threads: 0
amin3d amin3d is offline Offline
Newbie Poster

A tragicomic party (plz help me)

 
0
  #1
Nov 8th, 2007
Problem :::

Last night, I’d been invited to a party. After dinner, the host invited us to do a lottery game and gave
each of his N guests (including me) a ticket. Each ticket was a white square piece of paper in which a
positive number (with no leading zero) were written by English digits in the center. He told us the
numbers on the tickets are distinct numbers in range 1 to N, but I was not sure due to a historical
background of his personality!
Moving an eye, I read k tickets of other guests and concluded the original numbers can’t be unique
numbers in set {1, 2, …, N}. Do you agree me?!

Input
Input consists of 1 <= t <= 100 datasets, coming one after another. Each datasets begins with two
numbers n and k. Thereafter, in the second line, k strings (of digits 0 to 9) comes which are the
numbers I saw in guests hands. It’s guaranteed that 1 <= K <= N <= 1000 and no string (in second line of
each dataset) has no more than 5 characters.

Output

For each dataset, write “Never trust him, again!” if you agree me that numbers can’t be 1 to N or “Calm
down, Dude!” if you think I might be wrong.

Sample Input

3
80 3
9 9 81
50 9
1 2 3 4 5 6 7 8 01
69 3
11 11 31

Sample Output

Calm down, Dude!
Calm down, Dude!
Never trust him, again!

Description of sample output
Consider, I may have read the 180° rotated string of a guest! It’s, digits 6 and 9 are vertically mirrored of
each‐other and 0, 1 (which were written as a short line like “|” ) and 8 are self‐mirrored. Thus, the string
81 may be originally 18, but 11 and 31 are always 11 and 31!

do u have any idea about this problem?
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,131
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 283
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: A tragicomic party (plz help me)

 
0
  #2
Nov 8th, 2007
Sure. Start with your input, make sure it compiles and works.
Then add the next step as per the instructions. Compile and test.
Keep it up until the program is done.

You might want to Read This!
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum


Views: 408 | Replies: 1
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC