- 博客(22)
- 资源 (6)
- 问答 (1)
- 收藏
- 关注
原创 各种排序模板
#include #include typedef int InfoType;#define n 10 //假设的文件长度,即待排序的记录数目typedef int KeyType; //假设的关键字类型typedef struct { //记录类型 KeyType key; //关键字项 InfoType otherinfo; //其它数据项,类型Info
2013-12-25 18:54:45 1352
原创 fzu 2150 Fire Game(BFS)
Problem DescriptionFat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of this board is consisting of grass or just em
2013-12-22 17:32:38 3904
原创 快速排序模板
#includevoid xchg(int &b,int &c){ int t; t=b; b=c; c=t;}int findpoit(int *a,int l,int r){ int p=l; while(l<r) { while(a[r]>=a[p]&&p<r)r--; xchg(a[r],a[p]); while(a[l]<=a
2013-12-20 16:16:25 980
原创 hdu3033I love sneakers! (分组背包,错了很多次)
Problem DescriptionAfter months of hard working, Iserlohn finally wins awesome amount of scholarship. As a great zealot of sneakers, he decides to spend all his money on them in a sneaker store.
2013-12-19 23:17:09 1004
原创 hdu1712ACboy needs your help(分组背包)
Problem DescriptionACboy has N courses this term, and he plans to spend at most M days on study.Of course,the profit he will gain from different course depending on the days he spend on it.How to ar
2013-12-19 17:18:55 821
原创 hdu2191悼念512汶川大地震遇难同胞——珍惜现在,感恩生活(多重背包)
Problem Description急!灾区的食物依然短缺!为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。请问:你用有限的资金最多能采购多少公斤粮食呢?后记:人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。月有阴晴圆缺
2013-12-18 18:26:02 908
原创 hdu1114Piggy-Bank (完全背包)
Problem DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The
2013-12-18 17:56:53 1026
原创 poj3181Dollar Dayz(完全背包+记录组合种数+高精度)
DescriptionFarmer John goes to Dollar Days at The Cow Store and discovers an unlimited number of tools on sale. During his first visit, the tools are selling variously for $1, $2, and $3. Farmer J
2013-12-17 16:42:47 1119
原创 hdu2126Buy the souvenirs (01背包+记录路径的种数)
Problem DescriptionWhen the winter holiday comes, a lot of people will have a trip. Generally, there are a lot of souvenirs to sell, and sometimes the travelers will buy some ones with pleasure. Not
2013-12-16 20:31:37 1170
原创 poj3624Charm Bracelet(01背包)
DescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from the N (1 ≤ N ≤ 3,402) available charms. Each
2013-12-16 16:18:33 828
原创 hdu2629Identity Card
Problem DescriptionDo you own an ID card?You must have a identity card number in your family's Household Register. From the ID card you can get specific personal information of everyone. The number
2013-12-15 22:58:05 3126
原创 hdu2289Cup(神坑题,精度+二分,以半径二分不能过,以高度为二分就过了)
Problem DescriptionThe WHU ACM Team has a big cup, with which every member drinks water. Now, we know the volume of the water in the cup, can you tell us it height?The radius of the cup's top
2013-12-15 22:52:50 1024
原创 hdu1142A Walk Through the Forest(spfa+dfs+标记,题目意思要注意)
Problem DescriptionJimmy experiences a lot of stress at work these days, especially since his accident made working difficult. To relax after a hard day, he likes to walk home. To make things even n
2013-12-13 18:32:02 1516
原创 堆排序
#includeint dui[1000],n;void xchg(int &a,int &b){ int t; t=a;a=b;b=t;}void duisort(int k){ if(k*2+1>n){ if(k*2<=n&&dui[k*2]<dui[k]) xchg(dui[k*2],dui[k]); return ; }
2013-12-13 16:25:42 761
原创 hdu3339In Action(经典,最短路+01背包)
Problem DescriptionSince 1945, when the first nuclear bomb was exploded by the Manhattan Project team in the US, the number of nuclear weapons have soared across the globe.Nowadays,the crazy boy
2013-12-12 17:56:24 1247
原创 poj3080Blue Jeans(在m个串中找到这m个串的 最长连续公共子序列)
DescriptionThe Genographic Project is a research partnership between IBM and The National Geographic Society that is analyzing DNA from hundreds of thousands of contributors to map how the Earth w
2013-12-10 22:27:47 1173
原创 平方数(每一个数都可以用几个平方数组成)
费马四平方数猜想指出,任意自然数都可以分解成不超过四个完全平方数的和。例如:144 = 122 ,14 = 12 + 22 + 32。现在给出自然数N(N ≤ 60000),_gXX希望知道N最少可以分解成多少个完全平方数。Input输入文件包含多组数据。第一行,一个整数T(T ≤ 10000),表示数据的组数。第
2013-12-10 16:49:45 4539
原创 poj2531Network Saboteur(DFS,注要是题目难明)
DescriptionA university network is composed of N computers. System administrators gathered information on the traffic between nodes, and carefully divided the network into two subnetworks in order
2013-12-10 13:09:05 1053
原创 hdu1317XYZZY (SPFA处理 有环的情况)
Problem DescriptionIt has recently been discovered how to run open-source software on the Y-Crate gaming device. A number of enterprising designers have developed Advent-style games for deployment o
2013-12-07 00:08:23 2036
原创 poj1782Run Length Encoding(题目难以看懂,也有一些坑)
DescriptionYour task is to write a program that performs a simple form of run-length encoding, as described by the rules below. Any sequence of between 2 to 9 identical characters is encoded b
2013-12-01 17:54:19 1583
原创 uestc1732欢乐到端午&&poj1664(递推)
Description每到端午,beap总要和父母一起包粽子,经过两年的ACM训练,beap总会突发奇想,自己想出一些题目来。因此当他准备把包好粽子放到盘子里的时候,他突然回忆起一个很经典的题目:n个相同的粽子放到m个相同的盘子里(允许盘子为空),有多少种方法呢?(也就是说1,2,1与1,1,2是属于相同的放法)由于上次遇到这个经典问题都不知道是什么时候,beap已经不知道该如何来
2013-12-01 12:19:49 1112
原创 poj1664放苹果(dfs与递推,两种方法)
Description把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。Input第一行是测试数据的数目t(0 Output对输入的每组数据M和N,用一行输出相应的K。Sample Input17 3Sample Output8解题:由题可知,每个盘子都一样,
2013-12-01 00:46:25 2062
TA创建的收藏夹 TA关注的收藏夹
TA关注的人