Phoenix is playing with a new puzzle, which consists of nn identical puzzle pieces. Each puzzle piece is a right isosceles triangle as shown below. A puzzle piece The goal of the puzzle is to create a square using the nn pieces. He is allowed to rotate and move the pieces around, but...
一、算法分析 这道题当时自己没有做出来,因为自己的思路一开始就跑偏了,两个三角形或者四个三角形都能拼成一个小正方形,但是自己只考虑了小正方形是1*1,2*2,4*4,8*8...的大正方形。而事实上3*3,5*5,6*6...这些也都是正方形。只是样例里面没有提到,自己就没有想到,这是自己的一个大问题。之后如...
Phoenix is playing with a new puzzle, which consists of n identical puzzle pieces. Each puzzle piece is a right isosceles triangle as shown below. A puzzle piece The goal of the puzzle is to create a square using the n pieces. He is allowed to rotate and move the pieces around, but n...