There is a sequence of numbers of length (), with each number being either 1, 2, or 3. Can you guess this sequence?
Interaction
This is an interactive problem. You should keep outputting numbers between 1 and 3, inclusive and reading a line of input after each output. The line will be NO
if your guess for the current position is incorrect or YES
if you guessed the current position correctly. If you guessed the whole sequence correctly, you will receive a single line DONE
, and you should terminate your program then.
After each time you output a number, you might need to flush the output. In Python, you can do this with sys.stdout.flush()
(after you import sys
).
Sample Interaction
>>>
denotes your output: don't actually print this out.
>>> 1
YES
>>> 3
NO
>>> 2
YES
>>> 1
NO
>>> 2
NO
>>> 3
YES
DONE
Explanation
The sequence is 1, 2, 3.
Note
There is only one input file, and the length of the sequence is exactly . Your score will decrease with more wrong guesses, so guess as wisely as you can given that you have no information whatsoever about the secret sequence (or… do you?).
Comments
Does anyone know why it gives me AC even with 64/100?
It gives AC because the output is correct, but 64/100 is given because:
Hence you get partial score
Can someone give another hint for this question?
Take a closer look at the problem ID
wait, but my solutions should work right?, its 15 * 3 = 45, should easily run in time, why does it give me tle?
You TLE because you never read the "NO" or "YES" that comes right after your output. The "DONE" always comes after a "YES", so your program never terminates.
Try flushing your output
I'm having a hard time understanding the question. I thought it was asking me to create a "game" where the user inputs a number and if the user guesses the right number, it moves on to the next line.
Perhaps I'm failing the time limit or my understanding of the question is way off.
It's kind of a riddle question.
This comment is hidden due to too much negative feedback. Show it anyway.
I get the feeling that this problem is somehow related to Maplestory...
Yeah, Ludibrum Party Quest x)
All those years of Maple ended up paying off x)
jk, scrub me never got to Ludi. I googled a walkthrough forum. x)