2026/02/24

Newest at the top

2026-02-25 00:15:24 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-02-25 00:10:50 +0100 <haskellbridge> <ijouw> When removing it so i can submit with fewer deps
2026-02-25 00:10:36 +0100 <haskellbridge> <ijouw> I was using a library which wraps reads with Maybe and forgot to adjust the type...
2026-02-25 00:10:11 +0100emmanuelux(~em@user/emmanuelux) emmanuelux
2026-02-25 00:07:59 +0100 <haskellbridge> <ijouw> My solution fails locally at readLn? I am confused.
2026-02-25 00:07:49 +0100 <lantti> mine was https://privatebin.net/?97447d6805a0ea49#CfnZntNYLfYtSvpCod6DSKRYS8xDhzqycvhjmKNhppjv
2026-02-25 00:04:20 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 245 seconds)
2026-02-25 00:00:02 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-02-24 23:57:40 +0100 <tomsmeding> *yes I do because
2026-02-24 23:56:18 +0100 <tomsmeding> yes, because there's also sqrt
2026-02-24 23:56:05 +0100 <haskellbridge> <ijouw> There is div from Integral, no need for double cast for /2
2026-02-24 23:54:57 +0100 <tomsmeding> overengineered spoilers: https://cses.fi/paste/b23bf94c9440505af9ce60/ (if we're sharing anyway...)
2026-02-24 23:53:22 +0100 <mauke> spoilers: https://cses.fi/paste/7167882c695ce46ff9ce6b/
2026-02-24 23:52:26 +0100 <tomsmeding> *took
2026-02-24 23:52:11 +0100 <tomsmeding> stdout handling is slow, told you
2026-02-24 23:51:52 +0100 <tomsmeding> mauke: I tool the liberty to submit your solution to the judge; it takes 0.59s
2026-02-24 23:50:42 +0100 <haskellbridge> <ijouw> I am debating whether i want to put it in an automatic solver
2026-02-24 23:50:41 +0100 <mauke> my solution doesn't use lists :-)
2026-02-24 23:49:28 +0100 <tomsmeding> mine is overengineered, I used a sqrt
2026-02-24 23:49:17 +0100 <tomsmeding> that sounds like mauke's solution (exchanged ideas in private chat)
2026-02-24 23:48:57 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
2026-02-24 23:48:52 +0100 <haskellbridge> <ijouw> I now have a formal proof by induction with step 4
2026-02-24 23:47:36 +0100 <tomsmeding> this is all <0.001s on my machine lol
2026-02-24 23:47:21 +0100 <tomsmeding> so that's 0.02s for the computation, 0.14s for the serialisation, and 0.05s for the printing
2026-02-24 23:47:01 +0100 <tomsmeding> and if I do `evaluate . length . unwords . map show` instead, I get 0.16s
2026-02-24 23:46:49 +0100 <lantti> ah, so there it is :)
2026-02-24 23:46:41 +0100__monty__(~toonn@user/toonn) (Quit: leaving)
2026-02-24 23:46:14 +0100 <lantti> ah, ok, I got it to 0.21s too by eliminating two calls to length and one to delete
2026-02-24 23:45:57 +0100 <tomsmeding> ok if I replace the `putStrLn . unwords . map show` with `mapM_ evaluate` then maximum runtime goes from 0.21s to 0.02s
2026-02-24 23:44:39 +0100merijn(~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn
2026-02-24 23:42:41 +0100 <mauke> it should run all of them
2026-02-24 23:42:19 +0100 <tomsmeding> then the server would mark my answer wrong and (presumably? didn't try) not proceed to the larger test cases
2026-02-24 23:40:31 +0100 <newmind> tomsmeding: without printing and just evaluating its fast on the server too?
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