2026/02/24

Newest at the top

2026-02-24 23:39:30 +0100 <tomsmeding> I am using lists only to pass to `putStrLn . unwords . map show`
2026-02-24 23:39:15 +0100 <mauke> you guys are using lists?
2026-02-24 23:38:37 +0100 <tomsmeding> (that server is really slow...)
2026-02-24 23:38:13 +0100tromp(~textual@2001:1c00:3487:1b00:7955:9591:6018:7ef9) (Quit: My iMac has gone to sleep. ZZZzzz…)
2026-02-24 23:36:59 +0100 <tomsmeding> turns out my lists weren't actually lazy when printed -- I was materialising them with 'length'. If I don't do that, my worst-case time on the judge server goes from 0.30s to 0.21s
2026-02-24 23:36:26 +0100pavonia(~user@user/siracusa) siracusa
2026-02-24 23:36:19 +0100prdak(~Thunderbi@user/prdak) (Ping timeout: 264 seconds)
2026-02-24 23:34:59 +0100machinedgod(~machinedg@d172-219-48-230.abhsia.telus.net) machinedgod
2026-02-24 23:34:27 +0100arahael(~wetfoot@user/arahael) arahael
2026-02-24 23:33:57 +0100kawzeg(kawzeg@2a01:4f9:c013:cfbf::1) kawzeg
2026-02-24 23:33:39 +0100kawzeg(kawzeg@2a01:4f9:c013:cfbf::1) (Server closed connection)
2026-02-24 23:33:30 +0100 <lantti> but that might work against me as well, lets see
2026-02-24 23:33:12 +0100 <lantti> all that can still go away if i make a loop instead of a list
2026-02-24 23:32:50 +0100 <lantti> I also use a delete on one of the lists to remove that one int that needs to move to the other set
2026-02-24 23:32:41 +0100arandombit(~arandombi@user/arandombit) (Ping timeout: 248 seconds)
2026-02-24 23:31:55 +0100 <tomsmeding> interesting
2026-02-24 23:31:48 +0100 <lantti> yes, to the constant time
2026-02-24 23:31:42 +0100prdak(~Thunderbi@user/prdak) prdak
2026-02-24 23:31:33 +0100 <tomsmeding> (and how do your judge times compare to mine?)
2026-02-24 23:31:32 +0100 <lantti> yes, but I still generate a list of them. eliminating that list now...
2026-02-24 23:31:19 +0100 <tomsmeding> or is there a little loop or something involved
2026-02-24 23:31:07 +0100 <tomsmeding> lantti: do you determine what numbers to print in constant time?
2026-02-24 23:30:21 +0100 <lantti> of course I don't know if any other students are reading this
2026-02-24 23:29:56 +0100 <lantti> tomsmeding: I already passed so you won't boost my grade with it
2026-02-24 23:28:43 +0100terrorjack(~terrorjac@2a01:4f8:271:2d98::2) terrorjack
2026-02-24 23:28:21 +0100 <tomsmeding> (I'm not sure if it's responsible to post my solution publically for people to scrutinise)
2026-02-24 23:27:25 +0100 <tomsmeding> and I can assure you that I am actually doing work that should take <10us plus `putStrLn . unwords . map show` on a lazy list of Int
2026-02-24 23:26:41 +0100 <tomsmeding> it seems printing is actually rather slow on that judge server! On roughly 260000 I take 0.08s, on roughly 653000 I take 0.21s, and on 1000000 I take 0.30s
2026-02-24 23:26:22 +0100 <haskellbridge> <ijouw> yes, it is (n*(n+1))/2
2026-02-24 23:25:48 +0100 <geekosaur> `sum [1..n]` isn't there a number theory approach for that?
2026-02-24 23:25:35 +0100peterbecich(~Thunderbi@71.84.33.135) (Ping timeout: 245 seconds)
2026-02-24 23:24:58 +0100 <tomsmeding> and I'm not sure where even that 0.30s comes from; it takes less than 1ms on that input on my machine
2026-02-24 23:24:08 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 268 seconds)
2026-02-24 23:23:28 +0100 <tomsmeding> it's a fun problem :)
2026-02-24 23:23:02 +0100 <tomsmeding> (I figured out a way to compute what numbers to print in constant time; then I just have to print all those numbers)
2026-02-24 23:21:16 +0100 <tomsmeding> lantti: I'm not sure what you did, but it can probably be done more efficiently; this is haskell with `putStrLn . unwords . map show` https://tomsmeding.com/ss/get/tomsmeding/RnFf4z
2026-02-24 23:19:53 +0100tremon(~tremon@83.80.159.219) (Quit: getting boxed in)
2026-02-24 23:19:31 +0100petrichor(~jez@user/petrichor) petrichor
2026-02-24 23:19:06 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-02-24 23:17:50 +0100gmc(sid58314@id-58314.ilkley.irccloud.com) gmc
2026-02-24 23:17:39 +0100gmc(sid58314@id-58314.ilkley.irccloud.com) (Server closed connection)
2026-02-24 23:17:36 +0100 <newmind> mauke: did you get nerdsniped there?
2026-02-24 23:17:05 +0100 <mauke> hah, no. I was wrong about being wrong. I just did it backwards :-)
2026-02-24 23:15:12 +0100 <mauke> nvm, I'm blind
2026-02-24 23:13:01 +0100 <mauke> 1 + 2 = 3
2026-02-24 23:12:45 +0100 <mauke> ah, I see it
2026-02-24 23:11:53 +0100petrichor(~jez@user/petrichor) (Ping timeout: 248 seconds)
2026-02-24 23:10:01 +0100abiss27(~abiss27@user/abiss) abiss
2026-02-24 23:08:07 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 264 seconds)
2026-02-24 23:04:47 +0100 <haskellbridge> <ijouw> Working on it