Algorithms snippets for programming contests