
ACM
huasonl88
这个作者很懒,什么都没留下…
展开
-
1076穿越沙漠问题
//倒推法:穿越沙漠问题#include#includeusing namespace std;int main(){ int dis,k,oil;//dis表示距终点的距离,1000-dis则表示距起点的距离,k表示储油点从后到前的序号 dis=500;k=1;oil=500; do { print("storepoint",k,"distance",1000-dis,"oilquantity原创 2009-07-27 11:13:00 · 2794 阅读 · 2 评论 -
1490 五子棋
五子棋是起源于中国古代的传统黑白棋种之一。现代五子棋日文称之为"连珠",音译为"Renju",英文称之为"Gobang"或"FIR"(Five in a Row的缩写),亦有"连五子"、"五子连"、"串珠"、"五目"、"五目碰"、"五格"等多种称谓。其规则简单,在15*15的棋盘上黑棋先行,其中一方有五枚棋子连成一线即可获胜(这里不考虑专业比赛中的禁手等规则)。不过在很多情况下,当一方出现“活原创 2009-08-12 08:53:00 · 891 阅读 · 0 评论 -
hdu acm 2100 Lovekey
Problem DescriptionXYZ-26进制数是一个每位都是大写字母的数字。 A、B、C、…、X、Y、Z 分别依次代表一个0 ~ 25 的数字,一个 n 位的26进制数转化成是10进制的规则如下A0A1A2A3…An-1 的每一位代表的数字为a0a1a2a3…an-1 ,则该XYZ-26进制数的10进制值就为 m = a0 * 26^(n-1) + a1 * 26^(n-2) + …原创 2009-08-09 21:45:00 · 1066 阅读 · 0 评论 -
hdu acm 1907 John(涉及到博弈论)
Problem DescriptionLittle John is playing very funny game with his younger brother. There is one big box filled with M&Ms of different colors. At first John has to eat several M&Ms of the same color原创 2009-08-13 09:55:00 · 1896 阅读 · 0 评论 -
acm hdu 1908 Double Queue
Problem DescriptionThe new founded Balkan Investment Group Bank (BIG-Bank) opened a new office in Bucharest, equipped with a modern computing environment provided by IBM Romania, and using modern in原创 2009-08-13 20:28:00 · 1041 阅读 · 0 评论 -
hdu acm 1913 Computers
Problem DescriptionEverybody is fond of computers, but buying a new one is always a money challenge. Fortunately, there is always a convenient way to deal with. You can replace your computer and get原创 2009-08-14 11:37:00 · 723 阅读 · 1 评论 -
fzu acm 1015 土地划分
在Dukeswood这块土地上生活着一个富有的农庄主和他的几个孩子。在他临终时,他想把他的土地分给他的孩子。他有许多农场,每个农场都是一块矩形土地。他在农场地图上划上一些直线将矩形分成若干块。当他划直线时,他总是从矩形边界上的某一点划到另一个矩形边界上的点,这条线的结束点将成为下一条线的起始点。他划线时从不会让任三线共点。例如图1是某一种划分结果。 图1 划分的起始点和结束点均以五原创 2009-08-17 11:38:00 · 2064 阅读 · 1 评论 -
acm hdu 1102 Constructing Roads(kruskal)
http://acm.hdu.edu.cn/showproblem.php?pid=1102 这题折磨了我好久,从上午一直搞到晚上,真是惭愧啊!我也不知道该说些什么了……我知道这题用prim算法是可以的,写起来也简单,只是我自己一直在用kruskal算法,不过对kruskal算法也是有了进一步的理解……应该还是值得的~ #include#includeusing n原创 2009-08-19 20:40:00 · 1009 阅读 · 0 评论 -
acm hdu 3007 Buried memory
http://acm.hdu.edu.cn/showproblem.php?pid=3007 这题对我来说真的是在考验我的英语水平,说真的要不是问了下旁边的还不知道要干嘛? 我也在抱怨为什么自己英文题目都是很难看懂,看来能不能很好的看懂英文题目还是个难关。 可能自己还没有真正的掌握看题的技巧……这题的大意可以理解成有个导弹飞过这些点的范围,要求落在哪个位置可以把所有点原创 2009-08-20 16:26:00 · 1391 阅读 · 1 评论 -
acm hdu 1875 畅通工程再续
http://acm.hdu.edu.cn/showproblem.php?pid=1875 这题与hdu的1102很类似,可以参考下,我都是用同样的方法,用到并查集的知识。理解了并查集做这题就不是很难了,当然同样可以用prim算法…… #include#include#includeusing namespace std;const int MAX=原创 2009-08-24 08:37:00 · 1218 阅读 · 0 评论 -
1046 Tempter of the Bone
The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He realized that the bone转载 2009-08-10 19:28:00 · 2678 阅读 · 0 评论 -
hdu acm 2106 decimal system
Problem DescriptionAs we know , we always use the decimal system in our common life, even using the computer. If we want to calculate the value that 3 plus 9, we just import 3 and 9.after calculatio原创 2009-08-09 19:19:00 · 1591 阅读 · 1 评论 -
hdu acm 2103 Family planning
Problem DescriptionAs far as we known,there are so many people in this world,expecially in china.But many people like LJ always insist on that more people more power.And he often says he will burn a原创 2009-08-09 15:20:00 · 1089 阅读 · 0 评论 -
1339 表达式求值(+ - * / )
//表达式求值#include#include#include#include#includeusing namespace std;bool priority(char a,char b){ int m,n; switch(a) //栈外优先级 { case (: return true; case +: case -: m原创 2009-07-30 21:29:00 · 955 阅读 · 0 评论 -
1019猫捉老鼠
#include #include#include using namespace std; int main() { // freopen("e://1019.txt","r",stdin);//把已有的测试数据放到txt文档里来读入测试。 int sum,i,j,k,m,n,e,f; long int time; char a[12][1原创 2009-07-31 22:08:00 · 650 阅读 · 0 评论 -
1012 求小于n的数里,与n互为素数的个数
///求小于n的数里,与n互为素数的个数,这边用到欧拉公式。#include#includeusing namespace std;int main(){ long n,i; double sum; while(scanf("%ld",&n)&&n) { sum=n; if(n%2==0)// { sum*=(double)1/2;原创 2009-08-03 17:07:00 · 940 阅读 · 0 评论 -
1656 How many different numbers
Recently oaiei has encountered a problem. And he needs your help. There are N numbers in an array and Q queries. For each query, there are two integers S and T. And the proplem is that there are how m原创 2009-08-03 17:30:00 · 532 阅读 · 0 评论 -
1635 floyd 的应用
A group of commandos were assigned a critical task. They are to destroy an enemy head quarter. The enemy head quarter consists of several buildings and the buildings are connected by roads. The comman原创 2009-08-02 18:33:00 · 425 阅读 · 0 评论 -
1701 math
我们知道求两个数最大公约数的一种方法叫辗转相除法。并且当两个数的最大公约数为1时,我们就称这两个数互质。cxw喜欢数学,现在他遇到一个问题正准备向数学大牛daxia请教:“给定一个正整数n,在所有小于n的正整数中,求与n的最大公约数为d的所有的数的和.”,你能帮他解决这个问题吗? Input有多组输入数据,每组数据有两个正整数n,d. 其中1数据保证n能被d整除. Output对于原创 2009-08-06 09:35:00 · 566 阅读 · 0 评论 -
1096 prim 最小生成数
In the planet w-503 of galaxy cgb, there is a kind of intelligent creature named QS. QScommunicate with each other via networks. If two QS want to get connected, they need to buy two network adapters原创 2009-08-07 09:54:00 · 710 阅读 · 0 评论 -
hdu acm 2104 hide handkerchief
Problem DescriptionThe Children’s Day has passed for some days .Has you remembered something happened at your childhood? I remembered I often played a game called hide handkerchief with my friends.N原创 2009-08-10 20:41:00 · 1258 阅读 · 0 评论 -
1436 Renting Boats(floyd,Dijkstra应用)
Problem DescriptionYangtse Rive Barge Club has set up n barge hiring stops numbered 1, 2, … , n along the Changjiang River. Passengers can hire barges from any of these stops, and return the barges原创 2009-08-07 19:41:00 · 816 阅读 · 0 评论 -
hdu 部分题目分类
1002 简单的大数 1003 DP经典问题,最大连续子段和 1004 简单题 1005 找规律(循环点) 1006 感觉有点BT的题,我到现在还没过 1007 经典问题,最近点对问题,用分治 1008 简单题 1009 贪心 1010 搜索题,剪枝很关键 1011原创 2010-01-01 12:04:00 · 756 阅读 · 0 评论