944,202 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 514
  • C++ RSS
Nov 8th, 2007
0

A tragicomic party (plz help me)

Expand Post »
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?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
amin3d is offline Offline
2 posts
since Nov 2007
Nov 8th, 2007
0

Re: A tragicomic party (plz help me)

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!
Moderator
Reputation Points: 3280
Solved Threads: 897
Posting Sage
WaltP is offline Offline
7,753 posts
since May 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Complete Noob. Reading/Writing to/from Textfile
Next Thread in C++ Forum Timeline: Write a program to calculate ....





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC