According exercises in "BeginningAlgorithmContests", I wrote these codes to solve these exercise and ensure I have learned something. The answer can be found in https://github.com/aoapc-book/aoapc-bac2nd.
为了完成书中的习题而写的代码,正确答案可以在上面的地址找到。