天天看點

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: