Solutions to various online judge problems