Newest at the top
| 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 +0100 | merijn | (~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 +0100 | tromp | (~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 +0100 | pavonia | (~user@user/siracusa) siracusa |
| 2026-02-24 23:36:19 +0100 | prdak | (~Thunderbi@user/prdak) (Ping timeout: 264 seconds) |
| 2026-02-24 23:34:59 +0100 | machinedgod | (~machinedg@d172-219-48-230.abhsia.telus.net) machinedgod |
| 2026-02-24 23:34:27 +0100 | arahael | (~wetfoot@user/arahael) arahael |
| 2026-02-24 23:33:57 +0100 | kawzeg | (kawzeg@2a01:4f9:c013:cfbf::1) kawzeg |
| 2026-02-24 23:33:39 +0100 | kawzeg | (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 +0100 | arandombit | (~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 +0100 | prdak | (~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 +0100 | terrorjack | (~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 +0100 | peterbecich | (~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 +0100 | merijn | (~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 +0100 | tremon | (~tremon@83.80.159.219) (Quit: getting boxed in) |
| 2026-02-24 23:19:31 +0100 | petrichor | (~jez@user/petrichor) petrichor |
| 2026-02-24 23:19:06 +0100 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn |
| 2026-02-24 23:17:50 +0100 | gmc | (sid58314@id-58314.ilkley.irccloud.com) gmc |