int> PII;//对于block,存大小和其属于的tower,对于Tower,存其大小和编号9intn,m,x;10priority_queue<PII,vector<PII>,greater<PII> >q;11voidclear(){12while(q.size()) q.pop();13}14intid[N];15intmain(){1617intT;18cin>>T;19
Phoenix has n blocks of height h1,h2,…,hn, and all hi don't exceed some value x. He plans to stack all 𝑛n blocks into m separate towers. The height of a tower is simply the sum of the heights of its blocks. For the towers to look beautiful, no two towers may have a heigh...
一、算法分析 这道题当时自己没有做出来,因为自己的思路一开始就跑偏了,两个三角形或者四个三角形都能拼成一个小正方形,但是自己只考虑了小正方形是1*1,2*2,4*4,8*8...的大正方形。而事实上3*3,5*5,6*6...这些也都是正方形。只是样例里面没有提到,自己就没有想到,这是自己的一个大问题。之后如...