Mixed Long Contest on 13 December 2017

This is a long contest on different topics. Everyone should have a go at this.

Link: https://vjudge.net/contest/204316
Password: jnulong