自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

青山绿水之辈 专栏

成大事者,不惟有超世之才,亦有坚忍不拔之志。

  • 博客(32)
  • 资源 (6)
  • 问答 (1)
  • 收藏
  • 关注

原创 hdu2680Choose the best route (spfa算法,加个以0点为起点到每个起点,只要一遍就能算出,不然要算k次)

Problem DescriptionOne day , Kiki wants to visit one of her friends. As she is liable to carsickness , she wants to arrive at her friend’s home as soon as possible . Now give you a map of the city’s

2013-11-29 23:30:25 869

原创 poj1276Cash Machine(多重背包)

DescriptionA Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly N distinct bill denominat

2013-11-29 21:06:53 1765

原创 hdu1217Arbitrage (spfa算法)

Problem DescriptionArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US D

2013-11-29 12:29:38 1080

原创 hdu1599find the mincost route (floyd算法,相对模板而言时间优化了一半)

Problem Description杭州有N个景区,景区之间有一些双向的路来连接,现在8600想找一条旅游路线,这个路线从A点出发并且最后回到A点,假设经过的路线为V1,V2,....VK,V1,那么必须满足K>2,就是说至除了出发点以外至少要经过2个其他不同的景区,而且不能重复经过同一个景区。现在8600需要你帮他找一条这样的路线,并且花费越少越好。Input第一行是2

2013-11-29 01:03:05 1379

原创 oj1787Charlie's Change(多重背包+记录路径,每个包恰好被填满的基础上每个包的钱币的个数尽量多)

DescriptionCharlie is a driver of Advanced Cargo Movement, Ltd. Charlie drives a lot and so he often buys coffee at coffee vending machines at motorests. Charlie hates change. That is basically th

2013-11-28 18:09:11 1210

原创 hdu1548A strange lift (dijkstar)

Problem DescriptionThere is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 if you press the button "UP" , you will go up Ki floor,i.e,you will go to th

2013-11-27 20:31:25 965

原创 hdu1963Investment (完全背包)

Problem DescriptionJohn never knew he had a grand-uncle, until he received the notary’s letter. He learned that his late grand-uncle had gathered a lot of money, somewhere in South-America, and that

2013-11-26 20:49:00 1333

原创 hdu1864最大报销额 (01背包)

Problem Description现有一笔经费可以报销一定额度的发票。允许报销的发票类型包括买图书(A类)、文具(B类)、差旅(C类),要求每张发票的总额不得超过1000元,每张发票上,单项物品的价值不得超过600元。现请你编写程序,在给出的一堆发票中找出可以报销的、不超过给定额度的最大报销额。Input测试输入包含若干测试用例。每个测试用例的第1行包含两个正数 Q 和

2013-11-25 22:36:53 919

原创 hdu3466Proud Merchants (01背包,以q-p从小到大排序)

Problem DescriptionRecently, iSea went to an ancient country. For such a long time, it was the most wealthy and powerful kingdom in the world. As a result, the people in this country are still very

2013-11-25 20:47:50 956

原创 poj1700Crossing River(这过河真经典)

DescriptionA group of N people wishes to go across a river with only one boat, which can at most carry two persons. Therefore some sort of shuttle arrangement must be arranged in order to row the

2013-11-24 19:36:33 5320

原创 一定要用数组标记|xi-xj|,不然会超时

Problem Description给你N个整数,x1,x2...xn,任取两个整数组合得到|xi-xj|,(0现在请你计算第K大的组合数是哪个(一个组合数为第K大是指有K-1个不同的组合数小于它)。Input输入数据首先包含一个正整数C,表示包含C组测试用例.每组测试数据的第一行包含两个整数N,K。(1接下去一行包含N个整数,代表x1,x2..xn。(0

2013-11-24 15:56:09 2215

原创 hdu2199Can you solve this equation? (浮点型二分查找)

Problem DescriptionNow,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100;Now please try your lucky.InputThe first line of the input contai

2013-11-24 15:49:54 1117

原创 hdu2522A simple problem (求1/n的值,有循环结,输出循环结前面部分)

Problem DescriptionZty很痴迷数学问题.。一天,yifenfei出了个数学题想难倒他,让他回答1 / n。但Zty却回答不了^_^. 请大家编程帮助他.Input第一行整数T,表示测试组数。后面T行,每行一个整数 n (1Output输出1/n. (是循环小数的,只输出第一个循环节).Sample Input423

2013-11-23 18:31:34 1095

原创 hdu2141Can you find it?(二分查找)

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 numbers Ai, Bj, Ck, which satisfy the formula Ai+Bj+C

2013-11-23 18:26:06 1002

原创 hdu2955Robberies (01背包,反向思维)

Problem DescriptionThe aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because they become too greedy. He has decided to

2013-11-22 22:22:16 1083

原创 hdu2639Bone Collector II (01背包,求第k优解)

Problem DescriptionThe title of this problem is familiar,isn't it?yeah,if you had took part in the "Rookie Cup" competition,you must have seem this title.If you haven't seen it before,it doesn't mat

2013-11-21 21:44:43 1136

原创 hdu2602Bone Collector (简箪01背包)

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 , such as dog’s , cow’s , also he went to the grave

2013-11-20 21:06:10 1209

原创 hdu1171Big Event in HDU (多重背包)

Problem DescriptionNowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don't know that Computer College had ever been split into Computer College and Softwar

2013-11-20 20:21:34 1046

原创 hdu2546饭卡 (01背包)

Problem Description电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的余额,问最少可使卡上的余额为多少。Inp

2013-11-20 18:07:22 1103

原创 hdu1059Dividing(多重背包问题(模板)做的第一道背包题)

Problem DescriptionMarsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if all the m

2013-11-19 21:19:22 1374

原创 hdu2527Safe Or Unsafe (哈夫曼树)

Problem DescriptionJavac++ 一天在看计算机的书籍的时候,看到了一个有趣的东西!每一串字符都可以被编码成一些数字来储存信息,但是不同的编码方式得到的储存空间是不一样的!并且当储存空间大于一定的值的时候是不安全的!所以Javac++ 就想是否有一种方式是可以得到字符编码最小的空间值!显然这是可以的,因为书上有这一块内容--哈夫曼编码(Huffman Coding);一个字

2013-11-16 22:58:35 1439

原创 zoj3622Magic Number

A positive number y is called magic number if for every positive integerx it satisfies that put y to the right of x, which will form a new integerz, z mod y = 0.InputThe input has multiple cas

2013-11-16 20:09:50 1009

原创 求最长公共子序列(不连续)求相似度

转移方程:if(s1[i]==s2[j])c[i][j]=c[i-1][j-1]+1; else c[i][j]=max(c[i-1][j],c[i][j-1]);#include#includeint main(){ int c[100][100]; char str1[100],str2[100]; while(scanf("%s %s",str1,str2)

2013-11-15 21:58:38 1148

原创 hdu2058The sum problem

Problem DescriptionGiven a sequence 1,2,3,......N, your job is to calculate all the possible sub-sequences that the sum of the sub-sequence is M.InputInput contains multiple test cases. each

2013-11-14 21:47:37 2203

原创 hdu2079选课时间(题目已修改,注意读题)

Problem Description又到了选课的时间了,xhd看着选课表发呆,为了想让下一学期好过点,他想知道学n个学分共有多少组合。你来帮帮他吧。(xhd认为一样学分的课没区别)Input输入数据的第一行是一个数据T,表示有T组数据。每组数据的第一行是两个整数n(1 接着有k行,每行有两个整数a(1 Output对于每组输入数据,输出一个整数

2013-11-14 17:57:54 993

原创 hdu2068RPG的错排

Problem Description今年暑假杭电ACM集训队第一次组成女生队,其中有一队叫RPG,但做为集训队成员之一的野骆驼竟然不知道RPG三个人具体是谁谁。RPG给他机会让他猜猜,第一次猜:R是公主,P是草儿,G是月野兔;第二次猜:R是草儿,P是月野兔,G是公主;第三次猜:R是草儿,P是公主,G是月野兔;......可怜的野骆驼第六次终于把RPG分清楚了。由于RPG的带动,做ACM的女生

2013-11-14 16:03:48 941

原创 hdu3397Sequence operation(线段树,段异或,段覆盖,段查找)

lxhgww got a sequence contains n characters which are all '0's or '1's.We have five operations here:Change operations:0 a b change all characters into '0's in [a , b]1 a b change all character

2013-11-12 18:14:57 1337

原创 hdu2181哈密顿绕行世界问题(DFS)

Problem Description一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。Input前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m=1.m=0退出.Output输出从第m个城市出发经过每个城市1次又回到m的所有路线,如有多条路

2013-11-09 20:57:43 953

原创 hdu4533约会安排 (线段树,段更新,与求最长连续升序子序列的题很类似)

Problem Description  寒假来了,又到了小明和女神们约会的季节。  小明虽为屌丝级码农,但非常活跃,女神们常常在小明网上的大段发言后热情回复“呵呵”,所以,小明的最爱就是和女神们约会。与此同时,也有很多基友找他开黑,由于数量实在过于巨大,怎么安排时间便成了小明的一大心事。  我们已知小明一共有T的空闲时间,期间会有很多女神或者基友来找小明。  作为一个操作系统曾经

2013-11-07 18:14:27 1145

原创 hdu1541Stars (线段树,二维变一维)

Problem DescriptionAstronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars tha

2013-11-06 17:27:39 1000

原创 hdu3577Fast Arrangement (线段树+离散化,记录最大值的变形)

Problem DescriptionChinese always have the railway tickets problem because of its' huge amount of passangers and stations. Now goverment need you to develop a new tickets query system.One train ca

2013-11-04 17:21:37 954

原创 hdu1540Tunnel Warfare (线段树,单点更新)

Problem DescriptionDuring the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Generally speaking, villages connected by tunnels la

2013-11-02 17:11:00 1536

代码行数统计工具

代码统计工具,在上面你可以选择一个代码文件夹,然后再进行代码统计,就可以知道你以前写过的所有代码,一共有多少行代码

2014-04-04

刘汝佳的黑书

黑书对于每个编程人员来讲,都是有必要去看的,里面的很多算法都是非常的红典,从中可以学到很多我们在书本上学不到的东西!

2014-04-04

背包九讲算法

背包九讲里面讲述了九种不同的背包类型,对于想学背包的人来说,这是一个不错的选择!

2014-04-04

C++写程序时用到的库函数

C++库函数里面描术了很多函数的名字和相应的功能,在写程序时可以很方便的进行调用!

2014-04-04

汇编DOS-MASM615

汇编安装包:如果想写汇编程序时,先安装些包,然后就可以在DOS下编程

2014-04-04

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除