send_nodes's blog

By send_nodes, history, 4 years ago, In English,

I'm curious to know what all of you keep in your coding library to make your coding faster. I'm keeping a geometry library storing basic computational geometry tools(dot, cross, intersect, distance to line, centroid, area, etc.) and a graph theory library having max flow and flood fill.

I ask because I want to know how much is necessary to perform well in contests.

 
 
 
 
  • Vote: I like it  
  • -9
  • Vote: I do not like it  

»
4 years ago, # |
  Vote: I like it +10 Vote: I do not like it

I think it's not about keeping much code to faster coding. Mainly it's about quick thinking and experience. Extra code is just way to fast coding. But what's the use of extra code if you don't know what you're gonna coding or if your code will contain bugs?
Plus in the onsite contests you need to coding all by yourself.

My main thought is you don't need extra code to perform well. All you need is experience.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Right, you need to know the algorithms before you apply them. But there are lots of algorithms that are hard to replicate in a contest flawlessly (mincost maxflow comes to mind). So after understanding these algorithms, I think it would be beneficial to have them pre-written so you wouldn't have to waste time writing and debugging them.

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it -11 Vote: I do not like it

      As I said this not allowed on onsite contests.
      And little unsporting on offsite contests.

»
4 years ago, # |
  Vote: I like it +2 Vote: I do not like it

Nothing.

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

in datastructure I just keep a template of segment tree, rest I don't get to use frequently / easy to implement

And some algo MST kruskal or dijsktra or MO code in my own style , just in case I forget

»
4 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

I've got nothing. I always tell myself I should write some algorithms/structrues that take time (max-flow-min-cost, suffix/palindromic trees, etc) but I'm too lazy to do it.

»
4 years ago, # |
  Vote: I like it +3 Vote: I do not like it

Actually I have some things in library. What I've used largest number of times are definitely geometry, Dinic and Newton's symbol (however the last one can be in most cases written very quickly). However I also have there few more complicated algorithms which I've never used or did it one time at most like centroid decomposition, heavy-light decomposition. And few classical ones like exgcd, Euler's circuit, Chinese Remainder Theorem, exponentiating matrices, FFT.

But it is not that often case that I use something from there in individual contests, I think maybe once in 5-10 contests. On OpenCups it happened much more often, I was pasting my geo library almost everyday :P.

»
4 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

I keep this: algos :D

Though about only 20% are often copied from there.