| | |
A tragicomic party (plz help me)
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Nov 2007
Posts: 2
Reputation:
Solved Threads: 0
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?
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?
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!
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
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
![]() |
Similar Threads
- can someone plz help me with this? (Visual Basic 4 / 5 / 6)
- I NEED SUPPORT **"IMPORTANT"** PLZ HELP (Windows NT / 2000 / XP)
- Email problem in php. Plz help me (PHP)
- Windows media player (Windows NT / 2000 / XP)
- can sum1 look @ dis plz (Viruses, Spyware and other Nasties)
- Hijackthis log file - plz help (Viruses, Spyware and other Nasties)
- IE not working...PLZ help :cry: (Web Browsers)
- PLZ help it's urgent! (Web Browsers)
- plz help ppl...... (Computer Science)
Other Threads in the C++ Forum
- Previous Thread: Complete Noob. Reading/Writing to/from Textfile
- Next Thread: Write a program to calculate ....
Views: 408 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file forms fstream function functions game generator getline givemetehcodez graph iamthwee ifstream image input int java lazy lib loop looping loops map math matrix memory multidimensional multiple newbie news node number numbertoword output pointer problem program programming project proxy python random read recursion recursive reference return sort sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






