Out of curiousity after solving it like you ultimately did, I went back and brute forced it with platform threads in Java. had to make some custom classes/datastructures for the circular queue and ListOf4, but with 16 threads on a 7800x3d i got it in 5 minutes and 2 seconds. Thats also with using bit shifts for the *64/32*2048
I too had the bug with "only first occurrence matters", initially I set it to put the maximum value for each sequence, but found the issue pretty quickly
I initially put all the sequence->win for each secret number in a hashmap, then wanted to brute force for each sequence which happens at least once for each number with all other numbers soon after I realized a could "add-up" all these hashmaps, and the maximum value from resulting hashmap will be the solution. In my input there were 1788 secret numbers, with each spitting out no more than 1996? sequences, so that was a brute-force over around 3.5 mln combinations, which is reasonable fast. Actually it is comparable to part 1, as you have to iterate over each number 2000 times.
My reading comprehension was horrible this morning. I misread the secret generation process at least five times. Part2 was a breeze compared to some of the last days :D and it still became one of my longest times
@@NStripleseven Haha I was almost hoping that it *would* be like that - there have been some days in the past that look a lot like cryptography that I have some background in, which might've given me an edge.
Yeah, it's a little tricky because on days where the problem is easy you kind of want to risk it by reading quickly and risking getting something wrong - a 50/50 at rank 50 is worth a lot more than a 100% chance of rank 200, but on days where the problem is hard you really don't want to do this because you don't have to, since reading more slowly will probably just cost you a few ranks instead of 150 ranks. That said, I'm definitely erring on the side of reading too fast right now and I should really just slow down...
Out of curiousity after solving it like you ultimately did, I went back and brute forced it with platform threads in Java. had to make some custom classes/datastructures for the circular queue and ListOf4, but with 16 threads on a 7800x3d i got it in 5 minutes and 2 seconds. Thats also with using bit shifts for the *64/32*2048
I too had the bug with "only first occurrence matters", initially I set it to put the maximum value for each sequence, but found the issue pretty quickly
I initially put all the sequence->win for each secret number in a hashmap, then wanted to brute force for each sequence which happens at least once for each number with all other numbers
soon after I realized a could "add-up" all these hashmaps, and the maximum value from resulting hashmap will be the solution. In my input there were 1788 secret numbers, with each spitting out no more than 1996? sequences, so that was a brute-force over around 3.5 mln combinations, which is reasonable fast. Actually it is comparable to part 1, as you have to iterate over each number 2000 times.
My reading comprehension was horrible this morning. I misread the secret generation process at least five times. Part2 was a breeze compared to some of the last days :D and it still became one of my longest times
reading is my worst enemy >.<
and yeah we've had some brutal days recently, nice to have a bit of a break
5:26 at least you didnt submit "v" :P
oof... 😅
I was sure part 2 was gonna be another day 17, some kind of bitwise thing. Glad it wasn’t, that one was kind of a pain.
@@NStripleseven Haha I was almost hoping that it *would* be like that - there have been some days in the past that look a lot like cryptography that I have some background in, which might've given me an edge.
all the time you try to save by not reading is wasted fixing the things you missed because of not reading…
Yeah, it's a little tricky because on days where the problem is easy you kind of want to risk it by reading quickly and risking getting something wrong - a 50/50 at rank 50 is worth a lot more than a 100% chance of rank 200, but on days where the problem is hard you really don't want to do this because you don't have to, since reading more slowly will probably just cost you a few ranks instead of 150 ranks.
That said, I'm definitely erring on the side of reading too fast right now and I should really just slow down...