DUCKS - Here be ducks

no tags 

Ducky the Duck was walking by and he had a little idea, he wanted to see if making a line of dots with his pencil and throwing the letters of his name randomly at it he would be able to pick up the letters again and write his name perfectly, but some times when he throws them they fall out of the path. Ducky also throwed random characters to replace some of the dots, when he reaches a random character before he find his name he gets mad and scream NO DUCKY!, task is simple, just find Ducky´s name on the path he made.

Clarifications:

  1. Ducky starts looking for his name from the beginning of the string.
  2. Ducky want to find the letters of his name that means 'D' 'u' 'c' 'k' 'y' another letter even the letter 'd' is considered a random character.
  3. When he steps a dot he will keep searching for the name, if he steps a letter of his name and hasn´t found them all he will keep searching, when he finds a random character he will stop.

Input

T = Number of test cases, which are less than 20.

Then T lines will follow, each of them having a string representing the Ducky´s path.

Output

Output NO DUCKY! If you cannot find his name, otherwise print DUCKY IS HERE!

Example

Input:
5
Ducky...
.D...ucky
...Duck...
..D...uck!y
..u.c..ky.D

Output:
DUCKY IS HERE!
DUCKY IS HERE!
NO DUCKY!
NO DUCKY!
DUCKY IS HERE!

Extra: time limit reduced because there are fewer than 20 test cases and there is people getting 0.45 seconds on their answer, which for Ducky is unacceptable.


hide comments
Shekhar: 2012-06-02 10:36:04

I dont know why i m getting WA,my code gives correct output for each case on my laptop. Please check my solution.
ID-7077476

EDIT: The characters can be anything on the ASCII table

Last edit: 2012-07-15 05:17:35
:D: 2012-05-26 09:46:01

I don't care all that much about what "many people" think. All I know is that it's pointless to trip user over on such ambiguous descriptions. Especially since it's an easy problem often tried by beginners. You might as well had a case where the problem setter meant printable characters and had some problem with the new lines in the input (happens quite a lot). Then AC's and WA's would be other way around and you would get "too obvious" comments from the other group.

:D: 2012-05-13 16:16:38

Edit: actually, when it says a random character it refers to any character. And cases like DDDDuuuuckkkkyyy are not in the test cases because the name of Ducky is "Ducky" and the letters of his name aren´t random characters. However i put in the description one time: "check out ASCII table" but i put it off because many people told me it was too obvius.

Last edit: 2012-05-15 21:33:40
Darky: 2012-05-13 14:35:06

why has this one been moved to tutorials?

Divanshu: 2012-05-12 17:52:46

WA!! :( Tried every possible test case!
What am I missing?

Loving Primes Yummy :D :): 2012-05-12 16:34:56

I tried all the given test cases as well as the test cases mentioned in the comment.... But getting WA.. Plz check my solution ID 6981318 :(

LOL... Got AC
What a silly mistake... Really sometimes a silly mistake can make ur whole day worse.... !!! :)

Last edit: 2012-05-12 17:54:39
Giorgos Christoglou: 2012-05-12 12:44:14

@Problem Setter can you give me a hint of why my solutiOn (ID:6922231) is wrong ? i have tried all the possible inputs and i have read the statement very carefully ...

npsabari: 2012-05-09 09:53:35

Getting WA :( so many submissions..
@problem setters: can you tell in what kind of test cases i am going wrong.
ID :6965490

Read more carefully the problem and

DDDDuuuuucccckkkkyyyyy is a valid string

Last edit: 2012-05-11 23:53:52
Alex Anderson: 2012-04-20 06:03:48

If you are getting it wrong, then you aren't reading the problem statement correctly.

Amritesh Anand: 2012-04-19 16:41:29

what is the trick here?? what is the limit length of the string


Added by:Rocker3011
Date:2012-04-07
Time limit:1s
Source limit:5000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:Own problem