天天看点

Brute Force --- UVA 10167: Birthday Cake  Problem's Link:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=13&problem=1108&mosmsg=Submission+received+with+ID+14413715

Mean: 

analyse:

 由于A,B的范围在-500~500之间,所以直接枚举就可以了。

Time complexity: O(n*n*m)

Source code: