Okay it isn't even out yet, I'm sure it will be great, and the elves are in trouble, etc. I'm just beating you all to the bunch so I can tell you to explain your answers, we care about ALGORITHMIC COMPLEXITY now. What's the fastest and most efficient way to do it.
heymoon wtf is a big o
This is O(n)
x = REALLY_BIG_NUMBER
for i in range(x):
process(i)
This is O(n^2)
x = REALLY_BIG_NUMBER
for i in range(x):
for j in range(x)
process(i,j)
There's more to it but that's the quick version. Also there are things like O(log(n)) (based), O(a^n) (cringe), and O(n!) (advanced cringe).
Okay, post ur code too but explain why its cool or no one will read it. I'll pin my favorite answers, other mods also do this
Jump in the discussion.
No email address required.
Pro tip: if you get fencepost errors, just add more fencepost errors until they cancel out
Jump in the discussion.
No email address required.
wtf is a fencepost error
Jump in the discussion.
No email address required.
off by one
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
late because I'm not paying for the psyop that is airplane wifi plans
Jump in the discussion.
No email address required.
More options
Context
Suspiciously easy today...
Jump in the discussion.
No email address required.
More options
Context
For Part 2, I used bit twiddling. The Ray was a "1" that would move across the screen by doing a shift left operation. The sprite was the number '7' (111) (technically 28 because i had two zeros of offset), and the line would be (ray OR sprite).
I don't give a singular fuck , it's a CRT display and I'm going to model it correctly damnit!
Jump in the discussion.
No email address required.
Wow, you must be a JP fan.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
I thought this was going to get like a TIS-100 problem where you keep adding more shit onto it so I tried to make my p object for part 1 at least kind of function like a processor in case he introduced an instruction pipeline or some such crap in part 2. But instead, he didn't do that and part 2 took like 5 minutes.
Jump in the discussion.
No email address required.
Are you feeling okay bud?
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Part Uno
Part Dos
Jump in the discussion.
No email address required.
elseifelseifelseifelseifelseifelseifelseifelseifelseifelseifelseifelseifelseifelseifelseifelseifelseifelseifelseifelseifelseifelseifelseif CATCH FINALLY!
t. javadev
also t. yanderedev or whatever
Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
PLEASE SARR REVIEW CODE SARR
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
A rare Java cell
Jump in the discussion.
No email address required.
More options
Context
K
Jump in the discussion.
No email address required.
More options
Context
More options
Context
parsing the string like that is bad code but its shorter than the alternatives in this case
Jump in the discussion.
No email address required.
More options
Context
rDrama is full of either Gays, Nerds and Autists (Nerds and autists heavily overlap)
Jump in the discussion.
No email address required.
that venn diagram is a circle
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Yeah, half of the entrants are just Snappy.
Jump in the discussion.
No email address required.
More options
Context
it would be impressive if anyone did this in worse than O(n)
Jump in the discussion.
No email address required.
DEATH TO YOU ADVENT OF CODE
Jump in the discussion.
No email address required.
The input's size has always been too small to care about complexity tbh. Gimme more data
Jump in the discussion.
No email address required.
yeah agreed. (right now) idc if it runs in
O(n!!)
or something absurd like that because there's like 1000 things to process rnJump in the discussion.
No email address required.
More options
Context
OUT
Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
You'd have to be like:
Or something like that I don't even want to think about it anymore
Jump in the discussion.
No email address required.
More options
Context
That would need even more brainpower because you create something more complex for sake of complexity
Jump in the discussion.
No email address required.
wow my company must be full of genius cause i have a hard time keeping up.
Jump in the discussion.
No email address required.
Then its advanced r-slurism. Where it takes sweat and effort to be this tarded.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
Felt like today was super simple. Biggest issues was with setting cycle = 0 at the start instead of 1
There is most likely a way to do it by just adding the cycles all at once, instead of actually "waiting" for every cycle, but sounds like too much effort. and you would have to loop for every cycle anyway to draw the screen, so that shouldn't change complexity at all.
Jump in the discussion.
No email address required.
That was a mistake. You're about to find out the hard way why.
Jump in the discussion.
No email address required.
even my shortest solution so far gets bullied by the bot
Jump in the discussion.
No email address required.
that's ur fault for using c++
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
Jump in the discussion.
No email address required.
I only do AOC in the morning because I like to have a good sleep schedule
Jump in the discussion.
No email address required.
I have been maintaining a consistent but weird schedule for a while now, wake up at 1PM and sleep at 5-6AM next day. Helps me have a very balanced day without annoying anyone.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
it got the extended test case perfect, so idkwtf is going on.
no, i will not fix it mangling the first letter and no, i will not discuss big o.
Jump in the discussion.
No email address required.
i quickly wrote out the revelant parts because i was bored and it seems that your sprite variable is sometimes bigger than it should be:
That seems to happen mainly if the register is negative or >= 40. Honestly quite bizarre that this bug still makes it almost work. For my input it only turns the first R into a B:
Jump in the discussion.
No email address required.
it was actually a P. i tried R and it told me to hang myself.
oh im r-slurred i didnt read your comment. but yeah, i figured long lines wouldnt matter since theyre 0 indexed, but maybe theyre getting shifted oddly by the fstring or something.
Jump in the discussion.
No email address required.
The problem is that your sprite sometimes is:
###.......................................
when it should be:#.......................................
So if it cc == 2 and it tries to access sprite[cc] it gets a
#
instead of the.
. The same issue exists on the other end, but there it doesnt matter, since it would never access that part of the sprite anyway.You should be able to fix it by doing sth like:
{"#" * (40 - max(dots_to_the_left, 0) - max(dots_to_the_right, 0)}
This also explains why the test works fine, the bug only happens in the first and second column and those are "#" by default
Jump in the discussion.
No email address required.
very smort
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
...i don't see the issue? Its bzgraza?
Jump in the discussion.
No email address required.
my (and im guessing everyones) answer was meant to be 8 letters, not 7. i spent way too long sifting through print statements trying to understand why it was mangled and gave up because the test was fine.
Jump in the discussion.
No email address required.
I had the same issue lol, it looks like someone already told you what the issue is. I was using binary to create the line, so what I did was have the initial (at 1) be
sprite = 0b11100
instead of
sprite = 0b111
and then shift it left by two bits every time I needed to use it
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
your example is false! those are O(x) and O(x²)
@drama_enthusiast look C 2D arrays! and
operator<<
Jump in the discussion.
No email address required.
what did u say withe man? May I see your n-word loicense?
Jump in the discussion.
No email address required.
got my n word license right here
Jump in the discussion.
No email address required.
More options
Context
More options
Context
I wouldn't pass streams around, I would put everything into a string and then have a separate function push it into a stream at the end.
Code looks good though ( as long as we ignore member functions definitions in a struct(!) )
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Hopefully this code is less bullyable
Jump in the discussion.
No email address required.
More options
Context
AHEM
ATTENTION ALL
I HAVE A VERY IMPORTANT MESSAGE TO CONVEY
https://pastebin.com/VpSa7hj5
Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
More options
Context
based time wasting chad
Jump in the discussion.
No email address required.
More options
Context
@aminobastard
Jump in the discussion.
No email address required.
More options
Context
Jump in the discussion.
No email address required.
More options
Context
What did u say, white boi?
Jump in the discussion.
No email address required.
More options
Context
More options
Context
raw code pretty much did remove some comments
Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
oh its the marsify award hitting "return to monkey"
Jump in the discussion.
No email address required.
yup lol
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
Mommy is soooo proud of you, sweaty. Let's put this sperg out up on the fridge with all your other failures.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
cleaned code
I lost a bit of time for part 1 as I coded the addx as lasting 3 instead of 2, and for part 2 I did the wrong list to matrix index conversion. Otherwise pretty easy, but that's probably introducing us to more VM problems
Jump in the discussion.
No email address required.
More options
Context
Codecels better be cramming their discrete math
Jump in the discussion.
No email address required.
More options
Context
Im on a flight today so im gonna lose my spot in the top 10 until i can board. Tragic
Jump in the discussion.
No email address required.
More options
Context
how the fuck am i supposed to know what the algorithmic complexity of my code is? i'm not quite autistic enough to care, so don't answer
got stuck on part 2 for a while because i forgot % 40
Jump in the discussion.
No email address required.
Jesus you're really ngmi. Are you a hobby dev?
Jump in the discussion.
No email address required.
Jump in the discussion.
No email address required.
lol, i mean ... i get paid to do this shit, and big O awareness absolutely essential to not producing absolute dogshit as code, like most my coworkers.
but i'm not neurodivergent enough to code as a hobby.
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Most performance aware pythonista
Jump in the discussion.
No email address required.
Moore's law means hardware gets better faster than I need resources. Even if I somehow max it out, I just turn around for a second, order a new part and I'm back to blissful ignorance.
Jump in the discussion.
No email address required.
this has been what has led to the current state of web development
Jump in the discussion.
No email address required.
More options
Context
banned
Jump in the discussion.
No email address required.
Ruuuuuude!
Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context
More options
Context
More options
Context
More options
Context
I wish I could read faster
Jump in the discussion.
No email address required.
More options
Context
Not posting my code because of big O shaming, 👏 get 👏 better 👏 hardware 👏 sweaty 👏.
Jump in the discussion.
No email address required.
More options
Context
Got global leaderboard #43 for both stars today In celebration, I'm not bothering to clean this up before posting it. Apparently this is what global leaderboard code looks like. Yes, I literally copy-paste Part A to Part B and there's an entirely unused
sig_strength
in the latter.Jump in the discussion.
No email address required.
what is the purpose of defining a class for your answer i dont understand
Jump in the discussion.
No email address required.
i think (and i've been doing a similar thing) what snekky's doing is using it to parse data is a standard format.
like for example mine has a
get_data()
thing that automatically downloads the input dataJump in the discussion.
No email address required.
More options
Context
More options
Context
no ai generation?
Jump in the discussion.
No email address required.
More options
Context
Jump in the discussion.
No email address required.
More options
Context
More options
Context
INTCODE 2 ELECTRIC BOOGALOO
Jump in the discussion.
No email address required.
intcode is DEPRECATED
we use stringcode now
Jump in the discussion.
No email address required.
More options
Context
More options
Context
Snapshots:
ALGORITHMIC COMPLEXITY:
archive.org
ghostarchive.org
archive.ph (click to archive)
Jump in the discussion.
No email address required.
More options
Context