omggg's blog

By omggg, 3 years ago, In English

Take L to R on number line of positive integers (no array given), find the minimum number of numbers you need from this range to get their XOR = K, else print -1. L,R,K are given in queries.

Constraint : R-L <=10^6

Any approach is much appreciated :) THAnks alot

  • Vote: I like it
  • +6
  • Vote: I do not like it

»
3 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

I can only tell whether answer will be -1 or not ..that also will take NlogN ... commenting for more suggestions .

»
3 years ago, # |
  Vote: I like it -11 Vote: I do not like it

tfg can you comment?

  • »
    »
    3 years ago, # ^ |
    Rev. 3   Vote: I like it +21 Vote: I do not like it

    First of all, why me? Second of all, how many queries. Also, can you please give the problem source? This problem seems too specific for something you came up by yourself.... I have a decent solution but I won't tell if you don't give the source.

    • »
      »
      »
      3 years ago, # ^ |
      Rev. 2   Vote: I like it -16 Vote: I do not like it

      I was solving a similar problem...just wondered if this is a new problem. It has no source..just asking for gaining for about this range..query topic :)

      Find you many times in comment section helping, so asked you. There's no constraint..its just a discussion problem merely for gaining knowledge :)