GUESSING - Number Guessing Game


Please login first to view this problem. :-)


hide comments
roni_roy18: 2019-06-03 08:00:58

Good Fun:)

riyadhrazzaq: 2018-10-02 17:49:41

I guessed the number using brute force. Can someone explain why this is tagged "binary-search" ? How do I solve it using binary search ?

jyotiradityafc: 2018-08-28 19:40:23

Suppose the answer is 121565. In this case, the display will be "6A4B" as all positions are correct hence "6A" and as you can see 1st '1' for 3rd place is wrong, 3rd '1' for 1st place is wrong. Similarly, 4th '5' for 6th place is wrong, 6th '5' for 4th place is wrong but numbers are correct hence "4B".

Another example, suppose 555555 is the answer and you guessed 125536 then the display will be "2A8B". Check it carefully.

slinky: 2018-07-01 20:36:48

0..5 = {0,1,2,3,4,5} = indices of the digits of the guessed and correct number. For example guess[2] is the 3rd digit of guessed number.

kaushalag29: 2018-07-01 11:36:12

Loved guessing it!

ram777: 2018-02-18 15:07:46

i heard this words from jack ma

Last edit: 2018-02-18 15:08:11
hitesh87: 2017-12-18 19:08:38

Fun activity ;p

alexandro5432: 2017-09-26 14:40:30

Very hard problem i think the solution must be O(n*n)

aronzx: 2017-08-24 08:26:19

Very different and fun problem.

rajni_iit96: 2017-08-11 07:26:40

interesting :)


Added by:Bin Jin
Date:2008-05-26
Time limit:0.100s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:TEXT
Resource:the (first?) "interactive" problem on SPOJ