How are there submissions that are under 90 seconds?

https://midwest.social/post/20007010

How are there submissions that are under 90 seconds? - midwest.social

I was looking through the global leader board for day 3 today and noticed that the first 100 results are all under 90 seconds, with the top 4 being under 30 seconds. How is that possible? What are people leveraging in order to accomplish this?

Thinking about it a little more, the answer is a number, and the site tells you if you are too high or too low, so a modification of a binary search might be the answer? I’m not sure if there is a submission limit but if there isnt then that could result in a fast submission.

Say the answer is 400 and you guess 100, the site tells you it is too low, you guess 1000, the site tells you its too high, now you know its between 100 and 1000, so you can narrow it down with a guess in the middle until you get to the answer. With some automation this would be pretty quick but it would defeat the point of the challenge.

I haven’t had time for the AoC yet, but if it’s like last year, there are rate limits that would make binary search ineffective.
Ah yeah, if you can only submit once every 30 seconds or something that would defeat the ability to binary search, at least at the speeds that people were submitting today.
The timeouts become greater the more times you submit an incorrect answer

The timeouts are 1 minute for the first 5 attempts, then 5 minutes.

People are just really used to AoC’s format and use languages/frameworks that are extremely concise

That is impressive, I think it took me more than 30 seconds to get the regex I wanted to use correct, more or less the rest of the solution. This is my first time doing AoC or anything like it so I wasn’t expecting to be anywhere near the top, but the times I saw there were shocking.
There are a lot of people participating. Some of 'em are bound to be really really good, and also get lucky!

Yeah, you could automate it, but that’s going against the spirit of the event. And if you can automate guessing, why not just try to solve the challenge?

They’re probably using AI. It’s technically cheating, but I wouldn’t personally hold it against them since nothing really seems to be at stake.

Practice. I’ve seen some recordings of top solvers in the past. They pretty much know exactly what to write, and they type really fast.

Professional code golfers (Is that the right term?) build up a large suite of helper libraries from past events/from daily puzzle solving that they invoke for common problem types like graph search or constraint solving.

I assume the most difficult aspect of the problems is to translate the statements into actual code constraints/filter functions. So the spirit of the competition is not broken by having pre-written code (Although I am not sure many would think pre-written code is acceptable).

See for yourself! This is someone solving day 1 of this year:

youtu.be/ym1ae-vBy6g?si=jbjfMMsxMveKrbLS

If you’re really going for it, you can automate some of the busy work like getting the input file and a template that’s ready to read it in and split it into lines, then it’s mostly a matter of skimming for what to do and knowing how to zip/map/fold/reduce/etc the data quickly. I was a bit surprised to see him having to add imports to his file, I’d think he’d have those ready to go, and of course quitting out of Vim to run the script isn’t necessary either, but I can’t judge because I definitely do that too…

Advent of Code 2024 Day 1

YouTube
Last year, there were lots of AI solutions and they got it in like 3 seconds once.

Wait, what are you guys doing? A coworker an I are the only ones participating, but here’s from our Benchmark DotNet implementations. I’m trying F# and I’m not terribly good at it.

I went with the temptation to use FParsec, the F# implementation of the Parsec parser combinator and he went with the regex.

Day 03

Me Well, there’s definitely a problem in the language ext Parsec implementation. Part 2 doesn’t even finish due to a stack overflow. So, bear that in mind if you think about using it.

Method Mean Error StdDev Gen0 Gen1 Gen2 Allocated CSharp_Part1 37,304.9 us 402.32 us 335.96 us 5714.2857 1000.0000 357.1429 34812.99 KB FSharp_Part1 326.3 us 1.10 us 1.03 us 129.8828 1.9531 - 795.74 KB

Him

Now that I’m barely using LanguageExt I finally have a chance in the benchmarks game! Since I did still use generic numerics, I decided it would be fun to compare performance of different numeric types, which went about exactly as expected (all fast, but bigger primitives slightly slower)

Method Mean Error StdDev Gen0 Gen1 Allocated Him_Int_Part1 287.9 us 0.77 us 0.68 us 106.4453 0.9766 654.53 KB Him_Long_Part1 290.7 us 2.64 us 2.34 us 106.4453 0.9766 654.53 KB Him_Decimal_Part1 372.6 us 5.25 us 4.91 us 107.4219 0.9766 659.81 KB Him_Int_Part2 247.6 us 4.64 us 4.56 us 78.6133 27.8320 484.55 KB Him_Long_Part2 264.0 us 3.82 us 3.19 us 78.6133 27.8320 484.55 KB Him_Decimal_Part2 363.2 us 7.24 us 8.34 us 79.1016 33.6914 487.39 KB

Day 04 - Me

My FSharp code is using a lot of Options and Tuples, which default in F# to reference types. This is a LOT of churn (48 and 38 MB, respectively). I’ll post the results here and then try to restructure the code to use the struct (…) and voption types if I can to use the value type versions.

Method Mean Error StdDev Gen0 Gen1 Gen2 Allocated Me_Part1 11.39 ms 0.035 ms 0.029 ms 8000.0000 156.2500 - 47.95 MB Me_Part2 10.03 ms 0.197 ms 0.211 ms 6437.5000 140.6250 15.6250 38.58 MB

After the Value Option refactor. It helped on memory a bit, but not as much as I thought it would. Part 1 was almost the same, but part two improved a lot. I’ll keep the code as is for now since I already wrote the helper methods.

Method Mean Error StdDev Gen0 Gen1 Allocated Me_Part1 14.079 ms 0.0345 ms 0.0288 ms 7281.2500 140.6250 43.62 MB Me_Part2 7.321 ms 0.0253 ms 0.0211 ms 2257.8125 148.4375 13.55 MB Me_Part2Parallel 2.208 ms 0.0315 ms 0.0295 ms 2269.5313 27.3438 13.56 MB