The thing is: all values are the binary OR of each of its ancestor. lets say K=2 and C=3. the value at p=0 corresponds to k[0] || k[0] || k[0] the value at p=1 corresponds to k[0] || k[0] || k[1] the value at p=2 corresponds to k[0] || k[1] || k[0] the value at p=3 corresponds to k[0] || k[1] || k[1] the value at p=4 corresponds to k[1] || k[0] || k[0] the value at p=5 corresponds to k[1] || k[0] || k[1] the value at p=6 corresponds to k[1] || k[1] || k[0] the value at p=7 corresponds to k[1] || k[1] || k[1]
In a more formal way, the value n corresponds to the OR product of (k[n/k^(i)%k] for i=0 to c-1 So, "all"you have to check is that you are checking all possible values from 0 to k-1 when you consider all values of n given in the input. Le mar. 12 avr. 2016 à 14:39, meir <[email protected]> a écrit : > I understand how to construct a correct solution, yet there are many > correct solutions and It alludes me how this was verified? > Did you attempt to construct a contradicting example, is this something > which is guaranteed to catch all incorrect submissions? > > -- > You received this message because you are subscribed to the Google Groups > "Google Code Jam" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/google-code/1606b971-194c-47fa-9da6-521ae4fa80d7%40googlegroups.com > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-code/CA%2B5pNgLRjeGpaqWQOYckeXGzw2qLEnE6CZOVbr%2BcvzLp3ytrmQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
