[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / 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]


gift shop edition

>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

Previous thread: >>107400869
>>
File: 2.png (1.01 MB, 5708x3582)
1.01 MB
1.01 MB PNG
idiomatic Rust solution
>>
bigboy
https://files.catbox.moe/fnn0h2.7z
245376725123244
250966399724248
>>
>>107407382
>.7z
nice virus
>>
kys retard keep uploading 7z
>>
File: chad.jpg (181 KB, 1027x735)
181 KB
181 KB JPG
>>107407288
yes, my solution is O(n^2). no, I will not optimize it.
>>
>>107407382
the plan here is for several days to upload 7zips meanwhile other anons screech and everybody goes

>hurr durr theres no virus just the input
>then one time it's gonna be a virus
>uh-oh it wasnt virus before
>>
>>107407431
yeah, that's why I use https://extract.me/ to extract it
>>
File: aoc2025day2.png (55 KB, 1254x278)
55 KB
55 KB PNG
bruteforce regex solution in clojure

maybe I'll do smarter solution later
>>
File: REEEEEEEEEEEEEE.png (59 KB, 854x453)
59 KB
59 KB PNG
I FUCKING HAD IT
I HAD THE BIG BRAINED INSIGHT
AND I DECIDED TO ASK A LUMP OF SILICON INSTEAD OF PULLING ON THE THREAD MYSELF AND IT THREW ME OFF
FUCK YOU ALTMAN
FUCK YOU ME
>>
>>107407545
>be retard
>do retard shit
>realize you are retard
dumb retard
>>
>>107407424
>I'm proud of my bad code
>>
File: wat.jpg (23 KB, 500x500)
23 KB
23 KB JPG
>>107407545
>AI
You deserve everything and more
>>
>>107407588
>my broot solves the puzzle within milliseconds
>somehow this is bad even though the human eye can't even see more then 24 fps
>>
pretty tricky start this year
>>
oh the boy the return of Advent of Parsing
>>
>>107407545
maybe next time don't rely on autocomplete for problem solving
>>
>>107407644
>his language doesn't have str::split
>>
>>107407644
>input.split(",")
>ranges.split("-")
that was hard
>>
>>107407545
if you need AI for this problem you probably are unironically "special"
>>
my time complexity is O(n sqrt(v))
>>
>>107407644
>fscanf(in, "%llu-%llu,", &a, &b)
bruh
>>
>>107407684
that's UB
>>
>>107407679
my time complexity is O(stupid)
>>
>>107407690
how?
>>
File: day2_swift.png (448 KB, 1530x1974)
448 KB
448 KB PNG
Fell asleep too early last night. And somehow I'm still tired as fuck.
>>
>>107407636
agree. at least we can't complain about the first few days being too easy which was often the case in the previous years.
>>
File: file.png (22 KB, 1569x828)
22 KB
22 KB PNG
>>
>>107407605
By puzzle you do mean the bigboy, right?
>>
>>107407704
>[...] if the result of the conversion
cannot be represented in the object, the behavior is undefined.
>>
>>107407738
I mean this: https://adventofcode.com/2025/day/2/input
>>
>>107407745
all of the numbers fit into 64 bits tho
>>
>>107407769
>all of the numbers fiSegmentation fault (core dumped)
>>
>>107407797
works on my machine
>>
>>107407828
you wish
>>
>gdb in tui mode sometimes glitches out a line
grinch trying to steal my christmas
>>
>>107407545
I did this and then worked out that the digit n = x * ((10^(kl)-1)/(10^l-1) for a digit n of k blocks of length l.
Then it ended up overcounting 222222 since it's both 2 times 222 and 3 times 22 and had to pass a hashmap to track which n were already counted.
It's still buggy and I liked my brute force solution more.
>>
>>107407382

Processing input file bigboy.txt
* output: 245376725123244
* runtime: 578ms

Processing input file bigboy.txt
* output: 250966399724248
* runtime: 938ms

Might still be room for improvement, but this is good enough for me.
>>
File: trash_it.jpg (71 KB, 1100x619)
71 KB
71 KB JPG
>>107407756
>>
>>107407648
>>107407673
Calm down retards, I already had a 40ms broot
>>
File: 2.png (184 KB, 1080x1463)
184 KB
184 KB PNG
>>107407424
same
I have no shame
>>
File: 2 stars.png (475 KB, 4240x4505)
475 KB
475 KB PNG
>>107407879
>>
>>107407734
what is mu
>>
>>107407734
is this the chink remainder theorem?
>>
>>107407545
>Relinquished his own intellect and divine spark for a wrong answer
Sad and tragic
>>
File: WOOOOW.png (4 KB, 432x21)
4 KB
4 KB PNG
>>107407907
Oh wow! Look at this guy! He managed to get two stars on Day 2! Two whole stars! And it only took him over half a day to do it! Fucking ace, man! You're a genius prorammer!
>>
>>107407919
dunno i didnt make it
>>107407933
morbius function
>>
File: img-2025-12-02-17-48-22.png (502 KB, 5072x2136)
502 KB
502 KB PNG
>>107407945
?
>>
>>107407945
>so excited he can't even spell
you need to go outside
>>
>>107407933
I have never learnt or used the Chinky chong theorem, nor will I ever use it. I have 504 stars and 138 ducks.
>>
File: morbius.png (1.36 MB, 1920x1080)
1.36 MB
1.36 MB PNG
>>107407947
>>
File: WOOOOOOW.png (11 KB, 281x321)
11 KB
11 KB PNG
>>107407961
WOOOOOOOOOOOOOW I'M SOOO IMPRESSED!!!
>>
>>107407997
>tries to belittle me about my stars
>doesn't have more stars than me
dumb retard
>>
File: CropThis.png (61 KB, 756x884)
61 KB
61 KB PNG
>>107408006
I'm belittling you for believing that solving the input on Day 2 means anything, or taking every star for that matter. Have fun being a shit developer.
>>107408014
pic related
>>
>>107407644
>select ,
>change all occurrences
>),(
>select -
>change all occurrences
>,
>add [( )]
>>
File: crying wojak.jpg (55 KB, 604x519)
55 KB
55 KB JPG
guys
i can't
i'm an elite programmer, i even fizzbuzzed in C99
but this is too much
i give up
>>
>>107407382
Bigboy, single threaded.
Just swapping to a multi threaded Rayon iterator gives 112 ms.
>>
>>107408038
I think you need to calm down, it's just a a children's coding game after all.
>>
>>107408072
see >>107404288
>>
>>107408072
>multi threaded Rayon iterator
what is that? dollar store omp?
>>
Damn I completely forgot about this
Should I use the opportunity to learn a new language? Got a lot of downtime at work for it, though I'd need to use some website for coding
>>
>>107408110
nah. or do it on your own and don't post here, /g/ is so dead the same tranny has to pretend to be four different people to keep an AoC general going
>>
>>107408110
The challenges themselves aren't unreasonable. I dropped a year once because trying to figure out both the solution and a new language at the same time was too much
>>
no excel chad this year?
>>
>>107408142
see >>107379400 #13
>13. quirky solutions (e.g. excel)
>>
>>107407945
it was literally unironically less than half a day thoughbeit by the time you posted this
>>
>>107408162
can you rewrite this in r̵u̵s̵t̵ english?
>>
>>107408181
no i'm not trans
>>
>>107408142
There was an excel solution for day 1
>>
>>107408102
You need quite a bit of overlap between the ranges before the precomputing ends up being beneficial right?
How does this do on the regular AOC input?
>>
>>107408079
>He can't handle large inputs in a childrens coding game
I'm laughing
>>
>>107408234
4ms

>>107408254
who are you quoting?
>>
File: file.png (94 KB, 1200x1200)
94 KB
94 KB PNG
Had to lean on an easter egg in the problem page for this one, but it works I think.
>>
File: file.png (102 KB, 1200x1200)
102 KB
102 KB PNG
>>
>be AI
>anon tells you his idea
>confidently assure him it's a dead end
>post solution yourself and rake in (You)s

D E V I L I S H
E
V
I
L
I
S
H
>>
File: 1739965062481860.jpg (174 KB, 1024x1024)
174 KB
174 KB JPG
>>107408306
>>
>>107408317
would
>>
>>107408281
>>107407907
>>
>>107408396
I think you might be confused. Maybe take a nap?
>>
File: 1758098081004451.jpg (146 KB, 1024x1024)
146 KB
146 KB JPG
>>107408317
>>107408384
>>
File: carbon(1).png (450 KB, 960x3694)
450 KB
450 KB PNG
>30min to complete part2
My tard level is simply unattainable
>>
>>107408427
I have no idea if you are the same anon or not. But that anon came in and bragged about his O(n^2) solution being good enough to solve the puzzle. So I asked if he by puzzle meant the bigboy, and he didn't because his solution is most likely too shitty to run it. Hence him bragging about getting two stars, as if stars matter.
Anyone who "gets filtered" by even a single day of AoC is a no-coder, and bragging that you're not a no-coder isn't exactly setting a high bar.
>>
File: day 2_2.png (40 KB, 873x507)
40 KB
40 KB PNG
another one
>>
File: day 2_3.png (29 KB, 1331x120)
29 KB
29 KB PNG
>>107408464
and another
>>
>>107408460
tl;dr
see >>107407907
I have both stars and can brute force the big boy in ~2100s
>>
>>107407644
Just pre-treat it? Even vscode regex find and replace should get it formatted correctly.
>>
>>107407373
>unwrap().unwrap()
Never work at cloudflare.
>>
>>107408606
should I do .ub().ub() instead?
>>
>>107408616
unwrapping and segfaulting and panicking and excepting and throwing and trying and unwinding are all the same thing to the end user.
>>
>>107408642
rust doesn't segfault though. try again cnile.
>>
i implemented KMP for p2
>>
>>107408655
...unless you want to do anything useful and have to use unsafe
>>
>>107408678
ah yes, my solution contains do_something_useful() which need to be wrapped in unsafe
>>
>>107407373
More like idiotmatic.
What the fuck is this shit code? Write more elegant code man.
>>
>>107407644
I/O is the only hard part of real-world programming anyway.
>>
>>107407899
Holy FUCK based awk user.
I considered it for this year, it's being very useful for me in data parsing in environments where I can't just upload a proper program and need to paste shit into the shell. Really underrated nice fucking programming language.
>>
File: 1755500274131724.png (88 KB, 641x716)
88 KB
88 KB PNG
My shitshow of a clojure solution
>>
>>107407745
Okay but nobody here is writing a hardened parser for untrusted input. 90% of solution code here will throw an Exception or panic when a "-" is not present, or a value is out of range.
>>
>>107408306
>>107408317
love you, drawnon
>>
>>107408110
Learning a new language through this is a major pain. I've learned C++ and Go through this and neither was a really fun experience.
>>
>>107408686
Aren't you a janny on /lgbt/?
>>
>>107407431
What do people mean when they say a 7z file is a virus? Is it supposed to be an executable disguised as a 7z file, a valid 7z file that exploits some vulnerability in the 7zip program, or a zip bomb?
>>
>>107407382
Nice one. Got both parts in 50ms.
>>
>>107408938
>, a valid 7z file that exploits some vulnerability in the 7zip program,
most probably this
never happened in the wild though
>>
solution has been delivered for u,,, sirs

#define _GNU_SOURCE

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <string.h>

uint64_t sum = 0;

int check_halves(char *str, size_t len) {
char buf[256]={0};
strncpy(buf, str, len/2);
strncpy(buf+len/2, str, len/2);

if (!strcmp(buf, str)) {
printf("%s is valid halfie\n", str);
return 0;
}

//printf("buf: %s, str: %s, len=%lu\n", buf, str, len);
return 1;
}

uint64_t is_invalid(uint64_t num) {
char buf[256];
sprintf(buf, "%" SCNu64, num);
size_t length = strlen(buf);
if (length % 2 != 0)
return 0; // must have even amount of numbers to be invalid

if (!check_halves(buf, length)) {
printf("%" SCNu64 " is invalid...\n", num);
return num;
}

return 0;

}

int main(void) {

ssize_t r;
size_t len = 0;
char *line = NULL;
FILE *f = fopen("input_fixed.txt", "r");

while ((r = getline(&line, &len, f)) != -1) {
uint64_t start = 0;
uint64_t end = 0;
sscanf(line, "%" SCNu64 "-%" SCNu64, &start, &end);
printf("start=%" PRIu64 ", end=%" PRIu64 "\n", start, end);
for(uint64_t i=start; i<=end; i++) {
sum += is_invalid(i);
}
}

printf("%" SCNu64 "\n", sum);
fclose(f);
return 0;
}
>>
>>107407588
Concept wise this one was very easy, implementing the second part was a bit harder. I tried brute forcing it this time and ended up with 3 nested for loops and a goto, and I ended up wasting time due to not finding bugs in my shitty code. I think I will opt for a more balanced approach tomorrow.
>>
let digits = n.ilog10() + 1;
if digits < 2 {
return (p1, p2);
}
let mid = digits / 2;
if let Some(pos) = (1..mid + 1)
.rev()
.filter(|&sub| digits.is_multiple_of(sub))
.find(|&sublen| {
let pow = 10u64.pow(sublen);
let sub = n % pow;
let reconstructed = (1..digits / sublen).fold(sub, |acc, _| acc * pow + sub);
n == reconstructed
})
{
let is_even = digits.is_multiple_of(2);
(p1 + if pos == mid && is_even { n } else { 0 }, p2 + n)
} else {
(p1, p2)
}


pessimised a bit to make the code smaller.
>>
The strstr method is faster than the regexec method for problem 1.
>>
>>107408938
There was briefly a buffer overflow in 7-zip, in a new compression method that hardly anybody used. It was discovered and patched before anybody even made an exploit chain.
Since then, shit-stirrers have been screeching that 7-zip and anything 7z related is guaranteed malware. The same shit happens basically any popular program has a vuln discovered, morons latch on to it and post about it for years no matter how small the impact was.
>>
does it take 2 seconds to run? yes. did I write it in a hurry in the morning before work? also yes. does it work? surprisingly.
>>
>>107409089
added to my idiomatic c calendar sir
>>
>>107409230
To be fair, 7zip is janky dogshit much like xz. For a single file that's text, Zstandard, lzip, gzip or any other compressor would be more sane.
>>
>>107408938
The 7z decompressors have had many vulnerabilities.

https://app.opencve.io/cve/?vendor=7-zip
>>
>>107409256
7-zip can be set to use LZMA instead of LZMA2, then the resulting file is essentially just an lzip with more wasted space in the header.
>>
File: aoc02.png (269 KB, 1280x2635)
269 KB
269 KB PNG
what a stinker of a day omg
>>
>>107409256
>Zstandard
not natively supported on any platform
>lzip, gzip
shaky w11 support
>or any other compressor
name one
>>
>>107409367
bzip2
>>
>>107409380
same as lzip and gzip, windows explorer doesn't even show the list of contents until the entire archive is uncompressed
>>
>>107409366
What language is this?
>>
>>107409426
modern fortran (so not f77)
>>
>>107409412
>>107409367
you're literally wrong.
I even fired up my VM just to prove you wrong.
why do you lie? 7zip is still shit btw.
>>
>>107409447
doesn't work on my machine+only one tranny complains so no point
>>
>>107409459
>doesn't work on my machine
and yet it literally does unless you're a LTSC tranny.
>>
what the ass. this is kind of hard for day 2. what the fuck happened to the week of soft ball questions? I don't want to get elf fucked right out of the gate. buy me a drink first why don't ya?
>>
>>107409466
7z works everywhere and for everyone
thus 7z it is
over and out
>>
>>107408844
throwing an Exception or panic is hardened though.
>>
>>107409483
I thought the part 2 was easier than day 1 part 2. I did try to do it with clever mathematics instead of simulating at first without being good at algorithms
>>
>>107409500
nice virus
>>
>>107409483
Half the days, twice the speed the difficulty ramps up. Felt in line with a day 4 question to me.
>>
>>107409483
m8, today was trivial
>>
>>107409483
we're getting BFS tomorrow
>>
>>107407288
>https://adventofcode.com/
holy fuck could you design a worse looking website?
and why is the problem written in such a gay prose style?
and why do i need to fucking logindoxx myself to play?
yes i'm mad, i thought this was like leetcode-for-christmas, instead i get faggotslop

AND WHAT THE NIGGER FUCK IS THIS
>https://adventofcode.com/2025/day/2/input
DIFFER BY USER?
GIVE ME THE PROBLEM CUNT

IS THIS NIGGERFIRE LITERALLY SOMETHING YOU HAVE TO FUCKING IDENTITY TO DO?

YES I'M FUCKING MAD
>>
>>107409621
tldr
>>
File: aoc_day2.png (842 KB, 810x488)
842 KB
842 KB PNG
Was there a faster/linear way to solve than just checking chunk sizes? I have to go back and read what you guys did.
>>
>>107409621
You are also gay and retarded.
>>
WHERE THE NIGGERFUCK ARE THE ROTATIONS I'M NOT LOGGING INTO YOUR KIKEWARE
>>
>>107409621
why are zoomies so angry? is it the synthetic estrogen?
>>
>>107409508
Against fucking what, though? The same kind of hardening that brought down cloudflare?
The fscanf will in practice just give you a bogus value, within the range of the type you chose, which is the same range representable by any """safe""" conversion. It's perfectly GIGO.
>>
>>107409664
Yeah, but I don't want too implement it.
>>
>>107409696
>The fscanf will in practice just give you a bogus value
lol
>>
>>107409483
regex
>>
>>107409692
>just (((login))) goy
>>
>doesn't even let you use a throwaway email for the login
holy giga glownigger
>>
>>107408306
>>107408317
yay draw anon! yokoso!
>>
File: 1749810362545169.gif (1.4 MB, 200x150)
1.4 MB
1.4 MB GIF
>>107409707
>I wrote bogus so I got bogus
>this is somehow the compiler's fault
>>
File: cnile.png (125 KB, 750x1000)
125 KB
125 KB PNG
>>107409755
>the standard says I get bogus
>this is somehow my fault
>>
>only doxxable oauths
>>
>>107409621
>>107409742
>>107409775
stop sperging out
>>
File: 1737951576453281.jpg (16 KB, 258x195)
16 KB
16 KB JPG
>>107409786
tell me why this le epic hacker thing requires such fucking goyware practices and people just go along with it? this is COMPLETELY anathema to /g/
until this man is not on the sticky i will NOT refrain from sperging out about this
>>
File: 1749260549958564.jpg (96 KB, 600x450)
96 KB
96 KB JPG
>>107409767
>the standard says I may get bogus if I write bogus
>write bogus
>proceed to not check for bogus
>wonder why I'm getting bogus
>post basedjak in frustration
>>
File: cnility.png (283 KB, 1280x554)
283 KB
283 KB PNG
>>107409807
>C standard says I get bogus if I write bogus
>Rust standard says I get a panic if I write bogus
>>
>>107409797
you know how you can't leave your bike outside if there are niggers around? see, the internet is very similar and that is why everything remotely interesting requires login.
>>
>>107409797
How would you keep track of the scores of the people playing? Bear in mind it needs to be a method most people would find frictionless and low effort on the developer's end to reduce the risk of vulnerabilities.
>>
File: 1749091182776577.jpg (61 KB, 750x808)
61 KB
61 KB JPG
>>107409827
>still not checking for bogus and doing anything with it that isn't bogus
>"SAARS WHY THE FUCK IS MY SAAAS B2B CLOUD CORPOSLOP SERVER BREAKING"
>>
>>107409807
>proceed to not check for bogus
how do you "check" for this with fscanf?
>>
>>107409621
>holy fuck could you design a worse looking website?
Why do zoomers hate fast websites and snappy programs so much? When they don't get to wait for 12MiB of React dependencies to download before the website content, or for some shitty 500ms animation to finish after every button press in a desktop app, they get angry to the point of foaming at the mouth.
>>
File: cnility2.png (49 KB, 600x355)
49 KB
49 KB PNG
>>107409869
>still not checking for bogus
you see, Rust does the checking for me
>>
>>107409852
>>107409862
>b-but, y-you NEED an id
let me use a throwaway email then not a corporate globohomo doxxaccount

>>107409890
it's not the speed it's the shitty low contrast retard
>>
File: maxresdefault.jpg (95 KB, 1920x1080)
95 KB
95 KB JPG
I fukken hate number theory
>>
of course this is just some cunt trying to turn a profit on this no wonder he's making everyone submit their data so he can datamine it and profit
>>
>>107408038
i bet you'll only get 24 stars this year
>>
>>107409862
>How would you keep track of the scores of the people playing?
Let people play anonymously who forgo the meme scorekeeping functionality? How hard is that?
What are you worried about, someone DoSing you by requesting a lot of inputs? Put it behind a bunch of PoW or captcha or whatever.
>>
>>107409887
The amount of conversions performed is returned. scanf is not ideal for other reasons though. What I'm getting at is that if you care about hardening, you will bounds check your value, regardless of how you parse it. If your program works with any value within the type's range, it's literally not a security concern if you read a random value and do something with that. Of course, you want to warn a user that the input was invalid, but crashing and burning the entire thing with a panic isn't the way to do that either.
>>
>>107409969
>if you care about hardening, you will bounds check your value
you can't bounds check a UB, dumb retard
>>
Let me guess, this nigger doesn't release the code he used to generate/validate things.
>>
>>107409937
you know how attaching an expensive heavy duty bike lock doesn't deter the nigger? well, the internet is similar. allowing for cheap dirty throwaway mails just invites trouble.
>>
>>107409621
zoomer crashout
can't you make a reddit account without an email?
>>
>>107409990
no it doesn't
countless sites do it
this krautnigger just wants to mine your data and sell it
did you fall for it? lmao

>>107409997
kek good goy you gave away your data
>>
>>107410000
what data? a reddit account name with no posts?
>>
https://cottonbureau.com/people/advent-of-code
>not just begging for sponsors and donations but a shop too
what a fucking kike

>>107410009
can you even make reddit accounts without a phone number at this point?
>>
>>107409975
In this case you can, this is "undefined" because the memory won't be initialized by fscanf if the pattern can't be matched. This is not something the compiler can mangle because it's not known until runtime. What makes it "undefined" is that different values will be read depending on hardware specifics, and no implementation will define how that works.
>>
>>107410000
this nigger wasted quads on the shittiest of posts. checked
>>
>just submit to the botnet bro it's fine that account doesnt have any posts
>>
>money grubbing shop-and-sponsor (((login))) required kike is too lazy to even do 25 puzzles this year
>/g/oys defend him
just nuke this board
>>
>>107410022
You used to be able to make one without an email even, but it looks like they require an email now. Just use an alias service (like simplelogin) to make a new reddit account and you're done
>>
>>107410032
>In this case you can
no, dumb retard. undefined behavior != random value
>>
What is the fucking point of different inputs by user? Just make one global one
>>
>>107410059
>simplelogin
>a (((proton))) service
>>
>>107410064
Yes, it's not random. If you know anything about architectures and compilers you will be able to guess it, even!
>>
>>107410086
>Yes, it's not random
exactly, it's undefined
>>
>>107410098
Glad we came to an agreement that there is a value.
>>
>>107410106
yes, there is an undefined value
>>
File: d-c++1.png (402 KB, 1470x2692)
402 KB
402 KB PNG
>>107408433
in d this is just...
your solution's much faster than mine though, and I appreciated the subtle signs of it needing a wash, like accumulating an unsigned number to return a signed number. A condition that d also doesn't point out in any way
>>
>>107410109
which you can bounds check
>>
>>107410116
you can try, but it won't work because it's undefined behavior
>>
>>107410120
didn't we just agree that there is a value? as far as I'm aware "undefined" is not a value that a double or int can represent.
>>
File: day 2 part 1.png (136 KB, 1572x1017)
136 KB
136 KB PNG
Prolog part 1
It was too much of a pain to do the parsing.
include(predicate, Input, Output) does list filtering
>>
>>107410145
dumb retard
>undefined behavior
>behavior, upon use of a nonportable or erroneous program construct or of erroneous data, for which this document imposes no requirements
>>
>>107409797
>fun christmas puzzles
>le epic hacker thing
we get it, you got filtered on day 1, you can just fuck off instead of shitting up the thread now
>>
>he got tricked into giving away his data
dumb goy
>>
>>107409959
How would you then verify they've done all the previous challenges to unlock the last one?
>>
>>107410159
uhuh, it imposes no requirements on the value that is read.
look, I get that you love jerking off the standard's fantasy, but you clearly have no idea of how *runtime* UB plays out in literally any real C implementation. The compiler literally *can't* change the meaning of your program here, and the memory read on an allocated+readable portion of memory will still be there.
getting tired of the bait.
>>
File: cnility.png (54 KB, 1200x742)
54 KB
54 KB PNG
>>107410194
>cnile thinks his interpretation of the C standard trumps the interpretation of the compiler programmers
>>
um sars did anyone else notice that part 2 is literally just an easy jeetcode problem???

https://leetcode.com/problems/repeated-substring-pattern/

https://algo.monster/liteproblems/459
>>
>>107410217
>reddit spacing
>>
>>107410194
but anon, you are living in a fantasy actually, where the compiler writers haven't yet gone completely insane. In reality your code will be miscompiled deliberately.
>>
>>107410114
Nice
>your solution's much faster than mine
How?, lt has the same logic?
>>
File: 1733204931968420.png (192 KB, 1012x1424)
192 KB
192 KB PNG
>>107410217
Time to pay up for those Copyright fees, Eric.
>>
>>107410239
I mean mine >>107403132 which has different logic
>>
>>107410217
>Given a string s
but the aoc problem is about numbers?????
it's entirely different.
>>
>>107410192
You don't? Just let people see any challenge they want, if they want to do them in order they can. The only thing which should be "gatekept" is the problems come out day by day because that matches an advent calendar.
You're acting like this is something people do for profit or their own personal gain. The only person who profits from this is the kike who runs it

>>107410245
Holy fuck he's even more a subhuman kike than i expected
>>
>>107410152
holy based
>>
>>107409980
why would you need that?
>>
>>107410285
Why would he not? Unless he's a sniveling little kike jew trying to profit off it?
>>
>(((Wastl)))
>Only on Troonsky, not Twitter
hmmm
>>
>>107409980
it is perl so nobody would be able to read it anyways
>>
>>107410067
prior to this year, there was a global leaderboard for fastest times, just being able to post "12345" and have every body copy that answer and immediately solve. the plebbit solutions thread wasn't opened until after that leaderboard filled, plus at least there's the friction of having to run the code rather than copy paste a number

it's not even truly individualized, at least not for the harder problems, just a set of inputs and you randomly get one, like in university when they hand out different versions of the same test.

why do you care? is this some gay "muh privacy" shit? because if you're somehow worried about individual aoc puzzle solutions being used to identify, i guarantee you you're exposing yourself in a million other ways constantly that will actually be exploited by companies unlike this shit
>>
File: 1744613307312089.jpg (22 KB, 552x186)
22 KB
22 KB JPG
>only half the puzzles this year goy, but don't worry, i'm hard at work at what really matters
>>
>>107410305
having a xitter account is a fireable offense in 2025
>>
>eu goes to bed
>na shits up the thread
>>
File: 1753638186916133.png (211 KB, 359x255)
211 KB
211 KB PNG
>>107410213
show me literally any existing program+compiler combination where invoking fscanf on invalid input, while passing valid read/writable pointers to it, will not let you read a value from the pointer memory you allocated.

>>107410230
this is UB that only triggers on runtime, I know compiler writers go insane lengths, but this is literally not something that can happen. fscanf is not specified as noreturn, so execution will continue, just the result will be undefined.
>>
>>107403132
Holy shit that regex monster. Coool
>>
I suspect I saw one of the people in my friend group editing an ai instruction file on discord. What is the point of advent of code if you are going to let an ai do it. (also he is taking longer than me)
>>
>>107410316
careful, he's lurking here and collecting image metadata from screenshots to ip block you and sue for harassment
>>
>>107410312
he's a shady kike and he's harvesting login information to sell most likely
>>
>skitzo crashout hours on /g/
comfy
>>
>>107410324
m8, try reading the c standard. I'm not even a cnile and I've read it.
you are seriously beclowning yourself right now.
>>
>>107410344
what does that have to do with "individual" inputs though
>>
File: 1754429269125506.png (352 KB, 800x922)
352 KB
352 KB PNG
>my solution is O(n^n)
>>
>>107410357
still waiting for anyone to show me an implementation where this happens.
>>
>>107410380
https://gcc.gnu.org/
https://clang.llvm.org/
>>
>>107410365
idk what mine is
but it involves reshaping the string into many rectangular matrices and creating a new matrix by circularly rolling it off the bottom edge and seeing if the original + the rolled copy are identical
>>
>>107410392
nice, now show me the code and results.
>>
File: 1739972765616862.jpg (42 KB, 336x336)
42 KB
42 KB JPG
>Community Managers: Danielle Lucek and Aneurysm9
Why does a fun yearly puzzle competition need (((community managers)))?
>>
>>107409959
Come to think of it, this would offer an interesting way to cheat. As the numerical solutions give you a hint if you're too low or high, you could bypass the timer and binary search for the solution within a handful of seconds using a bunch of proxies.
>>
>Can I copy/redistribute part of Advent of Code? Please don't. Advent of Code is free to use, not free to copy. If you're posting a code repository somewhere, please don't include parts of Advent of Code like the puzzle text or your inputs.
>Advent of Code is a registered trademark in the United States. The design elements, language, styles, and concept of Advent of Code are all the sole property of Advent of Code and may not be replicated or used by any other person or entity without express written consent of Advent of Code. Copyright 2015-2025 Advent of Code. All rights reserved.

What did Eric (((Wastl))) mean by this?
>>
>>107410428
If that was the reason for requiring doxxlogins, why wouldn't he simply say that? As it currently stands he provides no justification for it (and other posters have confirmed it's a change from prior years)
>>
>>107410324
don't bother, he's probably the same retard making the "you don't actually understand O notation" threads
he threw the UB nonsense at me too
>>107407684
>>107407690
>>
>EU goes to sleep
>NA starts shitting up the thread

did someone turn on his bots? are you doing this to present as your year 3 thesis in some no name college from a small town in the north?
>>
>>107410194
>the memory read on an allocated+readable portion of memory will still be there.
Wrong. If the memory location was not initialized with a value, the operating system is not required to allocate an actual memory page to that adres. While your reads on that adres will produce a value, it is NOT guaranteed to be the same value when repeatedly reading the same location. (In the meantime, some other operation may have caused a page allocation, which changes the result of your read).
Therefore, it is possible to first get passed a bound check on that adres, and then after that read a totally different, out of bounds value.
(different anon btw)
>>
I'm noticing a lot of privacy hostile "anons" in this thread lads
>>
>>107410267
this nigga never heard of typecasting lmaoooooo
>>
File: 1743380667177483.jpg (51 KB, 460x460)
51 KB
51 KB JPG
>his github profile picture (directly linked from his own website)
cannot make this shit up
>>
File: AoC-login.png (24 KB, 777x256)
24 KB
24 KB PNG
>>107410451
>(and other posters have confirmed it's a change from prior years)
They're lying to you.
>>
File: erica.png (19 KB, 800x800)
19 KB
19 KB PNG
>>107410477
what a qt
>>
>>107410480
>didn't require login before
>wtf why doesn't the login page show the non-login options
>>
>>107410488
top kek
>>
>>107410059
>but it looks like they require an email now
Last I checked you can just leave the email field empty when it asks.
>>
>EU goes to sleep
>NA starts shitting up the thread
why does this always happen? why does NA shit up 4chan harder than indians shit up streets and beaches?
>>
>>107410498
you can't, email isn't an option, only oauth
>>
File: AoC-login2.png (32 KB, 703x241)
32 KB
32 KB PNG
>>107410491
>>
File: 1738030315008035.png (513 KB, 810x456)
513 KB
513 KB PNG
>EU goes to sleep
>NA starts shitting up the thread
>AU saves the day
>>
>>107410464
just one
he does it for free
>>
Schizo or raid?
Either way clearly not a /g/ native.
>>
File: london?.png (182 KB, 390x610)
182 KB
182 KB PNG
>>107410521
london?
>>
File: 1749250265491328.png (95 KB, 846x828)
95 KB
95 KB PNG
>>107410498
I only see phone number, google, or email. I remember the form you're thinking of but haven't figured out how to get there.
>>
>>107407424
Anon, at the very least it make it O(n), the optimal is O(√n).
>>
>>107410582
try old.reddit
>>
>>107407899
Imagine using a dicktionary instead the based Möbius function.
>>
>>107410428
Iirc it doesn't tell you if you're too close to your true value.
>>
>>107410458
In a sea of shit your reply made me smile, this has been a bug is quite serious programs before https://youtu.be/kPR8h4-qZdk?t=1152
I guess you're right and I overlooked this one, though it's worth mentioning that reads are often cached, and you can initialize the variable before calling sscanf, to guarantee you can bounds check this UB.
>>
part 2 solution provided kindly for u ,,, sirs ,,

#define _GNU_SOURCE

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <string.h>

uint64_t sum = 0;

int check_combinations(char *str, size_t len) {

int repeater;
for(int i=1; i<=len/2; i++){
if (len % i == 0){
repeater=1;
for(int j=i; j<len; j++) {
if (repeater && str[j] != str[j % i])
repeater =0;
}

if (repeater) return 0;
}
}
return 1;
}


uint64_t is_invalid(uint64_t num) {
char buf[256];
sprintf(buf, "%" SCNu64, num);
size_t length = strlen(buf);


if (!check_combinations(buf,length)){
return num;
}

return 0;

}

int main(void) {

ssize_t r;
size_t len = 0;
char *line = NULL;
FILE *f = fopen("input_fixed.txt", "r");

while ((r = getline(&line, &len, f)) != -1) {
uint64_t start = 0;
uint64_t end = 0;
sscanf(line, "%" SCNu64 "-%" SCNu64, &start, &end);
printf("start=%" PRIu64 ", end=%" PRIu64 "\n", start, end);
for(uint64_t i=start; i<=end; i++) {
sum += is_invalid(i);
}
}

printf("%" SCNu64 "\n", sum);
fclose(f);
return 0;
}
>>
>>107410268
>Just don't have any vision, let me do it however I want and if there are any issues I WILL FUCKING BITCH AT YOU!!!!
This is why you aren't successful
>>
>>107410622
You can't sign up on old.reddit anymore.
The link just redirect to new reddit.
>>
so you're saying you've been oauth doxxing yourself for years to this slimy money grubber?
>>
>>107409664
repeating number sequences of length 2,4,6,etc are all divisible by 11, 101, 1001, ....
for each range count how many multiples are in range (gotta be careful only to take only those multiples that actually are repeating sequences in range).
similarly for part 2. you want divisible by 1111..., 1010...., 100100... for repeating seqs of length 1,2,3,etc. basically the same check as for part one but trying multiple divisors (all up to length of the number / 2).
>>
>better website
>less mentally retarded posters
>opportunity to do something for our poor unfortunate brothas in Africa
Yeah I'm thinking Everybody Codes won.
>>
>>107411134
>Jane Street
I'll pass.
>>
File: 1743248233073691.png (593 KB, 925x557)
593 KB
593 KB PNG
>>107407382
Optimized my nim solution for this

$ ./d02 d02_bigboy.txt
245376725123244
250966399724248
./d02 d02_bigboy.txt 3850,64s user 0,19s system 99% cpu 1:04:11,55 total
>>
Anyone want to tell me by this puzzle site has two "community managers" when it literally has no forums or any way to communicate with other people?
>>
>>107411169
>Our sponsors help make Advent of Code possible:
>Jane Street - We're a research-driven trading firm where curious people work together to solve the puzzle of global markets, with offices in NYC, London, Hong Kong, and Singapore. Check out our new JS Advent of FPGA Challenge!
>>
>12 puzzles
Why is Eric so lazy? Just go to leetcode randomly take any two problems and combine them. This is a day's work at most.
>>
>>107410894
AI generated? this shit doesn't compile and it can't work because it expects one range per line maximim
>>
>>107411258
can't you see the filename says fixed? he clearly pre processed the data. which is cheating because that's 90% of the work in advent of code.
>>
File: reddit_mods.png (12 KB, 306x141)
12 KB
12 KB PNG
>>107411180
It's a fancy name for a reddit mod
>>
>>107411282
If you're using C.
>>
>>107411282
>cheating
brother I did that for an entire year. Ada's actually an enjoyable language if you preprocess the inputs because a string literal can parse as an array of enums.
>>
>>107410894
>"%" SCNu64 "-%" SCNu64,
Fucking Christ writing correct C instead of Unixtard C must be like getting a root canal.
>>
>>107407288
Eh, today's was way easier than yesterday's. Unless you're so much of a beta overthinker that you try to solve it all with math, I guess.
>>
>works on example, not in input
I am so close.
>>
>>107411356
If the language you're using doesn't have built in regex, part 2 is not totally trivial (or at least, the trivial solution is O(n^3)). Yesterday's part 2 was trivial even when optimizing it.
>>
>>107408497
>I have both stars and can brute force the big boy in ~2100s
Imagine writing this and not feeling shame
>>
>>107411395
yeah and if you don't have arms then tying your shoes is hard, but I do have arms
>>
>>107411325
>i cheated for a whole year
>>
>>107411295
Why would he feel the need to put their name on a website when it's already on reddit?
>>
>>107411228
>why is mister (((Wastl))) so lazy
He's not lazy when it comes to merch!
>>107410316
>>
>>107411395
I know fuck all about regex, I just tried splitting the string by substrings and if none of them resulted in an empty list that list was made up of repeating numbers.
>>
>>107411282
ok it compiles and works, idk what I did wrong the 1st time
>>
So did this guy trick you all by starting out the first few years doing it "out of the goodness of his heart" and then jewed everything up later and you're basically in sunk costs / rose tainted glasses / nostalgia mode and feel the need to defend him? Because anyone else coming in fresh is seeing this for the jewish profiteering it is
>>
>>107411504
I don't seem to recall spending any money.
>>
>>107411504
>he paid for AOC++
LMAOOOOOOOOOOOOOOOOOOOOOOOOO
>>
>>107411504
The event is free to participate in and there's no evidence he's Jewish.
What kind of world do you want to live in, one where no one exchanges money ever?
>>
>>107411510
>>107411559
You gave your data to him to sell
>there's no evidence he's Jewish.
check the surname.

>>107411520
I never even looked into this project until today.
>>
>>107411504
he killed the global leaderboard and cut the problems in half. He's not profiteering.
>>
>>107407545
That's what you deserve for trying to run a marathon with a car.
>>
>>107411571
>He's not profiteering.
see
>>107410316
https://adventofcode.com/2025/sponsors
https://cottonbureau.com/people/advent-of-code
>Advent of Code is a registered trademark in the United States. The design elements, language, styles, and concept of Advent of Code are all the sole property of Advent of Code and may not be replicated or used by any other person or entity without express written consent of Advent of Code. Copyright 2015-2025 Advent of Code. All rights reserved.

He's profiting in multiple ways.
>>
>>107411568
oh well in that case FUCK OFF YOU STUPID NIGGER. No one cares what you think, why do you come into a thread of people doing free coding problems and start shouting about jews wanting money
>>
>>107411559
get off 4chan eric i'm gonna tell your bluesky followers i saw you here
>>107411504
fell for the classic hustle culture psyop, had a good idea and immediately let himself get sucked into grinding it for meaningless internet clout and diminishing returns instead of accepting its time had come and letting it go out on top
>>
>>107411510
Time is money.
>>
>>107411580
yes his IP and legal fixation is very pathetic, but it's not making him money is it? Send him money and ask him for some trivial improvement to the site - he'll say "no".
>>
>>107411594
I'm not spending my time on a seasonal pasttime. I'm enjoying it.
>>
>>107411594
If it matters that much to you then why are you wasting your time posing in a thread about something you aren't interested in
>>
>>107411631
>but it's not making him money is it?
it clearly is, he is getting sponsor money, merch money and donations on top of that.
>>
Hold on, you're saying someone made something we're having fun with and he got money for doing that? The injustice of it all.
>>
>>107411688
He sold your data to god knows how many companies and you defend him
A very cucked goy
>>
Prove that Eric is selling my login data for Github (which is public anyway) and I will personally call Santa and have so much coal sent to his house it will destroy the coal industry for the next three generations of miners
>>
>>107411568
>check the surname.
>Josef Wastl (4 December 1892 – 11 October 1968) was an Austrian Anthropologist and Ethnologist who served as the Director of the Anthropological Department at the Natural History Museum in Vienna from 1942 to 1945.[
>Wastl joined the National Socialist German Workers' Party (NSDAP) in 1932 and founded an illegal cell ('Betriebszelle') for the Party in the Natural History Museum that same year.
>Wastl had a keen interest in 'racial science', described as "Vienna's foremost racial scientist".
Damn, Eric is a Nazi?
>>
>>107411702
VERY IMPORTANT DATA: ChudGuy8000 logged in from IP 1.2.3.4 and completed 3 coding puzzles.
>>
>>107411716
>>107411710
>defending jewish oauth and merchmaxxing, contentminning practices
oh my
>>
>>107411258
no sir all me. also my pre processing is just
cat input.txt | tr ',' '\n'
>>
>>107411728
I think you're concocting some insane scenario in your head where huge shadowy organizations make someone run a decade long puzzle site so they find out you like writing code and do nefarious things with the knowledge.
>>
>>107411571
>He's not profiteering.
He is sponsored by fucking banks.
>>
File: code.png (248 KB, 2048x1588)
248 KB
248 KB PNG
Python day1


I won't be able to do the whole thing for sure this year. I will try to catch up on the weekend.
>>
File: why people hate pol.png (53 KB, 1306x354)
53 KB
53 KB PNG
Oh nice, 200 new posts. Wonder what cool shit was posted
>threadshitter ranting about da joos and ((()))
Fuck off back to >>>/pol/. You will never fit in here.
>>
>>107411769
Jews and niggers are always on topic and appropriate to bring up when they are at least partly responsible for ruining said topic.
>>
can day two part two be solved in log(n)^2? I was able to do part 1 in log(n) but getting stuck with part two and that time complexity
>>
File: code.png (222 KB, 1958x1508)
222 KB
222 KB PNG
Python day2
>>
File: 1762963204611988.jpg (30 KB, 310x162)
30 KB
30 KB JPG
>>107411757
I see jewish software practices, i call them out, that's part of what /g/ is for
have i been a little heavy handed? Yes, because i expected fucking better of this board. This is a kike who is profiteering and selling your data while getting money from SEVERAL other sources (sponsors, merch, donations) and completely shutting out anyone who doesn't want to submit to the Oauth botnet
>>
>>107411799
Make fake mails
>>
File: 1763773899588162.jpg (18 KB, 275x183)
18 KB
18 KB JPG
>>107411790
This, you can't complain when you got jewed for 50% of the content this year. You're just mad because you know I'm right.
>>
>>107411810
>Mails
you can't register by email dummy, if you could i'd drop this entirely
you MUST use an oauth botnet which typically require phone numbers to acquire and involve several datamining hoops regardless.
>>
>>107411799
>completely shutting out
here you go bro: https://github.com/gchan/advent-of-code-ruby/tree/main/2025/day-02
>>
>>107411840
If they had a dedicated account creation option, you'll complain that they're collecting emails.
>>
>>107411868
Get ready to get sued
>>107410245
>>
>>107411886
no because everyone with two braincells uses a throwaway email service
>>
Reconsider whether you really want to be on the hook for $150,000 per puzzle input copied and per copy distributed.
>>
the words of the honored community manager
>>
File: day 2.png (302 KB, 1307x2563)
302 KB
302 KB PNG
slowest C solution but maybe the fastest of the regex solutions
real    0m1.593s
user 0m1.588s
sys 0m0.002s
>>
>>107411896
Don't kid yourself, you'll still claim they're "harvesting data"
>>
>>107411380
Maybe counting IDs that are only one digit long (i. e. no repetition)
>>
File: monkeypuzzle.webm (2.95 MB, 1595x922)
2.95 MB
2.95 MB WEBM
my biggest cheat was the year I binary search fiddled with the for loop ranges in godbolt and looked at the generated code which seemed to behave differently if the range contained the solution or not
>>
File: day-2.png (1.64 MB, 3608x7984)
1.64 MB
1.64 MB PNG
potentially the worst program I've ever written but at least I didn't just brute force it like most of you dipshits
>>
>>107412006
how fast does this do big boy?
>>
=== Part 1 ===
The elves are fucking retarded mongoloids and need you to add two numbers together. Your puzzle input.
1,1
=== Part 2 ===
Actually multiply it lmao!

This shit writes itself.
>>
>>107412045
the elf story + noob traps is like 70-90% of the charm
>>
>>107412098
That's easy.
Example input:
1,1
Real input:
-5,-2

>WTF MY CODE WORKS ON THE EXAMPLE BUT NOT ON THE INPUT
>advent of parsing lol
>CLASSIC eric, he's such a little rascal
>timesing two minus numbers gives a plus number? wtf is this useless math shit
>>
>>107412189
lol filtered by lanternfish and elephants
>>
>>107411395
>If the language you're using doesn't have built in regex
then you use a regex library
or you're using the wrong tool, like a retard
which one are you?
>>
>>107412201
if you are using regex for aoc why are you doing aoc
>>
File: file.png (205 KB, 2476x935)
205 KB
205 KB PNG
It's shite but it works.
>>107408433
>struct Range
I did it first faggot.
>>
>>107410802
>In a sea of shit your reply made me smile
Thanks anon.
>this has been a bug is quite serious programs before
And that made me smile: that very same talk is were I picked up on this tidbit of obscure knowledge. I would have provided the source myself but I could not remember the guys name.
>>
>>107411929
nope, it's a trillion times easier to use a throwaway email than it is to get a throwaway oauth account (which is full of trapdoors)
>>
>reading comprehension
thought part 1 was asking for what part 2 is and wasted time trying to debug that
at least i already had the answer for part 2 ready
>>
it is advent of parsing tho
>>
>>107412223
how is using 20 standard library functions or a runtime that you didn't write yourself better than using regexes?
>>
>>107407382
>>107407393
it seems we only get a txt if i myself make the bigboy
sad!
>>
>>107412349
dishonest take
parsing is basically a big part of a lot of the days
regex completely deletes it
it is like calling a dijsktra you did not write or something
>>
File: d-c++2.png (333 KB, 1374x2263)
333 KB
333 KB PNG
>>107412006
in d this is just
>>107412036
I get a wrong answer for the bigboy in only 13s!
>>
>>107411769
Jews are actually relevant to all kinds of shit because of their domineering position in media and big tech
>>
after today we will already be 1/4 done btw. Advent of code barely even starts on day 10 I can't get over this.
>>
>>107412479
i will make a day 13
>>
>>107412479
Is there an archive of leetcode or similar problems i can find somewhere? I have an idea which might help here
>>
File: nightbeforenothing.jpg (34 KB, 300x298)
34 KB
34 KB JPG
>>107412521
>mfw its december 12th
>>
>>107412006
>3600 by 8000
why do you dipshits do this, I don't want to see size 48 font
>durrr just open in new tab and zoom out!
no
>>
>>107412699
>he doesnt have his own utility scripts

lurk moar
>>
File: 020127.png (92 KB, 1600x744)
92 KB
92 KB PNG
Just came back from work
>>
>>107412709
>durr fix my shitty mistakes for me
no
>>
>>107412424
>dishonest take
you're the one dishonnest
solving an aoc problem requires parsing but it also requires string/integer conversion and memory allocation. If you had to write all this from scratch it would take as much LOCs that parsing, but somehow regex is cheating but using premade malloc, scanf, getline, etc.. is not ok. This is complete bullshit to decide that one is ok but not other.

parsing "by hand" is useless busywork, it solves nothing, proves nothing and literally no one cares that you did it "from scratch". In real life no one cares either unless there are performance requirements. I don't see why it's not ok for aoc because you arbitrarily decided it was not ok.
>>
>>107412710
i think i know you, judging by the theme and coding
>>
>>107412719
Hi :D
>>
>>107412723
>020127
>same timezone

yeah i know you
>>
damn, filtered by 1b for now
>>
>>107412741
durgesh?
>>
>>107412718
>parsing "by hand" is useless busywork
lol look at what thread you are in
>>
>>107407373
Novice programmer here.
Come on, isn't all this fucking abstraction at least a decent hit in performance?
>>
>did a sort mathy brute force for d2p2
>go to sleep
>wake up and realize the correct algorithm
>>
>>107412718
Using parsing tools such as regex for aoc is fine.
>parsing "by hand" is useless busywork
..but that is not true. A regex is sensitive to DOS attacks. For security, it is easier to reason about hand written code unless you thoroughly understand how your particular regex lib is implemented.
>>
>>107412823
>import solution
>>
>>107412823
dos attack from adventofcode.com?
>>
>>107412771
Compilation performance yes. Runtime performance is comparable to any other language optimized by an optimizing compiler which code uses the same solving algorithm.
>>
>>107412479
I made a puzzle last year when some anon said he'd run a custom AoC. Emailed it to him but never heard back so might as well do it myself.
>>
>>107412849
No I was talking in general: parsing by hand does have a use case. I said in the same post that it is fine to use it for aoc.
>>
>>107412849
users who donate get inputs guaranteed to be dos free :)
>>
>>107412823
>>107412823
>A regex is sensitive to DOS attacks.
Only when taking user input from the web and only if the particular regex is vulnerable to it. That's only a fraction of usage of regexes and it concerns only the fraction of regex users that make web shit.
>unless you thoroughly understand how your particular regex lib is implemented.
A deep understand of backtracking regex engine yes, which I have, but specific knowledge about the implementation details of your particular backtracking regex engine? Not really. Engines have differences here and there but not in the sematnics of the altnernations and quantifiers.
>>
>>107412823
>For security
overthinking mode detected!
>>
>>107410217
Eric has given up. I wonder if his corporate sponsors are mad that he half-assed it this year.
>>
>>107410217
oh no no no no
>>
>>107413012
>overthinking
I'm not overthinking shit. I use regex all the time, and stated that it is fine for aoc.
This anon said "In real life no one cares either unless there are performance requirements.", so I was responding to the general case, in real life, and there security does matter as much as performance, and often more.
>>
>>107410217
>arbitrary string

Eric added the SOVL of an O(1) number theoretic solution
>>
>>107410217
>Eric lurks the threads
>Gathers metadata from leaked inputs or screenshots
>Perma bans the IP's and fingerprints their sessions/githubs/accounts
>He straight up steals leetcode problems

uh oh
>>
>>107412823
>it is easier to reason about hand written code
and yet the people doing complicated hand-written code are producing solutions that are hard to reason about
funny how that works
>>
>>107410217
welcome to advent of code
>>
>AOC ends right before Hanukkah
Shalom eric!
>>
File: aoc2025day2letClojure.png (80 KB, 1149x370)
80 KB
80 KB PNG
>>107407447
should be easier to read for plebs now
>>
>>107413208
The Mossad sent Eric a girlfriend.
>>
>>107413211
What font is that "army war manual"?
>>
>>107412664
have faith in me anon
>>
>>107413284
https://fontesk.com/tt2020-typeface/
>>
>>107413211
looks like it was written with a type writter
>>
>>107413114
this
>>
File: 2025_day2.png (115 KB, 1932x843)
115 KB
115 KB PNG
Dying thread, might as well post my cleaned up code.
>>
>>107413258
a blonde one that's pregnant?
>>
>>107413208
jesus
>>
new thread
>>107413670
>>107413670
>>107413670
>>
>>107413114
if you're set on regex then parser combinators are way easier to read than cryptic regex.

>>107413211
hideous implicit progn ew. please go back to java.



[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.