This is a comment that often comes up, but rest assured the top competitors really are that fast from scratch. There are some screencasts floating around of Petr competing in Toocoder SRMs, and you can also look at the timings on I site Topcoder and ACM competitions, where there really is no copy and paste. That said, one does end up memorizing some things with practice. For example, after having to code it up a few times it is easy to get a nice short implementation of network flow that you can type in in 2 minutes or so.