水题一题,按绝对值排序后扫描一片数组(判断是否异号,我是直接相乘注意中间值越界)即可. 感觉是让我练习sort自定义比较函数的. #include<cstdio> #include<cmath> #include<algorithm> using namespace std; const int MAXN=500000+10; int a[MAXN]; bool compare(const int &a,const int &b) { return ab…
Building designing An architect wants to design a very high building. The building will consist of some floors, and each floor has a certain size. The size of a floor must be greater than the size of the floor immediately above it. In addition, th…