随笔分类 - HDU_ACM
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1712问题有N件物品和一个容量为V的背包。第i件物品的费用是c[i],价值是w[i]。这些物品被划分为若干组,每组中的物品互相冲突,最多选一件。求解将哪些物品装入背包可使这些物品的费用总和不超过背包容量,且价值总和...
阅读全文
摘要:二维费用的背包问题是指对于每件物品,具有两种不同的费用,选择这件物品必须同时付出这两种代价,对于每种代价都有一个可付出的最大值(背包容量),求选择物品可以得到最大的价值。设第i件物品所需的两种代价分别为v[i]和u[i],两种代价可付出的最大值(两种背包容量)分别为V和U,物品的价值为w[i]。分析...
阅读全文
摘要:Problem Description急!灾区的食物依然短缺!为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。请问:你用有限的资金最多能采购多少公斤粮食呢?后记:人生是一个充满了变数...
阅读全文
摘要:Problem DescriptionMany years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , su...
阅读全文
摘要:Problem DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action...
阅读全文
摘要:DescriptionDiophantus of Alexandria was an egypt mathematician living in Alexandria. He was one of the first mathematicians to study equations where v...
阅读全文
摘要:Problem Description开学了,杭电又迎来了好多新生。ACMer想为新生准备一个节目。来报名要表演节目的人很多,多达N个,但是只需要从这N个人中选M个就够了,一共有多少种选择方法?Input数据的第一行包括一个正整数T,接下来有T组数据,每组数据占一行。每组数据包含两个整数N(来报名的...
阅读全文
摘要:Problem DescriptionGive you a lot of positive integers, just to find out how many prime numbers there are.InputThere are a lot of cases. In each case,...
阅读全文
摘要:Problem Description还记得汉诺塔III吗?他的规则是这样的:不允许直接从最左(右)边移到最右(左)边(每次移动一定是移到中间杆或从中间移出),也不允许大盘放到小盘的上面。xhd在想如果我们允许最大的盘子放到最上面会怎么样呢?(只允许最大的放在最上面)当然最后需要的结果是盘子从小到大...
阅读全文
摘要:Problem DescriptionThe most important part of a GSM network is so called Base Transceiver Station (BTS). These transceivers form the areas called cell...
阅读全文
摘要:1 #include 2 int cal( int x,int y ) 3 { 4 return y ? cal( y , x % y ) : x;//求最大公约数 5 } 6 int main( ) 7 { 8 int x,y,z; 9 while( scanf( "%d...
阅读全文
摘要:Problem Description输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这个整数就是由若干个‘0’组成的,这时这个整数就是0)。你的任务是:对这些分割得到的整数,依从小到大的顺序排...
阅读全文
摘要:Problem Description定义:一个词组中每个单词的首字母的大写组合称为该词组的缩写。比如,C语言里常用的EOF就是end of file的缩写。Input输入的第一行是一个整数T,表示一共有T组测试数据;接下来有T行,每组测试数据占一行,每行有一个词组,每个词组由一个或多个单词组成;每...
阅读全文
摘要:Problem DescriptionGive you three sequences of numbers A, B, C, then we give you a number X. Now you need to calculate if you can find the three numbe...
阅读全文
摘要:有关数论方面的题要仔细阅读,分析公式。Problem DescriptionIgnatius is poor at math,he falls across a puzzle problem,so he has no choice but to appeal to Eddy. this proble...
阅读全文
摘要:要细细理解Problem Description妈妈你别哭泪光照亮不了我们的路让我们自己慢慢的走妈妈我会记住你和爸爸的模样记住我们的约定来生一起走上面这首诗节选自一位诗人纪念遇难同胞的作品,并没有华丽的语言,但是每位读者都应该能感受到作品传达的浓浓爱意,也许还有丝丝无奈。确实,太多的关于孩子不幸的报...
阅读全文
摘要:Problem DescriptionDo you like playing basketball ? If you are , you may know the NBA Skills Challenge . It is the content of the basketball skills . ...
阅读全文
摘要:主要是计算前n项和的公式。前n项和的立方公式为 : s(n)=(n*(n+1)/2)^2;前n项和的平方公式为:s(n)=n*(n+1)(2*n+1)/6;转自百度搜索:公式证明 迭代法: 我们知道: 0次方和的求和公式ΣN^0=N 即1^0+2^0+...+n^0=n 1次方和的求和公式...
阅读全文
摘要:Problem DescriptionEverybody knows any number can be combined by the prime number.Now, your task is telling me what position of the largest prime fact...
阅读全文
摘要:Problem DescriptionAs we all know the Train Problem I, the boss of the Ignatius Train Station want to know if all the trains come in strict-increasing...
阅读全文

浙公网安备 33010602011771号