Блог пользователя omggg

Автор omggg, 3 года назад, По-английски

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

  • Проголосовать: нравится
  • +6
  • Проголосовать: не нравится

»
3 года назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

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

»
3 года назад, # |
  Проголосовать: нравится -11 Проголосовать: не нравится

tfg can you comment?

  • »
    »
    3 года назад, # ^ |
    Rev. 3   Проголосовать: нравится +21 Проголосовать: не нравится

    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 года назад, # ^ |
      Rev. 2   Проголосовать: нравится -16 Проголосовать: не нравится

      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 :)