### omggg's blog

By omggg, 3 years ago,

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 years ago, # | ← Rev. 2 →   0 I can only tell whether answer will be -1 or not ..that also will take NlogN ... commenting for more suggestions .
•  » » 3 years ago, # ^ | ← Rev. 2 →   0 Much appreciated , please share your approach :) Sahilamin219
 » 3 years ago, # |   -11 tfg can you comment?
•  » » 3 years ago, # ^ | ← 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 years ago, # ^ | ← 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 :)