-
Notifications
You must be signed in to change notification settings - Fork 748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MIT additions #63
Comments
Link, for reference: https://github.com/ecnerwala/icpc-book/
Should look into these and see if they are better.
We already have the Angle class.
Yeah, not sure if it's a big point in this. (Also, if I had to specify a favorite algorithm, that randomized version would be it. It'd be a bit sad to remove it. :))
Should look into their suffix tree for sure.
That's KACTL's version. We should perhaps include it in the pdf now that we're so far below 25 pages...
Yep, #60.
We should definitely include these. (I thought we had a description of matrix tree already.)
I think we should include Half Plane Intersection, Directed MST and Nim product, the rest I'm unsure about. The latest NWERC had a fast Directed MST implementation, if MIT's isn't optimal.
That implementation looks broken...
We should at least have a flag for this in kactl.tex. I looked into copying whatever https://github.com/ludopulles/kactl/blob/master/kactl.pdf does before but IIRC it unfortunately changed the column limit.
... maybe. Probably. But it needs to look good...
Why is this good? :) |
Hello! Here's my take on which of these are good to include
They're probably about the same, we just used one we're more familiar with.
We really don't know.
Yay it's short!
This is very comprehensive. It includes FFT/NTT together, and you can use FFT with multiply_mod for mod 1e9+7. Good good.
I liked using this for geometry with integers, I don't really understand the existing angle class. They're useful primitives for sure.
xyz said this is blazingly fast.
We failed some problems on sparse graphs because V^3 isn't fast enough.
This probably isn't useful at WF, but could be useful on OpenCup where problem setters are more annoying. It is fast.
Must have for geometry.
When you need it, you need it. Not something I'd skimp on.
Ditto; you sometimes need it.
We definitely used this. Short, but useful.
Meh, maybe useful, or you could memorize it.
Good primitive for geometry.
If you need it, you need it; don't skip
Meh, use a fast suffix array.
If you need it, you need it; don't skip
If you need it, you need it; don't skip
Probably never going to be useful, you can also learn the algo
If you need it, you need it; don't skip (it's short too)
If you need it, it's really useful to not have to rederive.
xyz said this is really fast.
Do it! It's currently kinda jank because listings sucks, but it's better than nothing.
** SUPER USEFUL ** This is easy to overlook, but it saves you soooooo much debugging time when typing book. You can just type book, hash it, and check it on paper if it's wrong. If it hashes correctly, it's like half your code that you don't have to debug.
The compile flags are worth it, but the rest is just pasted from my personal Makefile. We just used the flags. |
re: LCT, ours supports BBST=-like augmentation, so it can fully replace HLD. Maybe consider removing the HLD? |
Thanks for the input! That's very helpful, you guys have a lot more contest experience than I do.
This is how you'd do "point between two vectors" with the Angle class, FWIW:
with various inequalities turned strict/non-strict depending on the exact behavior you want. I agree that these are useful primitives to have.
I can imagine it's fast, but unfortunately it's also broken: https://gist.github.com/simonlindholm/0afed4cffc8e7fe9584df4d042526f99 :/
Mmm, I suppose we should do this. Do you think a single hash per code would work? Or maybe one could do some heuristic splitting on functions/structs/paragraphs, to avoid cluttering the code with markers...
That sounds like an excellent idea. That HLD is super crufty anyway, and the current LCT hard to augment. |
In our book, our rough heuristic is one hash per function, and the preprocessor defaults to single hash per code unless otherwise specified. From a contestant's point of view, hashes are very very cheap to verify (there are some vim bindings in vimrc to hash a visual-mode range), so more hashes has little downside and a bunch of upside if one of them fails to verify (linearly less hunting for the bug). Also, you may want the hash to skip some heading lines, e.g. To implement hashes, you may want to redo it. It's crucial that the hash is computed based on exactly what's on the page, so it should really be the final pass of the preprocessor. |
Replaced/duplicate implementations
AngleCmp (Various angle comparison utilities)Different Algorithms for Existing Implementations
Math/description additions:
Completely New Additions (roughly ordered from what I've seen of other notebooks)
???
Graph-Negative-Cycle?(Seems like it's incorrect)Misc:
Crossed out means that we decided to not include it.
The text was updated successfully, but these errors were encountered: