POJ 1032】的更多相关文章

题目地址:http://poj.org/problem?id=1032 Parliament Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 17473   Accepted: 7371 Description New convocation of The Fool Land's Parliament consists of N delegates. According to the present regulation…
Description New convocation of The Fool Land's Parliament consists of N delegates. According to the present regulation delegates should be divided into disjoint groups of different sizes and every day each group has to send one delegate to the concil…
Parliament Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 16521   Accepted: 6975 Description New convocation of The Fool Land's Parliament consists of N delegates. According to the present regulation delegates should be divided into dis…
题意:给出一个数n,将其拆分为若干个互不相等的数字的和,要求这些数字的乘积最大. 分析:我们可以发现任何一个数字,只要能拆分成两个大于1的数字之和,那么这两个数字的乘积一定大于等于原数.也就是说,对于连乘式中,如果将一个乘数a更换为两个数字b×c(a=b+c且b>1,c>1),那么乘积只可能增大或不变,不会减小.所以我们拆分的原则就是将这些数字拆得尽量小,拆成许多2的乘积是最好的.又因为题目约束各个数字不能相同,则我们拆分的结果最理想的情况是从2开始的公差为1的等差数列.但是有时是无法构成这样…
给出n,把n分解为若干不相同数之和,使之乘积最大.贪心,Discuss里面的思路:把n分解为从2开始的连续整数,如果有多,则从高位开始依次加1.如26,我们得到2+3+4+5+6,此时还剩余6(26-2-3-4-5-6),接下来从高位依次加一,变成3+4+5+6+7,还剩1,继续加给最大的7,最后答案是3+4+5+6+8 #include <iostream> #include <cstdio> using namespace std; int main() { // freope…
Parliament Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 19103   Accepted: 8101 Description New convocation of The Fool Land's Parliament consists of N delegates. According to the present regulation delegates should be divided into dis…
#include<iostream> using namespace std; int main() { int n; int num; ; int i,j; cin>>num; ;;i++){ sum+=i; ){ ;j<=i+;j++) cout<<j<<" "; break; } if(num-sum<i){ n=i-num+sum; ;j<=i;j++) if(j>n) cout<<j+<…
Description Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an algorithm whose classification is not known for all po…
POJ 排序的思想就是根据选取范围的题目的totalSubmittedNumber和totalAcceptedNumber计算一个avgAcceptRate. 每一道题都有一个value,value = acceptedNumber / avgAcceptRate + submittedNumber. 这里用到avgAcceptedRate的原因是考虑到通过的数量站的权重可能比提交的数量占更大的权重,所以给acceptedNumber乘上了一个因子. 当然计算value还有别的方法,比如POJ上…
poj 题目分类 按照ac的代码长度分类(主要参考最短代码和自己写的代码) 短代码:0.01K--0.50K:中短代码:0.51K--1.00K:中等代码量:1.01K--2.00K:长代码:2.01K以上. 短:1147.1163.1922.2211.2215.2229.2232.2234.2242.2245.2262.2301.2309.2313.2334.2346.2348.2350.2352.2381.2405.2406: 中短:1014.1281.1618.1928.1961.2054…