SPOJ solutions and code snippets