- 博客(34)
- 资源 (4)
- 问答 (1)
- 收藏
- 关注
原创 hdu-2546 饭卡
http://acm.hdu.edu.cn/showproblem.php?pid=2540-1背包问题代码:#include#include#includeusing namespace std;int cmp(int a,int b){ return a<b;}int main(){ int n; int price[1200],dp[1200]; int i,j,k,
2014-11-29 21:55:51 601
原创 nyoj-722 数独
正好我现在在玩数独这个游戏,看到这个问题我就来了兴趣,完成着这个问题,妈妈再也不用担心我玩数独游戏啦~~题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=722#includeint map[9][9];int flag;int deal(int a,int b,int x){ int i,j; for(i=0;i<9;i
2014-11-29 21:27:11 876 2
原创 hdu-1010 Tempter of the Bone 简单的搜索
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1010做这道题目的时候需要注意剪枝,如果没有剪枝的话,就会超时注意奇偶剪枝代码:】#include#include#includechar map[20][20];int top[4][2]={{0,1},{0,-1},{1,0},{-1,0}};int sx,sy,ex,ey,t
2014-11-29 11:00:31 584
原创 nyoj-58 最少步数 搜索
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=58比较简单的搜索题目,代码:#include#includeint map[9][9]={{1,1,1,1,1,1,1,1,1},{1,0,0,1,0,0,1,0,1}, {1,0,0,1,1,0,0,0,1},{1,0,1,0,1,1,0,1,1},
2014-11-29 10:51:38 650
原创 hdu-2152 Fruit
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2152母函数:代码:#include#includeint main(){ int c1[120],c2[120],min[120],max[120]; int i,j,k,t,n,m; while(~scanf("%d%d",&n,&m)){ memset(c1,0,sizeof(c
2014-11-26 22:37:23 515
原创 hdu-1864 最大报销额
简单的背包题 ;好无奈,我又没做出来在考试的时候代码:#include#include#includeusing namespace std;double dp[60],money[60];double total;int num,i,j,n,k,t;double max(double a,double b){ return a>b?a:b;}int main(){ in
2014-11-26 13:18:41 712
原创 hdu-1241 Oil Deposits
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1241
2014-11-25 11:39:53 498
原创 hdu-1902 The Dragon of Loowater
Problem DescriptionOnce upon a time, in the Kingdom of Loowater, a minor nuisance turned into a major problem.The shores of Rellau Creek in central Loowater had always been a prime breeding grou
2014-11-22 21:39:30 583
原创 hdu-1016 Prime Ring Problem 搜索题
Problem DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.
2014-11-22 10:41:26 508
原创 hdu 1003 Max Sum
Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 +
2014-11-21 21:05:03 1331
原创 nyoj 791 Color the fence
描述Tom has fallen in love with Mary. Now Tom wants to show his love and write a number on the fence opposite to Mary’s house. Tom thinks that the larger the numbers is, the more chance to win Mar
2014-11-20 15:48:25 593
原创 hdu nyoj 220 推桌子
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=220贪心算法主要是
2014-11-20 13:57:39 559
原创 nyoj 364 田忌赛马
描述Here is a famous story in Chinese history."That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king and others.""Bo
2014-11-18 22:29:55 606
原创 nyoj Radar
描述Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, locating o
2014-11-17 21:47:33 451
原创 hdu-2544 最短路 弗洛伊德算法
Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗? Input输入包括多组数据。每组数据第一行是两个整数N、M(N输入保证至少存在1条商店到赛场的路线。 O
2014-11-17 14:12:00 903
原创 hdu-1312 Red and Black
Problem DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjace
2014-11-16 16:13:05 428
原创 hdu-1166 敌兵布阵
Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。
2014-11-14 23:50:19 543
原创 hdu -1302 The Snail
Problem DescriptionA snail is at the bottom of a 6-foot well and wants to climb to the top. The snail can climb 3 feet while the sun is up, but slides down 1 foot at night while sleeping. The snail
2014-11-13 12:21:15 501
原创 hdu -3502 Calculation 2
Problem DescriptionGiven a positive integer N, your task is to calculate the sum of the positive integers less than N which are not coprime to N. A is said to be coprime to B if A, B share no common
2014-11-12 22:22:34 662
原创 hdu- 1028 Ignatius and the Princess III
Problem Description"Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says."The second problem is, given an positive integer N, we define an
2014-11-10 20:50:03 428
原创 hdu- 2602 Bone Collector
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
2014-11-09 22:45:21 343
转载 背包问题详解(转)
背包问题是在1978年由Merkel和Hellman提出的。它的主要思路是假定某人拥有大量物品,重量各不同。此人通过秘密地选择一部分物品并将它们放 到背包中来加密消息。背包中的物品中重量是公开的,所有可能的物品也是公开的,但背包中的物品是保密的。附加一定的限制条件,给出重量,而要列出可能的物品,在计算上是不可实现的。背包问题是熟知的不可计算问题,背包体制以其加密,解密速度快而其人注目。但是,大多数
2014-11-09 22:33:15 636
原创 hdu 1060 Leftmost Digit
Problem DescriptionGiven a positive integer N, you should output the leftmost digit of N^N. InputThe input contains several test cases. The first line of the input is a single integer T wh
2014-11-08 23:35:58 475
原创 hdu-2054 A == B ?
Problem DescriptionGive you two numbers A and B, if A is equal to B, you should print "YES", or print "NO". Inputeach test case contains two numbers A and B. Outputfor each case, i
2014-11-08 22:29:41 578
原创 hdu 1237 简单计算器
Problem Description读入一个只包含 +, -, *, / 的非负整数计算表达式,计算该表达式的值。 Input测试输入包含若干测试用例,每个测试用例占一行,每行不超过200个字符,整数和运算符之间用一个空格分隔。没有非法表达式。当一行中只有0时输入结束,相应的结果不要输出。 Output对每个测试用例输出1行,即该表达式的值,精确到小数
2014-11-07 21:42:04 620
原创 1598 find the most comfortable road
Problem DescriptionXX星有许多城市,城市之间通过一种奇怪的高速公路SARS(Super Air Roam Structure---超级空中漫游结构)进行交流,每条SARS都对行驶在上面的Flycar限制了固定的Speed,同时XX星人对 Flycar的“舒适度”有特殊要求,即乘坐过程中最高速度与最低速度的差越小乘坐越舒服 ,(理解为SARS的限速要求,flycar必须瞬间提
2014-11-07 20:32:43 443
原创 hdu-5011 Game
Problem DescriptionHere is a game for two players. The rule of the game is described below:● In the beginning of the game, there are a lot of piles of beads.● Players take turns to play. E
2014-11-05 21:59:47 478
原创 hdu-1518 Square
SquareTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8922 Accepted Submission(s): 2903Problem DescriptionGiven a set of sticks
2014-11-05 19:50:59 482
原创 hdu-1257
NEW~ 关于举办计算机学院大学生程序设计竞赛(2014'11)的报名通知最少拦截系统Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 19447 Accepted Submission(s): 7725
2014-11-04 15:52:36 803
原创 hdu-5018
Revenge of FibonacciTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 703 Accepted Submission(s): 327Problem DescriptionIn mathemat
2014-11-03 21:04:57 420
原创 nyoj-891
找点时间限制:2000 ms | 内存限制:65535 KB难度:2描述上数学课时,老师给了LYH一些闭区间,让他取尽量少的点,使得每个闭区间内至少有一个点。但是这几天LYH太忙了,你们帮帮他吗?输入多组测试数据。每组数据先输入一个N,表示有N个闭区间(N≤100)。接下来N行,每行输入两个数a,b(0≤a≤b≤100),表示区间的两
2014-11-02 08:59:25 719
原创 nyoj915
+-字符串时间限制:1000 ms | 内存限制:65535 KB难度:1描述Shiva得到了两个只有加号和减号的字符串,字串长度相同。Shiva一次可以把一个加号和它相邻的减号交换。他想知道最少需要多少次操作才能把第一个字符串变换成第二个字符串。你现在要去帮助他完成那个这个问题。输入多组测试数据每组数据有两行,每行包含一个由”+”和”-“最
2014-11-01 21:26:23 728
原创 nyoj47
过河问题时间限制:1000 ms | 内存限制:65535 KB难度:5描述在漆黑的夜里,N位旅行者来到了一座狭窄而且没有护栏的桥边。如果不借助手电筒的话,大家是无论如何也不敢过桥去的。不幸的是,N个人一共只带了一只手电筒,而桥窄得只够让两个人同时过。如果各自单独过桥的话,N人所需要的时间已知;而如果两人同时过桥,所需要的时间就是走得比较慢的那个人单独行
2014-11-01 18:49:10 483
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人