12627专题

(白书训练计划)UVa 12627 Erratic Expansion(递归+找规律)

题目地址:UVa 12627 这题是先找规律,规律在于对于第k个小时的来说,总是可以分成右下角全是蓝色气球,右上角,左下角与左上角三个一模一样的k-1个小时的气球。这样的话,规律就很清晰了,然后用递归做比较方便。。。 代码如下: #include <iostream>#include <cstdio>#include <string>#include <cstring>#incl

UVA 12627 递归找规律,紫书p245页例题

UVA - 12627 Erratic Expansion 奇怪的气球膨胀  Piotr found a magical box in heaven. Its magic power is that if you place any red balloon inside it then, after one hour, it will multiply to form 3 red

UVA - 12627 Erratic Expansion 奇怪的气球膨胀 (分治)

紫书例题p245   Piotr found a magical box in heaven. Its magic power is that if you place any red balloon inside it then, after one hour, it will multiply to form 3 red and 1 blue colored balloons. Then