Skip to main content
17 events
when toggle format what by license comment
Jan 17, 2021 at 6:00 history tweeted twitter.com/StackCodeReview/status/1350684308755910658
Nov 28, 2020 at 19:28 answer added David G. timeline score: 1
Jul 24, 2014 at 22:09 vote accept Ryan McClure
Jul 24, 2014 at 21:35 answer added Jason Goemaat timeline score: 6
Jul 24, 2014 at 20:10 comment added Ryan McClure I don't think they can be, since 0 <= x <= 32,768 and there can be up to N=100000 of them.
Jul 24, 2014 at 20:04 comment added Jason Goemaat No need to store the results in an array, you can just track the max in the loop. I get timeouts too, it seems to be only 2s. I downloaded sample 1 and it has 3 tests, each with N=100000 and Q=10000. I have an idea to speed it up by putting the numbers in a B-Tree at the start, based on most-significant bit... I might try that... It would be easier if the x numbers were unique, are they supposed to be?
Jul 24, 2014 at 19:52 history edited Ryan McClure CC BY-SA 3.0
added 6 characters in body
Jul 24, 2014 at 19:46 answer added vnp timeline score: 7
Jul 24, 2014 at 19:33 history edited Ryan McClure CC BY-SA 3.0
added 15 characters in body
Jul 24, 2014 at 19:30 answer added Jamal timeline score: 9
Jul 24, 2014 at 19:20 comment added Ryan McClure Yes, that is correct. I used that for loop as an optimization for counting down to zero described on this site
Jul 24, 2014 at 19:17 comment added Jason Goemaat I get a little lost with these. Are these values right for the sample test case? N=15, Q=8, x<sub>1</sub> to x<sub>15</sub> are 1 to 15. There are Q (8) lines after the x values. a<sub>i</sub>, p<sub>i</sub> and q<sub>i</sub> are on each of those lines? And p<sub>i</sub><=j<=q<sub>i</sub> means that you basically loop through the numbers from the second and third number on that line in you array of x elements and xor it with the first number on that line, then return the maximum result you get?
Jul 24, 2014 at 19:00 history edited 200_success
edited tags
Jul 24, 2014 at 19:00 history edited Jamal CC BY-SA 3.0
deleted 21 characters in body; edited tags; edited title
Jul 24, 2014 at 18:54 history edited Jamal CC BY-SA 3.0
deleted 21 characters in body; edited tags; edited title
Jul 24, 2014 at 18:53 review First posts
Jul 24, 2014 at 19:01
Jul 24, 2014 at 18:49 history asked Ryan McClure CC BY-SA 3.0