摘要:
#includetypedef struct{ int adj;//某定点与已构造好的部分生成树的顶点之间权值最小的顶点 int lowcost;//某定点与已构造好的部分生成树的顶点之间的最小权值}point;point close[101];//辅助数组int d[101][101];int main(){ int n,i,a,b,sum,j,min,k,m; while(scanf("%d",&n)!=EOF) { if(n==0) break; sum=0;//记录最小生成树的总路径 m=n*(n-1)/2; ... 阅读全文
摘要:
Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now.The game can be played by two or more than two players. It consists of a chessboard(棋盘)and some 阅读全文
摘要:
Problem DescriptionThe highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, and 4 seconds to move down one floor. The 阅读全文
摘要:
Problem DescriptionBoudreaux and Thibodeaux are on the road again . . ."Boudreaux, we have to get this shipment of mudbugs to Baton Rouge by tonight!""Don't worry, Thibodeaux, I already checked ahead. There are three underpasses and our 18-wheeler will fit through all of them, so 阅读全文
摘要:
Problem Description2100年,科学家们登上月球,在那里建造了很多城镇,并且大部分建在了空中,但还没有铺设道路,无法满足人们的生活需要。为了尽快完成铺设道路任务,他们必须找出一种总路程最短的方案使每个城镇之间都相互可达(并不要求直接可达,通过其它城镇中转也可)。你知道他们方案的总路程数吗?Input第一行是一个正整数T,代表数据的组数,每组数据第一行是一个正整数N,代表有N个城镇,接下来N行每行三个正整数xi,yi,zi代表第i个城镇的坐标。(1#includetypedef struct{ int adj;//记录已构造的生成树的顶点 double lowcos... 阅读全文
摘要:
Problem Description大武汉一直流传着这样一个传说:玩在武大,学在华科,爱在华师,吃在湖工。。。大武汉有N所高校,现在打算在他们之间建立一个局域网,使它们之间能够相互连通。但是铺网线是要钱的。。。怎样才能找到一个最省钱的方法呢。Input输入包含多组测试数据第一行给出学校的数目N,(3 int a[111][111];typedef struct{ int adj;//保存符合要求的点 int lowcost;//某顶点与已构造好的部分生成树的顶点之间的最小权值}closeedge;//辅助结构体closeedge close[111];//辅助数组int main... 阅读全文
摘要:
Problem DescriptionThere must be many A + B problems in our HDOJ , now a new one is coming.Give you two hexadecimal integers , your task is to calculate the sum of them,and print it in hexadecimal too.Easy ? AC it !InputThe input contains several test cases, please process to the end of the file.Eac 阅读全文
摘要:
DescriptionAn earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all computers in the network were all broken. The computers are repaired one by one, and the network gradually 阅读全文
摘要:
Problem DescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are given a number, you have to determine the number of digits in the factorial of the number.InputInput c 阅读全文
摘要:
Problem Description约19世纪末,在欧州的商店中出售一种智力玩具,在一块铜板上有三根杆,最左边的杆上自上而下、由小到大顺序串着由64个圆盘构成的塔。目的是将最左边杆上的盘全部移到右边的杆上,条件是一次只能移动一个盘,且不允许大盘放在小盘的上面。现在我们改变游戏的玩法,不允许直接从最左(右)边移到最右(左)边(每次移动一定是移到中间杆或从中间移出),也不允许大盘放到下盘的上面。Daisy已经做过原来的汉诺塔问题和汉诺塔II,但碰到这个问题时,她想了很久都不能解决,现在请你帮助她。现在有N个圆盘,她至少多少次移动才能把这些圆盘从最左边移到最右边?Input包含多组数据,每次输入一 阅读全文