[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
▼ Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1765601836920840.jpg (157 KB, 462x260)
157 KB JPG
>Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other.
https://adventofcode.com/

/g/ leaderboard join code:
224303-2c132471
anonymous-only leaderboard:
383378-dd1e2041

is it still a wall if there is nobody there to be filtered by it

Previous thread: >>110483600

I dont remember if there was a day-by-day naming convention or if number just go up by one
>>
File: solve.png (115 KB, 2075x638)
115 KB PNG
idiomatic Rust solution
>>
File: aoc-2026-02-cpp.png (542 KB, 2048x2532)
542 KB PNG
Version 3, C++ with Qt. (Version 1 was Python, Version 2 Emacs-Lisp.)
>>
File: matt godbolt.png (867 KB, 1280x720)
867 KB PNG
Matt Godbolt is doing Advent of μarchitecture this year.
https://www.youtube.com/playlist?list=PLN7owJBX-Fcc

Also check out his Advent of Compiler Optimisations he did last year.
https://www.youtube.com/watch?v=j-BwR-Cw0Gk
>>
File: file.png (82 KB, 644x938)
82 KB PNG
reustpostan
>>
Im a bit late to start
#!/bin/bash
#day 1
#1
sort input| uniq -c | sort | tail -n 3 | awk 'BEGIN { ml = 1 } { ml *= $2 } END { print ml }'

#2
sort input| uniq -c | sort | head -n 3 | awk 'BEGIN { ml = 1 } { ml *= $2 } END { print ml }'
>>
File: fuckwebp.png (535 KB, 715x981)
535 KB PNG
bigboy #2
url: https://gofile.io/d/b9mffmvi
size: 142M
silver: 558275033
gold: 893216516
>>
>>110492326
What does that mean? Is there a website? I'm not watching a video.
>>
>>110492326
literally who?
>>
File: file.png (83 KB, 1162x793)
83 KB PNG
>>110492229
My solution for today's second problem
>>
>>110492413
bigboy should've added more colors, this hardly counts as a medium boy
>>
File: 1771572790249406.png (1.7 MB, 1408x768)
1.7 MB PNG
day 2 sloppa
>double gs
>same themes as before
oh well
>>
>>110492542
404 SOVL not found
>>
>>110492427
clearly you're supposed to point your agentic stt AIs at it, duh.
but ya, shit that should be a blog as youtube videos is incredibly homosexual.
>>
>>110492326
buy an ad
>>
File: file.png (145 KB, 796x595)
145 KB PNG
Not done AOC for a few years, does the difficulty spike much faster for the 12 day format?
>>
>>110492694
It does spike faster out of necessity, but the ramp up last year was still gentler than straight up removing every other day of a previous year.
>>
bigboy.txt is freezing my editor
evil hacker 4chan .\/.
>>
>>110492694
i dunno anon, i can struggle for 10 hours on a day 5 and solve day 16 in 10 minutes sometimes. usually the first 4 - 6 days are kinda babbymode but he can interleave a weird one sometimes.
>>
is it creative bankruptcy or smart use of AI if I make an unwashed solution, get the gold star, and then ask chudde to clean it up?
>>
>>110492811
>solve day 16 in 10 minutes sometimes
The 2022 elephant in the room would like a word
>>
distance=893216516 in 88.0279277s

it's really tense if you don't know if you've run out of memory for over a minute
>>
File: d2.png (264 KB, 1016x1242)
264 KB PNG
idio(ma)tic guile scheme
>>
both parts took like 3 seconds but Unity threw a memory error on first run for some reason, worked the second time
>>
>>110492858
i managed to get rid off 1 heap allocation and i cut it down to
distance=893216516 in 6.4755381s
>>
>>110493080
post code nigger
>>
File: day2.png (21 KB, 844x388)
21 KB PNG
>>110493170
>>
knocked this bastard down to ~80ms, single thread, no SIMD
>>
File: smol.png (56 KB, 559x1056)
56 KB PNG
>>110492413
1.16secs
>>
>>110493290
6s is fine if this is an interpreted language
>>
File: weawo.png (68 KB, 1250x545)
68 KB PNG
>>110493389
forgot image
>>
File: freeze.png (2.2 MB, 3006x5104)
2.2 MB PNG
The middle ground between working out the exact clock math for scores and shit would to make the inside loop O(1) by caching the position so im not starting from scratch each estimate. I think it'd make the entire thing `O(n)` and I wouldn't have to write any clock math equations anywhere.
>>
Time to feel very clever before realizing everyone here probably did the exact same thing.
>>
I hope day 12 will demand that you have made a general solution for each day so that every single numerical chimera here gets punished
>>
File: carbon (1).png (270 KB, 1222x1544)
270 KB PNG
>>110492413
150ms
I posted another in the previous thread that doesn't get part 2 right, this does
also gcc-14 -O2 generates a faster binary than -O3, I'm surprised
>>
>>110493576
big brain if part 2 correct
>>
>>110493576
cozy terminal
I used to have an xscreensaver like that
>>
>>110491422
Wow someone actually read mine, even if just skimming it? I thought my shitty solution paled in comparison to all the other clever ones posted here. Thanks, anon.
>>
>>110493717
I love my warm phosphor glow. This one is just cool-retro-term.

>>110493694
sorting without actually sorting :)
>>
>>110493772
yeah I tried and couldn't find an input that yours gets wrong
congrats anon I would have never thought about that
>>
File: file.png (328 KB, 1000x1736)
328 KB PNG
>>110490603
>>110491702
35ms / 76ms on bigboy

also my first post this year. holy shit these threads are so slow now. where is everyone
>>
>>110493864
>where is everyone
Dead hobby.
>>
>>110493864
turns out most programmers are in it for the money and not because they're autistic
>>
>>110493925
who says you cant be both, pfft
>>
>>110493925
what "money" did they make on doing AoC for previous 10 years?
>>
>>110493934
He's saying they didn't do it because they only consider it as their work, not because they genuinely enjoy programming.
>>
so I read commens on HN today.
people seem demoralized
>>
>>110493998
AI has in the last couple months eclipsed human intelligence with no sign of stopping, in fact it's speeding up
Everyone who gets paid for their problem solving ability should be demoralized
>>
File: 2a.png (53 KB, 1200x1200)
53 KB PNG
I feel so dumb for inspect elementing this one's easter egg.
>>
File: 2b.png (50 KB, 1200x1200)
50 KB PNG
>>110494152
>>
>>110494113
it's SI now
>>
>>110494163
oh shit

is there even a ceiling?
>>
File: ahoooa.png (33 KB, 410x122)
33 KB PNG
>>110493484
last one now with more details, cold page access measured separately.
>>
>>110493925
>be normie SWE
>just attend meetings/standup
>put pull-requests in the bag
>hit goals, get bonus.
>Clock out go home (or already home if WFH)
>get head from your gold-digger GF or ,if lucky, the GF you probably didn't meet in UNI
>repeat until you die

Lifemaxxing is honestly better than sitting infront a glowing rectangle 24/7. Also programming as a hobby wont get you any girls, nobody really understands what you do, you can't really flex it on instagram. Its a mid-tier hobby at best. I like programming but there are more important things life if we're being real.

>>110494113
Aren't all the recent math breakthroughs essentially just "we did a stochastic state-space search of all plausible proofs with an LLM" Its just running an agent in a loop making guesses at possible proofs. I mean its crazy that any of that actually works but still.
>>
>>110494152
>>110494163
nice
>>
>>110494204
>get girls
i practice my hobby to get away from my girl
>>
> write unit tests based on examples
> all tests pass, feels good
> actual input file fail, answer too high
> forgot to trim input like a brainlet and considered '\n' as a 'v', because proper error handling not my thing.
>>
>>110494163
pushing gaywards
>>
File: 2.gif (71 KB, 1200x1200)
71 KB GIF
>>110494195
>>
>>110494278
this shit happened to me too.
all my tests passed, but \n caused my program to never end
>>
>>110494278
>modifying the input to pass
you got filtered
>>
Clojure

(ns day02
(:require [clojure.string :as str]))

; Takes a pair, returns distance
(defn distance [[from to]]
(if (< from to) (- to from) (+ (- 6 from) to)))

(defn total-distance [positions]
(->> (cons 0 positions)
; Get pairs of positions
(partition 2 1)
; Get distance of each pair
(map distance)
(reduce +)))

(let [data (str/trim (slurp "input.txt"))
roygbvPos (zipmap "roygbv" (range 6))
positions (map roygbvPos data)]
(println (total-distance positions))
(println (total-distance (sort > positions))))
>>
>>110494204
Ability to follow a plausible proof strategy to success or failure - LLMs definitely a lot faster
Breadth of knowledge to find possible connections in - LLMs much better
Intuition of which possibilities are the most promising - top .01% of human experts maybe still better but I really doubt that continues to be the case and that doesn't matter to the other 99.99% of us anyway
Every upper middle class job for high IQ people is cooked
>>
>>110493576
absolutely insane anon
>>
>>110493998
any topic in particular or just generally
>>
>>110492542
>13 GB of RAM
Holy shit, I kneel. Who the fuck thought it was a good idea to teach Haskell to Durga Durgason?
>>
>>110493576
name your variables better if you want me to read it
>>
>>110494410
she doesn't want YOU to read it, anon. you are filtered.
>>
>>110493484
Explain the deduction part? How does it keep track of the difference between if e.g. green is missing? Won't deduction always be 1 in either case?
>>
>>110492229
Is it still 12 days this year or did he cut the length again?
>>
>>110494472
It is three days this time. So tomorrow is the end, unfortunately.
>>
>>110494459
Because the gold calculation is based on the number of characters multiplied by 6, but the actual required amount depends on the highest priority color present and everyones input is different. my input is missing a y, your input might be missing an o and bigboy is missing r, y and o.

static bool Contains(StringView s, char8 c)
{
const int chunk = 64;
int i = 0;
for (; i + chunk <= s.Length; i += chunk) {
uint8 acc = 0;
for (int j < 64)
acc |= (uint8)((s[i + j] == c) ? 1 : 0);
if (acc != 0) return true;
}
for (; i < s.Length; i++)
if (s[i] == c) return true;

return false;
}


This gets beautifully autovectorized.
>inb4 yUo sAiD nO SiMd!!!
>>
Reusing part 1 for part 2, I know it's stupid but it works
>>
>>110494476
What a shame. I take it that means next year will probably be a one day event.
>>
>>110492435
Tourists need to go.
>>
>>110494542
I don't understand why. The longest path would be to take every red first, then every violet, every blue, every green, every yellow and last every orange. Because then the step size is six the most amount of time, but the transfer between colors is where you'll see reductions. If you e.g. have violets, then after all reds you take five steps. But if you don't but have blue you instead take four steps to blue. And if you are instead missing green you take four steps between blue and yellow.

How is that information kept in this solution? I know it works because this anon has the same solution: >>110493576
But I don't understand the math behind it.
>>
>>110494542
Not everyone has the same input?
>>
>>110494635
Nvm, jesus christ I am dumb sometimes
>>
>>110494743
It's ok anon, I started with a crappy solution and a few aha-moments and incremental improvements later, here we are.
>>
I forgot to read the story last night.
>>
File: eric.png (1.87 MB, 1536x1024)
1.87 MB PNG
>>110494834
... and there's nothing to it. AOC is so over.
>>
>>110492542
>"Where's drawanon?"
i'm missing drawanon like a mf
>>
>>110494315
look at her go
>>
>>110494834
WOW! You may no longer participate.
>>
>>110494472
unless eric pulls out it should be 12 this year too
>>
>>110494694
It's not 1 unique input per user, it's input pools and i think sometimes for special inputs it might be shared
>>
>>110494863
>>110494152
>>110494163
OH SHIT, he's back
>>
>>110494834
I have 528 stars and I've never read any of the story
>>
I understood that you can just count the amount of characters for p2, but it's against the spirit of the task where you're supposed to rearrange them in lore therefore I counted up each color separately
>>
File: carbon.png (1.34 MB, 1626x1242)
1.34 MB PNG
>>110492229
I miss doing this high on Etizolam...
>>
>>110495219
ewww, you can't share my position. it's MY position
>>
>>110494861
needs more booba.
>>
>>110492240
can someone who's not gay explain the bit pattern being used here?
>>
File: d2.png (543 KB, 1200x2375)
543 KB PNG
>>110492413
lightly washed simd sol, under 8ms on my coffee lake
Silver: 558275033
Gold: 893216516

Performance counter stats for './2 ../../../inputs/2/bigboy.txt' (300 runs):

28,619,488 cycles:u ( +- 0.12% )
88,391,939 instructions:u ( +- 0.00% )

0.007657380 +- 0.000025098 seconds time elapsed ( +- 0.33% )


also, when did perf's user_time and system_time break? both return 0 for some reason.
>>
>>110494152
>>110494163
I don't get it....
>>
>>110495221
what are you doing. the steps you do make no sense to me
>>
File: helloaoc.png (115 KB, 1046x964)
115 KB PNG
damn... i completely forgot about aoc. every year since 2022, i was so eager to participate and was literally waiting for it. i also thought last year was the last one? has eric changed his mind?
my lazy solution tho
>1 letter at a time because i don't want to think
>generating permutations because i don't want to think about the best order
>and using itertools for that because i forgot how to do it myself lol
>>
File: 1544776756012.jpg (62 KB, 667x800)
62 KB JPG
>>110495401
count how many times each number appears, sort the numbers (as indexes in a 2nd array) by counts, product the first/last spans of three for silver+gold...
>>
>someone posts adventofpuzzles
>no one complains
>post about advent of micro-architecture
>someone gets really mad
I don't understand.
>>
>>110495473
>don't understand
there's no understanding, this it 4chan, just ignore them
>>
>>110495464
>sorting
lol, lmao even
>>
>>110495464
you don't have to sort it.
it's enough to iterate over it once
>>
>>110495298
>A robot with program vvvvvv would travel a total distance of 35.
https://store.steampowered.com/app/70300/VVVVVV/
>>
File: needful_done.png (1.08 MB, 1498x8340)
1.08 MB PNG
please revert back with kindest feedback dears
>>
>>110495539
no unit test?
>>
>>110494410
You’re not worthy anon, sorry
>>
>>110495539
>Factories are not abstract
Anon I don’t think this is suitably maintainable and well-factored code.
>>
>>110495549
am I weird for writing unit tests and profiling AoC....
>>
>>110495539
perfect for good looks
>>
>>110495534
I see. thanks.
>>
>>110495539
why do java projects look like this?
>>
File: d2.png (328 KB, 1834x1470)
328 KB PNG
>>
File: 1776334169506733.jpg (837 KB, 1440x2040)
837 KB JPG
>>110495505
hahaha, if ur scolding the sort, you didn't notice the vector allocation methods :)
>>110495509
i do things :)

i used to golf for efficiency and code terseness in prior years, but now i m bored...
>>
>>110495783
are you trans btw? not sure if that matters.
>>
File: carbon(11).png (515 KB, 1918x2756)
515 KB PNG
perro caca
>>
>>110493576
I kneel
>>
>>110495505
fast sorts will probably be closer to O(n) and faster than a generalized hashmap, unless you use a literal direct map. Most the "unstable" sorts in modern langauges will fall back to merge or some other guaranteed n log n sort if it takes too long.
>>
>>110493934
Trying to get the attention from big software corps that they “love programming” so as to get a good job. Not sure if this ever happened, but one look at the GitHub profiles of past global leaderboards lays bare their true intentions for participating. There is absolutely zero potential upside from doing this now, so those doing it with ulterior motives (which was probably a good chunk of participants) are gone.
>>
>>110495930
as in, https://github.com/Voultapher/sort-research-rs/blob/main/writeup/ipnsort_introduction/text.md
where common case is about n * log(k) where k is distinct counts and since these problems all have limited distinct counts, it should be pretty damn close to just N
>>
>>110495930
>fast sor
No.
>>
>>110493925
I hadn't realized quite how much of my motivation was based on the dubious idea that i was in some way improving a useful skill. As it turns out purely as a form of entertainment this kind of thing actually rates quite low for me.
>>
>>110493925
Those people should be killed desu.
>>
>>110496165
Then why are you still here? Did you get filtered already?
>>
Getting really tired of the whinging about AI (which is never going away) in this thread to be honest. If you like programming participate, if not, just don't bother. Also, you'll never be a woman.
>>
the unidiomatic rust solution

pub fn part_1(input: &str) -> String {
input
.chars()
.map(|x| match x {
'r' => 0,
'o' => 1,
'y' => 2,
'g' => 3,
'b' => 4,
'v' => 5,
_ => unreachable!(),
})
.fold(0, |acc, x| {
let macc = acc % 6;
let jump = if macc >= x { x - macc + 6 } else { x - macc };
acc + jump
})
.to_string()
}

pub fn part_2(input: &str) -> String {
let instr: Vec<i32> = input
.chars()
.map(|x| match x {
'r' => 0,
'o' => 1,
'y' => 2,
'g' => 3,
'b' => 4,
'v' => 5,
_ => unreachable!(),
})
.collect();

let freq: Vec<(i32, usize)> = lib::sort(instr, |a, b| a.cmp(b))
.chunk_by(|a, b| a == b)
.map(|x| (*x.first().unwrap(), x.len()))
.collect();

(0..freq.len())
.fold((freq, 0), |acc, _| {
let (freq, n) = acc;
let mn = &(n % 6);

let (k, nk) = freq
.iter()
.max_by_key(|(k, _)| if mn >= k { k - mn + 6 } else { k - mn })
.unwrap();
let jump = if mn >= k { k - mn + 6 } else { k - mn } + 6 * (*nk as i32 - 1);

(
freq.iter().filter(|(a, _)| a != k).copied().collect(),
n + jump,
)
})
.1
.to_string()
}
>>
>>110496214
>whinging about AI
saying that most people stopped enjoying programming when AI "solved" it is not allowed?
>>
>>110496228
Yes. It's gay cope. Fuck off.
>>
>>110496214
don’t care
didn’t ask
plus you’re brown
>>
>>110495961
Perhaps if you were some thirdie in a place like India, you might dare to dream that FAGMAN would pluck you from obscurity for your coding prowess, but I doubt any normal people thought that. Those on the global leaderboard were often working for BigTech to start with, or studying at a top school.
>>
>>110496228
Exactly. It's contrived and pathetic. Chances are, you weren't any good at programming in the first place, and now there's an excuse to latch on to.
>>
>>110496228
>Um AI solved coding which is why no one cares about my fully vibed shit that doesn't work
Ok. Let me know when GTA VI is playable on PC from the Xbox binaries, o algo.
>>
>>110493925
There was no money in doing AoC.
>>
File: EricCircuit.png (1.89 MB, 1536x1024)
1.89 MB PNG
>>110495268
Here. Thank you for supporting AI Artists, it's greatly appreciated.
>>
the fact that I'm in the top 20 /g/ leaderboard tells me everything I need to know about the deterioration of aoc
>>
>>110496308
i always got top 20 here, most people are retards
>>
>>110496315
exactly, I'm retarded
>>
>>110496308
Change your name to "RETARDS_HERE_AND_BELOW" so we'll know the cut off line.
>>
File: d2_2.png (706 KB, 1930x3876)
706 KB PNG
>>110492413
>>110495289
down to 6.2ms after same minor tweaks + unrolling
Silver: 558275033
Gold: 893216516

Performance counter stats for './2 ../../../inputs/2/bigboy.txt' (300 runs):

22,795,980 cycles:u ( +- 0.11% )
60,479,735 instructions:u ( +- 0.00% )

0.006205919 +- 0.000007571 seconds time elapsed ( +- 0.12% )


might do multithreading tomorrow if d3 is boring
>>
>>110496338
this would be problematic for my work leaderboard
>>
>>110496349
Asserts your dominance by showing your coworkers their place.
>>
>>110496215
How do so many people get to this.
the arithmetic is unintuitive for me. how did so many people go for that.
>>
>>110496390
you know the answer
>>
>>110496390
Obviously all similar letters get grouped because max interval is 6 only between same letters. Then next highest is 5 to the previous letter, or last for r. So the group ordering rvbgyo is pretty obvious. Then it's just figuring out the details of how groups with missing letters affect it.
>>
>>110496349
kek
>>
>>110496404
That's cheating.
>>
>>110493576
The best one so far.
>>
>>110496390
the description literally spoonfeeds you the algorithm, what more do you need?
>>
I used to really enjoy programming, but now AI does it I guess I never did enjoy programming. The other issue I have with AoC is that we're expected to know weird math formulas like MOD and whatever the hell a Matrix is. I am a senior software engineer SCRUM leader and never once have I needed to know this, so clearly the problem isn't me. You guys really still doing this?
>>
>>110496731
Filtered.
>>
>>110496731
Yeah, just retardmaxx it, ignore clankers they can do what they've been trained on (which is a lot), but only a man can do it right.
>>
>>110494635
When no color is missing the solution to part 2 is count - 5, that only changes if the missing colors are the last ones. That is why is only necessary to know the last one in use.
>>
File: 1780101598516912.png (2 KB, 300x300)
2 KB PNG
what the fuck does eric have against Indigo?
>>
>>110496731
i won't fall for the bait, a senior SWE nowadays wouldn't even know how to open an IDE without scheduling a refinement meeting first
>>
File: file.png (68 KB, 449x236)
68 KB PNG
>>110496731
>>
>>110496760
that's purple
isn't indigo supposed to be blue
>>
>>110496731
Modulus is not necessary, you can do the same with a simple if. You only need to write down what you want, what you have, and use little kid's level Math to get from what you have to what you want.
>>
>>110496767
Unironically true. This shit is so fucking stupid.
>>
>AI griping
I finally have 128GB of RAM but Eric still hasn't given me an excuse to fill it with puzzle bruting instead of AI models.
>>
>>110496760
This tbqh

I got the answer wrong five times in a row because I can't read and thought indigo was included wondering why my %7 was fucking up
>>
>>110496731
Yes, because I really enjoy programming.
>>
>>110496991
NERD
>>
>using old leaderboard and nobody gives a single fuck

we are really the only ones left huh.
>>
File: ss.png (33 KB, 682x428)
33 KB PNG
A little late for the show, here is day 1, a piece of cake. Time for bed now tho, other two will wait til tomorrow.
>>
File: day1.png (208 KB, 1168x1172)
208 KB PNG
>>110492229
Days 1 and 2 in Lean
>>
File: day2.png (238 KB, 1042x1478)
238 KB PNG
>>
File: 1767654887115283.png (316 KB, 465x372)
316 KB PNG
if he was here he'd top every leaderboard
>>
>>110497128
The brightest mind to ever grace Cambridge.
>>
>>110497159
did more to encourage suicide than a million kys replies, by showing how effectively it could lead to punished enemies
>>
brainlet solve

from collections import Counter

with open('p02.txt') as fh:
program = fh.read().strip()

waypoints = 'roygbv'
pos = {ch: i for i, ch in enumerate(waypoints)}

def distance(program):
idx = 0
dist = 0
for ch in program:
p = pos[ch]
if p > idx:
dist += p - idx
elif p == idx:
dist += len(waypoints)
else:
dist += (len(waypoints) - idx) + p
idx = p
return dist

def rearrange(program):
cs = Counter(program)
new = 'r' * cs['r']
for wp in waypoints[::-1][:-1]:
new += wp * cs[wp]
return new

print(distance(program))
print(distance(rearrange(program)))
>>
did anyone play Order of the Sinking Star?
>>
>>110497324
Odor of the Stinking Saaarrr
>>
>>110497348
uncalled for
>>
File: file.png (226 KB, 1754x969)
226 KB PNG
>>110497348
>>
>>110497366
what is this?
>>
>>110497370
Jon Blow in the abyss because Soulja Boi dabbed on his ass so hard
>>
>>110497324
I like Odor of the Stinking Saar. The moment where the Stink Rises is Cinema
>>
File: topslop.png (2.75 MB, 1536x1024)
2.75 MB PNG
While I wait, I'll deliver some more slop for the goyim.
>>
is racket or guile more comfy that clojure for this?
>>
>>110497483
Racket much more so than guile because of the built-in library. As to whether it's better than Clojure, I'm not sure, but I'd guess it starts up faster.
>>
File: 2026, Day 02-A.png (1.33 MB, 1214x1578)
1.33 MB PNG
Anyway, Day 02...

I don't really understand how to use this language... I bitch at an LLM to compile my code and tell me what the error message actually means...

>>110495814
>trans
pfft, imagine falling for that meme
>>
>>110497492
thanks. I heard that racket was a bit of a meme or something, like the people designing it or something. was a blog post about it i think
>>
File: IMG_5439.gif (2.53 MB, 241x246)
2.53 MB GIF
I want to use Clojure but I am too retarded to get a dev environment set up. And I don’t know a single Java API. And I don’t really get FP very well. But it looks so cozy.
>>
>>110497513
It's a fun language for exploratory programming, but it's never really found a footing in the real world. Also when I say it starts up faster than clojure, I mean any initial compilation and launch delays. Overall, I'd expect the JVM to outperform Racket. I cannot really speak to Guile's performance.
>>
File: carbon(4).png (769 KB, 1684x708)
769 KB PNG
my day1
>>
>>110497531
stop coping and just do it. you will never do it otherwise.
>>
Who the fuck is Roy?
>>
>>110497658
combat model, optimum self sufficiency, probably the leader
>>
>>110497658
Pam's ex
>>
>>110497531
No lisp is good for functional programming...
>>
>>110497531
Claude, please give me the commands to set up a Clojure dev environment, and give me a brief overview of functional programming in Clojure. Also make me a table of the libraries and APIs I'll need for I/O and basic algorithmic problems. Make no mistakes.
>>
File: 1775961969793765.png (69 KB, 436x112)
69 KB PNG
>>110497324
finished just in time for AOC
>>
>>110497787
isn't there like 1500 puzzles?
>>
C, day2 all inside a for loop:
#include <stdio.h>
int main() {
for (int p1=0,p2=0,m=0,o=0,v,val[256]={
['r']=1,['v']=2,['b']=3,['g']=4,['y']=5,['o']=6};
0<(v=getchar())||printf("p1: %i\np2: %i\n",p1,p2*6-m)&0;
(v=val[v]-1)<0||(p1+=(v>=o)*6+o-v,o=v,++p2,v>m&&(m=v)));
}
>>
>>110497822
920 is the save game count, but it only factors in 'levels' there are many levels that are actually a series of puzzles (mini-overworld with a bunch of levels glued together) and also none of the overworld puzzles are included
>>
File: 1777408247904665.png (2.3 MB, 1918x1080)
2.3 MB PNG
>>110497827
Ah I see. I got it the other day, it's very comfy. I imagine it's going to ramp up hectically soon (currently ~150 puzzles deep)
>>
What are we looking at today? Automata, something to do with ranges?
>>
>>110497827
you didn't answer the question. can't you read. you featherless biped
>>
>>110497881
probably 4+ days of parsing "puzzles" next
>>
>>110497881
Advent of parsing starts now. Hope your language makes working with strings nice.
>>
File: 1781283825674034.png (311 KB, 1042x1070)
311 KB PNG
waiting room game
https://adventofpuzzles.io/2026/day/3
>>
>>110497918
Is more about having the right libraries or helper functions.
>>
There's a particular anon (I hope it's just one guy) who goes absolutely berserk once anons start talking about solvers like z3, so I'm hoping it's some sort of SAT or optimization problem, I'm low on salt.
>>
>>110497925
ok this was too easy. it's kinda bad
>>
>>110497925
Easier than yesterday.
>>
>>110497882
the question was why the puzzle count (920) was lower than expected (1500). the answer was why the numbers differ
>>
>>110497881
something solvable with a single regex
>>
>>110497925
Anyone know any other seasonal programming/computer events? QEMU did something a few years ago. Some university did like an advent of syscalls. Those were fun.
>>
>>110497930
>I hope today is too hard for me so I can just import solution and filter myself
>>
>>110497980
I know of a couple
https://tryhackme.com/adventofcyber26
https://sadservers.com/advent
>>
>>110497980
everybody.codes, systemscheck.dev, autumncodewalk.github.io, mng.quest, codyssi.com, eldarverse.com, flipflop.slome.org, i18n-puzzles.com, protohackers.com
>>
>>110498011
nice list
what's your fav?
>>
>>110498011
yeah these all suck
>>
>>110498015
everybody.codes
>>
>>110498018
that one sucks the most
>>
File: thewallcometh.jpg (104 KB, 675x1000)
104 KB JPG
TONIGHT'S THE NIGHT
>>
>>110498024
tonight we will be a quarter through the event and the problems will still take under ten minutes
>>
today is a grid problem
>>
5 MINUTES, GET READY
>>
every problem is a grid problem if you think about it
>>
Uh Eric isn't Cellular Automata kind of advanced for Day 3
>>
File: 1714859899846708.jpg (175 KB, 735x639)
175 KB JPG
>>110495407
>import *
>>
advent of math
>>
>>110498043
I would love a cellular automata puzzle.
>>
>>110498032
nah, they take me 2 hours or more
>>
File: mokou-showtime.jpg (130 KB, 440x518)
130 KB JPG
>>
I NEED TO SHIT
>>
lets go boys
>>
>no cancer music
blessed day
>>
c-cancer music?
>>
No cancer music?
>>
https://www.youtube.com/watch?v=IMF1HRiBC7Q
FUCK LATE
>>
good luck
>>
cancer music guy got filtered :(
>>
If you haven't solved it yet, you are filtered.
>>
>>110498069
I am not the usual music poster btw
>>
FUCK
>>110498035 >>110498041
called it?
>>
>linking to the wikipedia article for square
I mean ok
>>
I just do like a exponential brute force right?
>>
this is the gold math olympiad puzzle that AI solved years ago
>>
>part 2
fuck off
>>
>part 2
I just won't do it, sorry
>>
File: 1773172307864725.png (40 KB, 1203x193)
40 KB PNG
Okay that was actually a little tricky, maybe Eric hasn't lost his touch after all?
>>
File: 1781691217051262.png (2.39 MB, 1536x1024)
2.39 MB PNG
>>
Fun puzzle. Maybe Eric is based after all?
>>
This thread is going awfully slow. Is this the great filter already?
>>

with open("input","r") as f:
lines = f.read().strip().split()

m,n = len(lines),len(lines[0])

def issq(i, j, s,r=0):
return i+s < m and j+s < n and r < s and all([
lines[i][j+r] == "#",
lines[i+s-r][j] == "#",
lines[i+r][j+s] == "#",
lines[i+s][j+s-r] == "#",
])

s1 = sum(issq(i,j,s) for i in range(m) for j in range(n) for s in range(1,min(m,n)))
print(s1)

s2 = sum(
issq(i, j, s, r)
for i in range(m)
for j in range(n)
for s in range(1, min(m, n))
for r in range(s)
)
print(s2)

>>
>part2
>works on all examples
>doesn't work with real input
AIIIIEEEEEEEE-
>>
File: 1775486674027589.jpg (178 KB, 1440x1402)
178 KB JPG
>>110498298
>doesn't work on examples
>works on input
>>
File: 3.png (251 KB, 2156x1406)
251 KB PNG
idiomatic Rust solution
>>
FUCK I WAS ADDING THE WRONG VECTOR COMPONENT
>>
File: aoc03.png (124 KB, 1280x1309)
124 KB PNG
we are brooting

I wasted so much time on part 1 trying to be clever with a forall statement instead of just using a normal loop when the compiler probably would have done the same optimizations to the for loop
and there still was leaderboards I would have been upset with myself
Day   -Part 1-   -Part 2-
3 00:29:29 00:42:19
>>
tfw lost the motivation again to just do it.
There is no reward in AoC. How do you do it for all the days?
Every year I tell myself to finish it, but I never got past like day 6 or something. Maybe 10 years ago I did 10+ days
>>
>wasted 15 minutes because of incorrect range
REEEEEE
Day   -Part 1-   -Part 2-
3 00:05:49 00:28:22
>>
File: 1792534291923639.jpg (80 KB, 735x665)
80 KB JPG
>>110498336
>There is no reward in AoC. How do you do it for all the days?
shitposting about elves and trying out new strategies or languages
>>
https://pastebin.com/raw/P0J9J4EY

I'm getting 2499 for part 2 which is wrong, can someone tell me if it's high or low? clearly I'm missing some edge case
>>
I spent so long trying to force the wrong idea to work... I'm a brainlet.
>>
>>110498336
I think it's fun! .. Maybe something's wrong with me?
>>
>>110498357
mine says your 2499 is too high
>>
File: carbon.png (45 KB, 800x574)
45 KB PNG
I finally remembered to actually use complex numbers for grid rotations
>>
>>110498336
>There is no reward in AoC.
I enjoy solving puzzles.
>>
idiomatic scalable mobile-first javascript

let check = (map, x, y) => {
return x >= 0 && y >= 0 && x < map.length && y < map.length && map[y][x] == '#';
}

let solve = input => {
let map = input.split('\r\n').map(x => x.split(''));
let size = map.length;

// p1
let p1 = 0;
for (let x=0; x<size; x++) {
for (let y=0; y<size; y++) {
if (!check(map, x, y)) continue;
for (let s=1; s<size-x; s++) {
if (check(map, x+s, y) && check(map, x+s, y+s) && check(map, x, y+s)) {
p1 += 1;
}
}
}
}

// p2
let p2 = 0;
for (let x=0; x<size; x++) {
for (let y=0; y<size; y++) {
if (!check(map, x, y)) continue;
for (let s=1; s<size-x; s++) {
for (let t=0; t<size-y; t++) {
if (check(map, x+s, y+t) && check(map, x+s-t, y+t+s) && check(map, x-t, y+s)) {
p2 += 1;
}
}
}
}
}

console.log(p1, p2);
}
>>
>>110498367
nah, I guess there is something wrong with me instead.
>>110498351
Ok no problem.

I'll just force myself to do it in 3 hours. Just a quick nap and a doctor visit first. Maybe I am too hungry rn to solve it
>>
>>110498357
too high
>>
>>110498357
>>110498369
same, 2499 is too high.
>>
this was a pretty hard day 3, was it not?
>>
File: huggingface_accelerate.jpg (25 KB, 1280x670)
25 KB JPG
>>110498411
>>
>>110498373
neat
>>
File: 1765190642150700.png (36 KB, 679x565)
36 KB PNG
I really don't want to clean this mess
>>
>>110498373
bro just flip the coords and change the sign of x
>>
File: 26_D03_C#.png (115 KB, 1391x654)
115 KB PNG
>code works first try on both parts
Eric's really phoning it in this year, huh?
>>
>>110498429
This Code Is Perfect For Gorgeous Looks Sir! Push To Production Soon!
>>
if(r + d - o < 0 || c - o < 0 || c + d - (2 * o) < 0 || r + o >= rows || c + d - o < 0)
continue;

bool all_match = true;
all_match &= data[r + d - o][c - o] == '#';
all_match &= data[r + d][c + d - (2 * o)] == '#';
all_match &= data[r + o][c + d - o] == '#';

(r = row, c = column, d = delta between corners, o = offset (rotation))

can not for the life of me figure out how I'm managing to count fake squares, or double count a square...
>>
File: ocaml3.png (112 KB, 864x1344)
112 KB PNG
tests omitted, I only added smaller rotations for p2
>>
>>110498433
that is how you end up with >>110498341 >>110498316
>>
>>110498411
when it's only 12 days long you can't spend forever on the easy stuff.
>>
>>110498439
claude sir pls fix make no mistake
>>
>>110498441
highlighting omitted the first line,
let grid_of lines =
>>
>>110498411
It was hard until I realize it's just rotating a vector.
>>
>>110498411
previous years would have a trick by now, something to foil naive or lazy implementations.
the only difficulty today was in getting the p2 offsets right, otherwise it's a very straightforward grid problem that you can find in any year
>>
>>110498411
the last real AoC had a foil on the first day: https://adventofcode.com/2023/day/1
>>
>>110498501
regex cheaters put in their place
>>
took me longer than i would have expected for day 3, but that included a 30 min haruhi break on the /a/ stream
>>
File: 2026_day3.png (118 KB, 1214x1276)
118 KB PNG
Lightly washed
>>
a slightly overweight boy to test the waters
url:    https://files.catbox.moe/tkbjui.txt
size: 4M
silver: 181542
gold: 91096165
>>
>>110498572
is it 0 bytes again?
>>
>>110498593
nah
>>
>correct for all samples
>too low on real input
>overcounts by 17 on overweightboy
FUCK
>>
>>110498440
maybe you could try adding
 r + d >= rows 
inside your if statement. If your offset can be less than c+d or r+d, then add these too
 r + d - o >= rows || c + d - o >= cols || c + d - (2 * o) >= cols 
>>
>>110498629
add your own samples until you get one that's wrong
>>
>>110498572
I get 181701 and 91189980
>>
>>110498572
>almost 1m
welp
>>
File: carbon.png (335 KB, 1280x2526)
335 KB PNG
Washed ass, took a bit (ba-dum-tssch) of time on this.
>>
>>110498572
>>110498677
yeah, I even reverted my optimizations and I still get different results.
It is _literally_ **impossible** that my solution is incorrect btw.
>>
>>110498572
>>110498677
>>110498771
the bigboy is missing the final line terminator
>>
>>110498793
then it is broken, don't make bigboys if you can't follow the rules of the house
>>
Part 1
grid = open("Day 03 input.txt", "r").read().strip().split("\n")
gridsize = [len(grid[0]), len(grid)]
squares = 0
for x in range(gridsize[0]):
for y in range(gridsize[1]):
for sqsize in range(1, min(gridsize[0]-x, gridsize[1]-y), 1):
if grid[y][x] != "#": continue
if grid[y+sqsize][x] != "#": continue
if grid[y][x+sqsize] != "#": continue
if grid[y+sqsize][x+sqsize] != "#": continue
squares += 1
print squares

Slightly washed part 2
data = open("Day 03 input.txt", "r").read().strip().split("\n")
gridsize = [len(data[0]), len(data)]
grid = set()
for y, line in enumerate(data):
for x, char in enumerate(line):
if char == "#": grid.add((x,y))
squares = 0
for x in range(gridsize[0]):
for y in range(gridsize[1]):
for sqsize in range(1, max(gridsize), 1):
for rot in range(sqsize):
if not (x, y) in grid: continue
if not (x+sqsize-rot, y+rot) in grid: continue
if not (x-rot, y+sqsize-rot) in grid: continue
if not (x+sqsize-rot*2, y+sqsize) in grid: continue
squares += 1
print squares

Started late, pure broot. Lost maybe 30 minutes chasing what turned out to be an incorrect + instead of a -.
Actually an interesting one today.
>>
>>110498793
>missing the final line terminator
imagine i replied to you with a shocked soijak
>>
>>110498572
I get the same results as >>110498677
>>
>>110498822
well, yeah. it is shocking.
missing the final line terminator means retards like >>110498572 and >>110498705 don't consider the last line.
>>
File: file.png (103 KB, 713x968)
103 KB PNG
Unwashed

i liked the rotation bit but holy hell is it slow
>>
File: dumbroski.jpg (50 KB, 1280x720)
50 KB JPG
>>110498822
>>110498830
>>110498834
my fault brothers, enjoy this one
bigboy #3
url: https://files.catbox.moe/txpi26.txt
grid: 3333x3333
silver: 839913
gold: 700901761
>>
File: Day03.png (99 KB, 912x885)
99 KB PNG
Most fun one so far.
>>
File: 1661388519650264.png (436 KB, 594x508)
436 KB PNG
>>110498940
>30 minutes and still running
>>
>>110498940
that's a big guy
>>
>filtered on day 3
Grim. My vector approach doesn’t seem to be working.
>>
>>110498940
it is extremely difficult for you to stay true to the source input, is it not?
>>
Surely there's some bullshit math way to do this super fast, right? FFT or something
>>
>>110499261
like how lmao
>>
>>110499281
had you done it correctly, the stride would have been 3334 instead of 3335.
>>
>>110499297
who cares
>>
>>110499265
it is very parallel at least
>>
File: 1793163220776064.jpg (69 KB, 724x483)
69 KB JPG
>they rotated
>>
File: day3.png (49 KB, 1049x859)
49 KB PNG
Day3 Part 1 & Part 2
i feel so good knowing i survived the Wall(tm)
>>
>>110499335
>leak
nigga, that's not idiomatic
>>
File: 1768673129883578.png (1.76 MB, 1248x832)
1.76 MB PNG
>>
File: semiwashed26.03.png (37 KB, 664x1848)
37 KB PNG
Shameful naive solution is still a solution
>>
>>110498727
Takes a minute or two on the bigboy, might look into optimizing later.
>>
what the fuck? const generics can't be used in a pattern??
>>
today i learned you can’t break or continue from inside a closure. and closures can’t be recursively called
(in Rust)
>>
File: day3.cpp.png (472 KB, 2800x2428)
472 KB PNG
Half of this was me being confused by my own variable names, the other half getting distracted by Star Trek.
>>
>>110499350
nigger, I’m giving up ownership so it can be a free nigger. fucking hypocrite
>>
What the fuck did Eric mean by this?
>>
File: Day 03.webm (2.84 MB, 846x846)
2.84 MB
2.84 MB WEBM
Visualization. Excuse the quality, had a hell of a time trying to encode this under the file size limit.
>>
File: Day 03.png (1.2 MB, 2820x2820)
1.2 MB PNG
>>110499823
Higher resolution still frame.
>>
>>110499823
>>110499834
Very cool.
>>
fun day today
>>
File: carbon (1).png (1.31 MB, 1922x1084)
1.31 MB PNG
Slow day, I spent an eternity trying to optimize the second part because it wouldn't stop. Turns out enabling ghc optimizations was all it needed. Not the first time I've seen this happen either, I should make the flag a default.

Also took some inspiration from other haskell anon in how my code is strucured, perfect for gorgeous looks.
>>
>>110498940
got the right p1 but killed it after 3 hours and realizing I was running out of ram
>>
>>110499823
dope
>>
>>110499743
what series?
>>
>>110500017
TNG, S4E21 "The Drumhead" and S4E22 "Half a Life".
>>
>>110500030
based next gen enjoyer
>>
An actually good day 3. What is the world coming to?
>>
>>110500044
I haven't watched TNG in its entirety, so I'm slowly rectifying that. I've seen sporadic episodes of TOS, all of Voyager, and only a couple episodes of DS9. I hear DS9 is really really good, so I'm looking forward to spending some time next year watching that. And I saw all of Enterprise when I was younger but that was decades ago.

As for nu-trek I really like Lower Decks, it captures the setting and comedy of the franchise very well while not being meanspirited in its portrayal.
>>
My big fuckup was working out what coordinates would make up a square from two points making a line, because I am dumb.
So I went back and forth on a couple of methods and wasted a lot of time second guessing when I could have just sat down and did a simpler broot.
>>
>>110500074
I envy you. TNG and DS9 are the best.
>>
File: d03.png (110 KB, 960x1509)
110 KB PNG
I get the correct result.
I am not taking questions.
>>
I was expecting part 2 to force you to do some on/off state and return amount of trees that are within odd amount of squares
>>
>two fun puzzles in a row this early

what the FUCK happened to Eric?
>>
>>110499327
yes, i rotated my entire grid for every possible angle between 0 and 90 degrees, then ran my part 1 against every rotated grid... how could you tell?
>>
>>110500144
I started by getting every rectangle of trees, before realizing it has to be every square. I have such little faith in Eric that I was already planning out my post about how I solved Part 2 before Part 1.
Thankfully, it was an actually interesting P2.
>>
>made dx and dy absolute values
>had to calculate slope because of that

FUCK
>>
File: 1769723624446018.jpg (326 KB, 750x750)
326 KB JPG
>>110497324
finished two weeks ago at ~110h, amazing game
>>
>iterate through input once
>store location of every tree
>for every tree,
>for every tree after,
>for every tree after,
>for every tree after,
>check if these four trees make a valid square
has nobody thought of this yet?
>>
File: file.png (64 KB, 709x631)
64 KB PNG
>>
>>110500307
>calling into_iter on a range
>>
>>110500289
could work, looking at the input it's mostly empty so going over trees rather than space would definitely be faster
>>110500333
fixed, thanks tsundere-anon
>>
>>110499973
>3 hours
smolboy for slowanons
https://files.catbox.moe/6uq5vr.txt
silver 17132
gold 4471945
>>
>>110500289
you get a vertex soup to untangle, dunno about that
>>
>>110500351
Alright, I'm stopping this >>110498940
It's been 2 hours now.
>>
I baked this and the previous but will probably be away when #3 needs to be baked so somebody keep that in mind
>>
File: adv_2026_03.png (85 KB, 1211x797)
85 KB PNG
It's easy if you do a drawing first to see how to use dx / dy and their limits
>>
File: apple.png (363 KB, 4466x1353)
363 KB PNG
>>110500388
>>
>>110500383
>2 hours
I think you guys are messing with me
>>
>>110500351
35.611 seconds. My solution is storing the whole file in a character array in memory, finding a tree, looping only over cells to the right and down from it, and then looking up the other two possible locations directly in memory. (C).
>>
>>110500416
retarded?
>>
>>110500423
mine >>110499164 does the same thing, but in 2 seconds thanks to OpenMP
>>
File: 1783175353309502.jpg (280 KB, 2688x2340)
280 KB JPG
>>110500399
>>
So far this year has been really good, despite being shorter. It feels more like a condenced year than the previous year which was just a long series of ”how many buckets do you have” until you had to create a solver for underdetermined matrises.
>>
>>110500457
Why do you have 30 min user?
>>
>>110500457
Yes, all right, if I'd have used all 16 cores I'd probably also have got 2 point something seconds.
>>
File: ss.png (178 KB, 1280x1413)
178 KB PNG
Hmm. More than 10 minutes to solve big boy. And I don't think I'm doing duplicate work.

Just looping and filtering out anchors is that slow maybe?
>>
>>110500518
it's the sum of for how long each core was used
>>
I was making a visualization and I gave up
>>
>>110500645
see >>110500437
>>
>>110500289
I thought of doing a raw combinatorial search like that, but you can cut down the amount of checks significantly, if you know that ,Given two points (or tree positions), you can calculate a valid square if you know about the cross-product and its 2D-equivalent.

Knowing this you can actually
>collect all tree verts
> sort the trees on the x-axis
> for every tree point (x,y) look at all trees to the RIGHT of the sorted array ( you have to walk a bit when multiple trees have the same x-component though).
> use the perp vector to compute the square that "should" be formed.
> check if the square actually exits
>if the square exists count it and move on
The only issue is that I had to figure out a way to cache squares i've already seen, and right now that's slow. It all boils down to hashing at that point though.
>>
File: carbon(1).png (438 KB, 1280x3308)
438 KB PNG
>>110498727
I've gotten it to sub 10s by throwing threads at it and reordering a bunch, today was a good puzzle. I'm not going to try to compete with the OpenMP solutions but I consider this a great success either way.
>>
>>110500917
>the cross-product and its 2D-equivalent
Yes, but this is such a small problem that you can just write down the additions and subtractions to calculate the variables for the 3rd and 4th corner yourself. Depending on how you traverse the grid from left to right, you can even limit the search for the 2nd corner to to the right and down from the 1st corner. And for every check that fails, you can also skip calculating the other coordinates and looking up if there's a tree there.
>>
File: carbon.png (304 KB, 1920x1414)
304 KB PNG
For part 2 I just wrote the coordinates of two of the points on a piece of paper, to see what I had to add and substract to get to the other two points, and it surprisingly worked. I'm recovering my Christmas spirit.
>>
File: 1771965291627382.webm (3.83 MB, 1920x1080)
3.83 MB
3.83 MB WEBM
Had to nerf iterations per frame because it was rendering almost instantly.
>>
>>110501075
I had thought about putting the tree coordinates in a hashmap, but then I thought keeping the grid in memory and looking up the trees directly is probably faster. For both methods you need to traverse the grid once, and for both methods you need to calculate the coordinates of the 3rd and 4th corner. One method looks up the corner in a hash array, the other directly in memory.
>>
>>110501119
>I had thought about putting the tree coordinates in a hashmap, but then I thought keeping the grid in memory and looking up the trees directly is probably faster
I wrote the code for both and you're right, it's faster
I tried keeping the order of the trees in a separate array too (so I can scan only the top right for point #2 instead of the entire hashtable), but it didn't help much
>>
File: file.png (19 KB, 390x571)
19 KB PNG
>>110500917
you do not need cross or dot products for this, just knowing that to rotate (x, y) you swap them around (y, x) then negate either one (y, -x)
take an anchor tree A
look at every R in the sub matrix from A to the end, excluding the column A is in
calculate AR
rotate it 90 deg clockwise to get AL
check if there's a tree at A+AL
check if there's a tree at A+AL+AR
>>
>>110501217
it's sad how much making stuff a bigass array in memory you scan linearly can offset any algorhytmic optimization
>>
>>110501297
>picture
That was exactly my approach.
>>
File: breakdown.png (450 KB, 1859x1409)
450 KB PNG
>>110501297
>(y, -x)
That's literally just the cross product in 2D. If you have a 2d vector <x,y> this and want another vector that's perpendicular this is how its derived.
>>
File: file.png (255 KB, 657x527)
255 KB PNG
>>110501361
nu-uh, I derive it from dot equal zero
>>
>>110501361
well... ya, duh.
>>
>>110501297
How many rotations do you try per anchor and how do you deal with overcounting?
>>
File: file.png (132 KB, 983x768)
132 KB PNG
the number of tilted squares in an NxN grid is Theta(N^4), so bigboy gold seems hard in reasonable time
>>
File: code.png (726 KB, 1572x4090)
726 KB PNG
Nice day
>>
>>110498940
I can confirm those answers.
It took about 46 minutes.
>>
How do I solve gold bigboy in a reasonable time?
>>
>>110501522
Just throw more cpus at it.
>>
>>110501447
people still use bun?
>>
>>110501539
I like it because it runs ts as is.
>>
>>110501544
technically --experimental-strip-types exists for node.
>>
>>110501428
oh yeah this is 226.90ms silver, 448 seconds on gold bigboy btw

>>110501522
probably
>>110501528

i'm not sure these >>110501297 optimizations would buy you much, i'm too lazy to implement them though
>>
>>110501425
however many trees there are in M'(A), and there is no overcounting because of how M'(A) is selected
I fucked up a little in the image, so it's cut off, but it starts at A.x+1 on x so the only axis-aligned square that can happen is same y, higher x (aka same row for R)
so in the example
x.x.x
.....
x.x.x
.....
x.x.x

if anchor is top middle,it will check the top right, middle right and bottom right as R, checking center or bottom middle would overlap previous checks
>>
>>110501547
Yeah, but i am not typing that and also I am running my solution as an executable with a shebang, I don't think it would work with a flag.
>>
>>110501618
if you use GNU userland, env -S fyi.
>>
File: 46bbw2zk26g51.jpg (27 KB, 680x378)
27 KB JPG
how it feels intuiting the math/vector part instantly but fucking up basic enumeration when coding by hand
>>
File: three.png (49 KB, 907x532)
49 KB PNG
happy with today, done washing
>>
File: d3.png (502 KB, 1166x2508)
502 KB PNG
idio(ma)tic guile scheme
>>
ok fine I ended up being around to bake after all
>>
>>110501961
>>110501961
>>110501961



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.