« first day (3606 days earlier)      last day (1229 days later) » 

12:36 AM
codegolf.stackexchange.com/review/suggested-edits/57789 I edited an answer mistakenly, and now I'm trying to fix it
is there a way for me to do this without unfairly gaining rep?
 
 
1 hour later…
1:50 AM
A moderator can retroactively reject the edit, denying you the two rep.
 
 
2 hours later…
3:55 AM
@Lyxal I agree
@Neil your answer is correct
 
4:53 AM
7 minutes
 
hope i don't choke again
6
 
@HyperNeutrino same :(
 
note to self: negative numbers are a lie
 
Of course, now today's challenge will have nothing to do with negative numbers
 
4:55 AM
lol yeah ofc, i'm gonna mess up on a completely new thing
 
note to self: remember how to type
 
You just did.
 
o
big brain
 
guys how do i type
 
4:56 AM
note to self: don't write bugs
 
20 secs ago, by pppery
You just did.
 
idk how to type.
 
noet to slef: dont' mae ktypos
3
 
ez 2 minutes
note to self: be betaveros
 
speeeeeeeeed
 
4:57 AM
betaveros is just algo god
 
no, xiaowuc1 is better
apparently
 
no their secret is they actually just do it all in their head so they don't even need to code
 
note to self: make a note to self saying "note to self: make a note to self saying "note to self: make a note to self saying "note to self: make a note to self saying "note to self: make a note to self saying "note to self: make a note to self saying "note to self: make a note to self saying "note to self: make a note to self saying "...
4
 
"I'm trying a new strategy where I mess up on the logic for an hour then realize I made a typo on line 4"
 
2
 
4:58 AM
@RedwolfPrograms me basically. part 2 yesterday, small bug cost me 10 mins
@Lyxal nice haskell infinite quine
 
note to self: how to read
i literally dont read the prompt
 
.25
 
gl everyonbe
 
4:59 AM
i have my chalk ready
im having great lag right now
 
same what the hell
i can't load p2
okay GG i'm literally unable to view the problem anymore
 
rank 36 part 1
 
Same
I got 37 on part 1
 
17
unless everyone's also getting issues i probably lose p2
looks like CRT to me, maybe?
 
diophantine?
im stuck too
 
5:06 AM
chinese remainder
idk tho
 
Only 1 person has done part 2 so far
Now 3 people
 
mmm
definitely a bit slow to brute force lmao
 
"surely the actual earliest timestamp will be larger than 100000000000000"
 
crt sounds like it may work
brute force for each number
 
okay yeah it's crt
 
5:15 AM
I don't know crt :(
 
same here
 
i didnt either
but i google
also not reall crt it just 1 by 1 brute force
 
Mine is 100% larger than 100000177492586
 
how have 299 people already done this
 
im just dumb thats how
idk whats wrong wiyh my thing
 
5:26 AM
rank 361
pain
if only i actually thought about it for longer instead of switching between my three ideas and messing them all up lol
 
Wait, am I wrong in assuming a number n's n mod a and n mod b don't change when you add a number made by the product of the factors of n?
 
that's sort of what i've been trying to do
but that's probably still way too slow
 
Mine finished super quick but was wrong
 
About a tenth of the minimum it said
 
5:28 AM
lol
 
okay so how do i use this "crt" (Chinese remainder theorem?)
 
No idea
If someone could explain that'd be really helpful
 
wikipedia is not being helpful on how to actually use these bézout coefficients
 
ok so
i lied it isnt really crt
tldr do it for 1 thing
now your step is bus # 1
after next? step is bus # 1 * bus # 2
so much spoilers tho so
bye
 
okay so it's what me and redwolf are trying lmao
 
5:31 AM
im angery btw my thing is erroring for my thing
 
My theory is right but my implementation is wrong. Go figure. :p
 
dumb error
rank 556
 
I was able to understand how to do it by reading Wikipedia
 
okay so if i've understood correctly: find the earliest timestamp for bus 1, find the earliest timestamp for bus 2 starting at the last stamp, then same for the third etc?
or have i missed the mark completely
 
yeah it's... not actually chinese remainder theorem really
@Lyxal well basically you have a bunch of congruence relations
for example with the sample input, you need to find x such that
x is 0 mod 7
x is 1 mod 13
x is 4 mod 59
...
if you have a value that's 0 mod 7 and 1 mod 13, adding multiples of 7*13 will not change the result
 
5:33 AM
wdym by "x is y mod z"? you mean x = y mod z?
 
wow i choked hard part 2
oh well
 
so for the first x, it is a multiple of 7
 
wow smh hyper
 
so you start at 0, which meets the first requirement, then you keep adding 7 until you meet the second requirement (the number is 14), then keep adding 91 until you meet the third requirement, then add 5369, etc
 
5:34 AM
spoilers
 
oh
okay
 
hyper what rank did u get btw
 
sorry it's well past R100 otherwise i wouldn't say anything
 
probs 10th tbh
welp
 
17/361...
 
5:35 AM
at least u didnt choke as bad as me...
36/556 :^)
 
okay i completely screwed up my approach for p2
and my p1 was pretty slow today
 
i didnt know how to do part 2 until i did it
also like 3 bugs in p2 as is usual for me
 
wait that was easy as hell
i'm just embarrassed now
698 lol
 
I don't know why I'm wrong
How do you deal with ones where the offset is larger than the number being multiplied?
 
i think i may have overkilled it
 
5:37 AM
your residue checking might be backwards like mine was
 
anyone else use modinv
 
I'm doing current_number % bus_number == bus_offset % bus_number, is that correct?
 
bro i used js bro
 
@RedwolfPrograms that's backwards
 
5:39 AM
What's backwards?
 
you're finding a timestamp where they departed that long ago with that
 
@RedwolfPrograms almost. im dumb so i forgot only python (?) keeps positive mod?
tldr
 
holy shit i'm stupid
 
bus_offset is wrong
lel hyper
 
you want to add the index and check for divisibility
 
5:40 AM
oh god i choked on this prob SO hard
i could've gotten it in like sub 10m probably
 
unless you can check for congruence with negative numbers lmao
 
by literally adding two more characters
i hate myself
 
@HyperNeutrino saaaaaame
i just spent too long between approaches
i couldn't decide how to try
 
two more wtf
 
I don't get what you're saying, @UnrelatedString
 
5:41 AM
funny thing
i got the reduce down waaaay early
just had no idea what to put in it
 
@RedwolfPrograms add the offset to the id and check the result against 0
 
i was checking s % m == r without noting that r could be >= m.........
 
the bus id
 
s = current, m = bus id, r = offset
 
5:42 AM
@HyperNeutrino How'd you solve it?
Same issue I have
 
when i said add to the id i meant add to the timestamp and not the id
 
@HyperNeutrino same
 
i got that
 
@RedwolfPrograms the same brute-force method but using modinv to calculate the required additions because i thought my original method is too slow, but it's just cuz i set a while loop with an impossible fail cond
 
spent like 10 mins console logging
 
5:44 AM
@UnrelatedString So (current_number + bus_offset) % bus_number == 0?
 
lol
@RedwolfPrograms yes
 
oh yeah my answer was negative what it should've been so i just subtracted it from the product of all of the IDs lol
 
@HyperNeutrino where do i get the 91 from?
 
7 * 13
from example
 
@UnrelatedString Not working still :/
 
5:46 AM
send your entire sol?
 
Good luck reading it, but here
 
who else has finished btw
 
how do i interpret this
*run
 
@RedwolfPrograms try using LCM instead of just a product perhaps? shouldn't help if the result is still too small
 
I just verified it and I think it's right, why isn't AoC taking it?
 
5:48 AM
not needed
@RedwolfPrograms what's ur input
 
check the examples, see if it's too large or too small
 
& output
 
Wait, I bet it's the LCM thing
 
shouldn't be
 
Can I see one of y'alls as an example?
I think I made a typo somewhere
 
5:49 AM
no
unless you mean input
 
otherwise init wn wp to 0n 1n and wrap wp *= BigInteger(n[0])
 
aren't they all prime
 
I'm using a while, and I guess it's wrong. I'm checking (req - idx) % val == 0
 
oh yeah its probably a javascript integer precision thing lmao
 
5:50 AM
oh lmao
 
well
 
well gg
 
js has 52 bits precision
 
@RahulVerma should be a plus and not a minus
 
so like 17 digits
works fine till 1 quadrillion
 
5:51 AM
Nope, not int precision
 
huh that should be enough then
 
@UnrelatedString hm, actually I've written +, that's typo. But, it's not finishing yet
 
so yeah maybe your input's indices aren't prime
 
my solns are in my hackmd as usual
no cheating tho
 
5:51 AM
@RahulVerma huh
 
hmmmm
 
my solutions are on github to be dug up at leisure
 
indices don't matter the bus numbers do. but afaict they're all prime for convenience
if product is odd, the chance they're all prime is veryhigh
 
@HyperNeutrino is there a way to speed up the algorithm described by your approach?
 
i've also taken the incredibly lazy approach to boilerplate of just making my file for the next day as a copy of my current file before i start writing the solution itself
 
5:52 AM
@Lyxal you can use modular inverse to shortcut it
 
I miscounted the freaking offsets
 
yeah the numbers and not the indices
 
basically you start at A and add B until it's congruent to C mod D
 
i am getting those mixed up so much holy shit
 
@RedwolfPrograms i feel like maybe wn + n[1] might work idk tho
 
5:53 AM
so you can just take (C-A), multiply by the modular inverse of B mod D, and that's the number of times you need to add B
wait my rank actually improved today?
 
I think I messed up my offsets. I messed up the input parsing.
 
well
 
i dropped to 34th yesterday cuz i choked rly hard on p1
 
@RedwolfPrograms maybe. i didn't do that and just did arr.map((element, index)=>element&&[element, index])
 
Okay it's still wrong
 
5:57 AM
wn + n[1] also not it?
wait
ignore me
 
It should be - n[1]
At least for what I'm doing
 
@HyperNeutrino what's A, B, C and D in this situation?
 
@Lyxal A = index of line. B = line number. C = current. D = current lcm (product since bus lines are all prime)
 
A is your current working value, B is the product of your previous moduli (the value to add so that it doesn't break your working value), C is the offset of the next bus, D is the next bus index / modulus
 
yea that
 
6:02 AM
...you know, I find it funny that with how the global leaderboard works, we have two people on the private leaderboard between two people who are on the global leaderboard, who are not on the global leaderboard themselves
 
:( im sorry im 80 points short of leaderboard
 
I validated my answer. it is correct. WHY WON'T AoC take it?
 
@RedwolfPrograms input pls
and output
 
wait ascii you're somebody1234 right
 
so i can validate
yes
 
6:04 AM
you're beating me locally?
nice :D
 
probs
 
along with manish
 
also
>:( its cuz i started like 7 and 12 mins late on 2 days
 
smh my head. also on mobiel for one day
 
i didn't do day 1 or 7 on that day
and i started day 2 and 3 like 20 minutes late
 
@RedwolfPrograms i'm getting something that starts with a 5
 
Oh, I am...not
 
same (as unrelated string)
 
Let me reread the challenge
 
6:06 AM
i could compare the sizes of our results
 
@UnrelatedString same
 
but don't know how to run your code lmao
 
5xxxxxx5xxxxxx8
 
Stupid ten minute delay...I have the right answer but need to wait six minutes :(
 
theres ur answer
 
6:07 AM
:(
 
honestly it might not cost you even one rank lol
at the pace this is going
 
Top 150 in part one and probably top 150k in part two :p
 
never mind it already cost you two ranks
 
6:08 AM
lel 1720 finished part 2
 
a hour in. a lot worse than 5k
 
and another 10
 
Apparently y'all were right about something and I thought I had it implemented differently so it was reversed and it...wasn't
 
6:10 AM
I had tried it earlier and was like "yeah, they're wrong, it still doesn't work", but my input parsing was still incorrect
 
the unshift?
 
what the hell is an unshift by the way
 
Yeah I don't know how I managed to forget indexes existed
 
anti pop
 
wouldn't unshifting just be
shifting in the other direction
 
6:10 AM
hahah big rip
 
that is correct
 
It pushes into the beginning of the array
 
so... push
 
er yea
 
6:11 AM
Push is the end of the array
 
but to beginning explicitly
 
its front push my bad. shift is front pop
btw @HyperNeutrino so... it is crt
 
Only one more minute to wait
 
good luck
let's hope it's not wrong
 
I checked it against your result with my input, and it matched. I don't see how it could be wrong :p
Unless you're all conspiring to massively troll me, which probably isn't it
 
6:13 AM
yeah it is CRT i'm just having some difficulty using my brain cells rn lol
 
Yay, it worked!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
let's go
 
Took me over an hour but still better than day 7 :p
 
Day       Time  Rank  Score       Time  Rank  Score
 13   00:04:25   104      0   01:13:35  1909      0
So close to top 100 in p1
 
6:14 AM
what was day 7
hey i was close to top 100 too
 
The bags one
 
oh that problem was kinda annoying
 
i can't believe i've still only hit top 100 once this year
 
especially when i kept typing clear gold as the root instead of shiny gold...
 
6:15 AM
i think today was the closest i've gotten since i did actually get top 100 on day 2 lol
 
recursive invmod monkaw
 
i didnt do to shabby on day 7 surprisingly
 
that looks right
 
6:18 AM
lmao, nice
 
@HyperNeutrino well it isn't.
 
oh :(
 
it outputs 6176089 for the sample
 
haven't run / debugged it yet
i can take a look
 
are invmod args in the right order
 
6:20 AM
yes
 
yea ignore me
i feel like the bit thats being added dont look right. (jk)
 
why is it outputting 7 for the input
am i running it wrong
 
also ew lyxal don't for in len range
if for in array can do the trick
 
@ASCII-only as i said yesterday: once an hour passes, I don't care about elegance i only care about getting it working
 
wait what are these values
 
6:29 AM
at this point i honesly dont know. what exactly is the offset of the next bus?
 
the offset is the index, the modulus is the bus ID
okay so i fixed your solution by changing 0 to 1 in your outer for loop
because the invmod shortcut breaks when the existing value is already valid, i suppose
also the resulting value is -1x what the value should be (it's positive, but you can just do -n % m)
idk why or how to fix it smartly, but just do brute force lol
it's O(N max M) times the "smart" modinv sol, which is tiny
 
methinks i better try this again tomorrow
because right now, i have no clue what tf Im doing
 
fair enough
lol
 
 
6 hours later…
12:09 PM
hello!
 
12:20 PM
0
Q: Iterate over the neighborhood of a string

AnushInput A string S of length between 2 and 20. The only letters in the string will be a or b. Output All strings within Levenshtein distance 2 of S. You must output all the strings without duplicates but in any order you like. Example If S = aaa then the output would be (in any order) a aa ab ba aa...

 
 
2 hours later…
2:05 PM
@xash Is it possible to make a ' character in convey? I can't seem to put it in a string for obvious reasons, and doing math with characters seems to convert them permanently to numbers.
 
2:41 PM
started way too late lol
 
I started on time, but then, after struggling for half an hour, gave up and went to bed. After waking up, I was able to finish in 5 miniutes
 
I'm starting now lmao
just finished p1
 
P2 is much harder
 
I don't even remember what p1 was about, lol
 
Which bus to actually ride
It makes much more sense than part 2, which is a random math challenge devoid of any real connection to the story
 
2:52 PM
agreed
 
3:08 PM
@pppery hm yeah very large number
 
My answer was around 210 trillion
 
holy moly
maybe I should start at a huge number
 
3:23 PM
@xash Also .s seem to be very broken.
 
3:39 PM
@pppery ok now I'm starting to understand why you said this
 
@WheatWizard '…\'…' escapes now correctly. You mean the whole f. thing?
 
Yeah, sometimes . is applied to the character after it, or above it.
Maybe I just don't understand.
 
hello everyone
 
@xash For example this program https://λ.land/convey/run.html#eyJjIjoiPj4+dlxuXiAgdlxuLC4tLFxuWyAwWyIsInYiOjEsImkiOiIifQ==
 
I took the easy route when implementing it: first all functions are parsed, with . being a 1-1 function. Then, whenever a function has a . in its output, it is applied to it. So {f.} and }.f{ are the same.
 
3:48 PM
Ok, that is very confusing.
 
It is kinda helpful for this case: https://λ.land/convey/run.html#eyJjIjoiICAgfVxuey8rP1xuIHYuXlxuID4sXiIsInYiOjEsImkiOiIxIDEzIDYgOCJ9
For it to be so simple, +. would have then be one function taking two tiles, so that ? still sees the left as empty … maybe there is a cleaner solution.
Another downside to its non-intuitiveness is that f and f. always need to have the same number of in- and output ports.
 
Oh and I think & is still broken
https://λ.land/convey/run.html#eyJjIjoiez5cInYgICAxXG4gIDA9diY+QCRgdlxudjw8PDxeICs/LDxcbj4+Pj52XiBcIjBeXG4gICAgPl4gfSIsInYiOjEsImkiOiIxIDIgMSAyIDEgMiAxIDEgMSAxIDIgMSAyIDEgMiAxIDEgMSAyIDEgMiJ9
If you remove the queue from this it changes the output. It looks like some things are getting lost in the queue.
 
4:13 PM
@WheatWizard I missed a ! in my fix yesterday. Sorry for that. Works now … uh, better at least.
 
No problem for me, thanks for fixing it.
 
 
5 hours later…
9:09 PM
1
Q: Can you make your way through the Ulam spiral?

Kamila SzewczykYou will be given a point (x,y) relative to the center of the Ulam spiral (the point which represents one), and length z. The task is to check whether there exists a path from (0,0) to (x,y) of length z, assuming prime numbers are obstacles and each turn in path has an angle of 90 degrees. Path m...

 

« first day (3606 days earlier)      last day (1229 days later) »