jueseqiuyuan

2011年3月21日

POJ 1062 昂贵的聘礼 (dijkstra+枚举)

摘要: 昂贵的聘礼Time Limit:1000MSMemory Limit:10000KTotal Submissions:18655Accepted:4993Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄,我可以只要8000金币。如果你能够弄来他的水晶球,那么只要5000金币就行了。"探险家就跑到大祭司那里,向他要求皮袄或水晶球,大祭司要他用金币来换,或者替他弄来其他的东西,他可 阅读全文

posted @ 2011-03-21 20:26 jueseqiuyuan 阅读(197) 评论(0) 推荐(0)

2011年3月12日

POJ 2488 A Knight's Journey DFS

摘要: A Knight's JourneyTime Limit:1000MSMemory Limit:65536KTotal Submissions:13499Accepted:4487DescriptionBackgroundThe knight is getting bored of seeing the same black and white squares again and again and has decided to make a journeyaround the world. Whenever a knight moves, it is two squares in o 阅读全文

posted @ 2011-03-12 15:27 jueseqiuyuan 阅读(186) 评论(0) 推荐(0)
HDU I 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.There are several brands of sneakers that Iserlohn wants to collect, such as Air Jordan and Nike Pro. And 阅读全文

posted @ 2011-03-12 14:43 jueseqiuyuan 阅读(353) 评论(0) 推荐(0)
HDU ACboy 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 arrange the M days for the N courses to maximize the profit?InputThe input consists of multiple data set 阅读全文

posted @ 2011-03-12 13:02 jueseqiuyuan 阅读(257) 评论(0) 推荐(0)

2011年3月11日

HDU FATE 二维背包

摘要: FATETime Limit : 2000/1000ms (Java/Other)Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 209Accepted Submission(s) : 113Font:Times New Roman|Verdana|GeorgiaFont Size:←→Problem Description最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的 阅读全文

posted @ 2011-03-11 22:01 jueseqiuyuan 阅读(349) 评论(0) 推荐(0)

2011年3月10日

HDOJ 1003 I NEED A OFFER! 背包乘法

摘要: I NEED A OFFER!Time Limit : 2000/1000ms (Java/Other)Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 354Accepted Submission(s) : 150Font:Times New Roman|Verdana|GeorgiaFont Size:←→Problem DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的 阅读全文

posted @ 2011-03-10 12:02 jueseqiuyuan 阅读(177) 评论(0) 推荐(0)

2011年3月9日

POJ 2063 Investment 完全背包问题

摘要: InvestmentTime Limit:1000MSMemory Limit:30000KTotal Submissions:2775Accepted:1048DescriptionJohn 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 John was the only inheri 阅读全文

posted @ 2011-03-09 19:05 jueseqiuyuan 阅读(344) 评论(0) 推荐(0)

2011年3月7日

POJ 2533 Longest Ordered Subsequence

摘要: #include<stdio.h>#define MAX 1005int value[MAX];//记录原始数组 int opt[MAX+1];//记录长度为k的最长递增序列的结尾元素,下标从1开始 //int len[MAX];//记录以value[k]结尾的最长递增子序列的长度 int binary_search(const int opt[],const int size,const int value) { int left=1; int right=size; int mid; while(left<=right) { mid=(left+right)>> 阅读全文

posted @ 2011-03-07 15:02 jueseqiuyuan 阅读(179) 评论(0) 推荐(0)

2011年3月5日

HDOJ 1466 计算直线的交点数

摘要: Problem Description平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。比如,如果n=2,则可能的交点数量为0(平行)或者1(不平行)。Input输入数据包含多个测试实例,每个测试实例占一行,每行包含一个正整数n(n<=20),n表示直线的数量.Output每个测试实例对应一行输出,从小到大列出所有相交方案,其中每个数为可能的交点数,每行的整数之间用一个空格隔开。Sample Input23Sample Output0 10 2 3#include<stdio.h>#include<string.h>int main(){ int i 阅读全文

posted @ 2011-03-05 21:56 jueseqiuyuan 阅读(243) 评论(0) 推荐(0)

2011年3月4日

POJ 1703 Find them, Catch them

摘要: Find them, Catch themTime Limit:1000MSMemory Limit:10000KTotal Submissions:15690Accepted:4614DescriptionThe police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Gang Snake. However, the police first needs to identify whi 阅读全文

posted @ 2011-03-04 12:46 jueseqiuyuan 阅读(164) 评论(0) 推荐(0)