随机化算法+贪心! 将3*k排序后分成3分,将第二第三份的和分别加起来,让和与500*k比较,都大于则输出,否则,随机生成2个数,在第二第三份中交换! 代码如下: #include<iostream> #include<stdio.h> #include<cmath> #include<algorithm> using namespace std; struct an { int w,lab; }p[]; bool cmp(const an &a,c…
Jersey Politics Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5592 Accepted: 1413 Special Judge Description In the newest census of Jersey Cows and Holstein Cows, Wisconsin co…
Apple Tree Time Limit: 2000MS Memory Limit: 65536K Description There is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the big apple t…