- 博客(72)
- 资源 (28)
- 收藏
- 关注
原创 hdu 1788 Chinese remainder theorem again 最小公倍数
Problem Description我知道部分同学最近在看中国剩余定理,就这个定理本身,还是比较简单的:假设m1,m2,…,mk两两互素,则下面同余方程组:x≡a1(mod m1)x≡a2(mod m2)…x≡ak(mod mk)在0<=<m1m2…mk内有唯一解。记Mi=M/mi(1<=i<=k),因为(Mi,mi)=1,故有二个整数pi,qi满足Mipi+miqi=1,如果记ei=Mi/pi,那么会有:ei≡0(mod mj),j!=iei≡1(mod mj),j=i很显然,e1
2015-03-31 18:58:36 937
原创 hdu 1576 A/B 欧几里德算法的扩展
Problem Description要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。 Input数据的第一行是一个T,表示有T组数据。每组数据有两个数n(0 <= n < 9973)和B(1 <= B <= 10^9)。 Output对应每组数据输出(A/B)%9973。
2015-03-31 18:03:10 845
原创 hdu 1237 简单计算器 逆波兰~~
简单计算器Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13852 Accepted Submission(s): 4613Problem Description读入一个只包含 +, -, *, / 的非负整
2015-03-31 12:37:20 914
原创 hdu 1546 Idiomatic Phrases Game 最短路
Problem DescriptionTom is playing a game called Idiomatic Phrases Game. An idiom consists of several Chinese characters and has a certain meaning. This game will give Tom two idioms. He should build a list of idioms and the list starts and ends with the t
2015-03-30 21:44:22 735
原创 hdu 1760 A New Tetris Game 博弈~~搜索求sg函数
Problem Description曾经,Lele和他姐姐最喜欢,玩得最久的游戏就是俄罗斯方块(Tetris)了。渐渐得,Lele发觉,玩这个游戏只需要手快而已,几乎不用经过大脑思考。所以,Lele想出一个新的玩法。Lele和姐姐先拿出一块长方形的棋盘,这个棋盘有些格子是不可用的,剩下的都是可用的。Lele和姐姐拿出俄罗斯方块里的正方形方块(大小为2*2的正方形方块)轮流往棋盘里放,要注意的是,放进去的正方形方块不能叠在棋盘不可用的格子上,也不能叠在已经放了的正方形方块上。到最后,谁不能再放正
2015-03-30 16:04:12 1011
原创 hdu1851 A Simple Game bash博弈+Nim博弈
Problem DescriptionAgrael likes play a simple game with his friend Animal during the classes. In this Game there are n piles of stones numbered from 1 to n, the 1st pile has M1 stones, the 2nd pile has M2 stones, ... and the n-th pile contain Mn stones. A
2015-03-30 15:13:53 1239
原创 hdu 1730 Northcott Game Nim博弈~~
Tom和Jerry正在玩一种Northcott游戏,可是Tom老是输,因此他怀疑这个游戏是不是有某种必胜策略,郁闷的Tom现在向你求救了,你能帮帮他么?游戏规则是这样的: 如图所示,游戏在一个n行m列(1 ≤ n ≤ 1000且2 ≤ m ≤ 100)的棋盘上进行,每行有一个黑子(黑方)和一个白子(白方)。执黑的一方先行,每次玩家可以移动己方的任何一枚棋子到同一行的任何一个空格上,当然这过程中不许越过该行的敌方棋子。双方轮流移动,直到某一方无法行动为止,移动最后一步的玩家获胜。Tom总是先下(黑方)。
2015-03-30 11:04:06 895
原创 hdu1541 Stars 树状数组水题
Problem DescriptionAstronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars that are not higher and not to the right of the given star.
2015-03-29 15:40:27 1116
原创 hdu2082 找单词 母函数+完全背包两种算法AC。。数据较水
Problem Description假设有x1个字母A, x2个字母B,..... x26个字母Z,同时假设字母A的价值为1,字母B的价值为2,..... 字母Z的价值为26。那么,对于给定的字母,可以找到多少价值<=50的单词呢?单词的价值就是组成一个单词的所有字母的价值之和,比如,单词ACM的价值是1+3+14=18,单词HDU的价值是8+4+21=33。(组成的单词与排列顺序无关,比如ACM与CMA认为是同一个单词)。 Input输入首先是一个整数N,代表测试实例的个数。然后包括N行数据
2015-03-29 14:36:33 972
原创 hdu 1598 find the most comfortable road 一开始把此题当做最短路。。后来发现不行。。并查集+枚举
Problem DescriptionXX星有许多城市,城市之间通过一种奇怪的高速公路SARS(Super Air Roam Structure---超级空中漫游结构)进行交流,每条SARS都对行驶在上面的Flycar限制了固定的Speed,同时XX星人对 Flycar的“舒适度”有特殊要求,即乘坐过程中最高速度与最低速度的差越小乘坐越舒服 ,(理解为SARS的限速要求,flycar必须瞬间提速/降速,痛苦呀 ),但XX星人对时间却没那么多要求。要你找出一条城市间的最舒适的路径。(SARS是双向的)。
2015-03-29 11:07:05 1034
原创 hdu 1548 A strange lift Dijkstra+SPFA算法AC
Problem DescriptionThere is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.The lift have just two buttons: up and down.When you at floor i,if you press the button "UP" , you will go u
2015-03-28 15:31:00 882
原创 hdu 2647 Reward 拓扑排序。
Problem DescriptionDandelion's uncle is a boss of a factory. As the spring festival is coming , he wants to distribute rewards to his workers. Now he has a trouble about how to distribute the rewards.The workers will compare their rewards ,and some one m
2015-03-28 10:46:54 822
原创 hdu 1690 Bus System 最短路 Floyd算法。。INF一定要很大很大。。。数据类型用long long。
Because of the huge population of China, public transportation is very important. Bus is an important transportation method in traditional public transportation system. And it’s still playing an important role even now.The bus system of City X is quite st
2015-03-28 09:45:02 928
原创 hdu 2433 Travel 最短路 dijkstra算法。
Problem Description One day, Tom traveled to a country named BGM. BGM is a small country, but there are N (N <= 100) towns in it. Each town products one kind of food, the food will be transported to all the towns. In addition, the trucks will always
2015-03-27 15:42:21 1422
原创 hdu 1596 find the safest road 最短路 FLoyd算法
Problem DescriptionXX星球有很多城市,每个城市之间有一条或多条飞行通道,但是并不是所有的路都是很安全的,每一条路有一个安全系数s,s是在 0 和 1 间的实数(包括0,1),一条从u 到 v 的通道P 的安全度为Safe(P) = s(e1)*s(e2)…*s(ek) e1,e2,ek是P 上的边 ,现在8600 想出去旅游,面对这这么多的路,他想找一条最安全的路。但是8600 的数学不好,想请你帮忙 ^_^ Input输入包括多个测试实例,每个实例包括:第一行:n。n表示城
2015-03-27 10:57:46 923
原创 poj 2349 Arctic Network 最小生成树~~
DescriptionThe Department of National Defence (DND) wishes to connect several northern outposts by a wireless network. Two different communication technologies are to be used in establishing the network: every outpost will have a radio transceiver and som
2015-03-26 22:05:57 823
原创 poj1287 Networking 最小生成树模板题。prim+kruskal算法AC
You are assigned to design network connections between certain points in a wide area. You are given a set of points in the area, and a set of possible routes for the cables that may connect pairs of points. For each possible route between two points, you a
2015-03-26 15:09:43 1554
原创 hdu 1540 Tunnel Warfare 一个关于线段的故事~~~线段树是我无法言明的伤~
Problem DescriptionDuring the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Generally speaking, villages connected by tunnels lay in a line. Except the two at the ends, every village wa
2015-03-25 20:09:47 886
原创 hdu 1864 最大报销额 01背包变形
Problem Description现有一笔经费可以报销一定额度的发票。允许报销的发票类型包括买图书(A类)、文具(B类)、差旅(C类),要求每张发票的总额不得超过1000元,每张发票上,单项物品的价值不得超过600元。现请你编写程序,在给出的一堆发票中找出可以报销的、不超过给定额度的最大报销额。 Input测试输入包含若干测试用例。每个测试用例的第1行包含两个正数 Q 和 N,其中 Q 是给定的报销额度,N(<=30)是发票张数。随后是 N 行输入,每行的格式为:m Type_1:price
2015-03-24 21:11:23 947
原创 hdu3127 WHUgirls 残忍的完全背包。。。比较有意思,,物品的那层循环放在最里面
Problem DescriptionThere are many pretty girls in Wuhan University, and as we know, every girl loves pretty clothes, so do they. One day some of them got a huge rectangular cloth and they want to cut it into small rectangular pieces to make scarves. But d
2015-03-24 17:12:47 981
原创 hdu 3591 The trouble of Xiaoqian 多重背包+完全背包。。。
Problem DescriptionIn the country of ALPC , Xiaoqian is a very famous mathematician. She is immersed in calculate, and she want to use the minimum number of coins in every shopping. (The numbers of the shopping include the coins she gave the store and the
2015-03-23 19:49:38 819
原创 hdu 3535 AreYouBusy 多重背包~~二进制优化
Problem DescriptionHappy New Term!As having become a junior, xiaoA recognizes that there is not much time for her to AC problems, because there are some other things for her to do, which makes her nearly mad.What's more, her boss tells her that for some
2015-03-23 12:04:02 1208
原创 hdu 3449 Consumer 依赖背包~~
Problem DescriptionFJ is going to do some shopping, and before that, he needs some boxes to carry the different kinds of stuff he is going to buy. Each box is assigned to carry some specific kinds of stuff (that is to say, if he is going to buy one of the
2015-03-22 22:23:54 902
原创 hdu 4508 湫湫系列故事——减肥记I 完全背包。
Problem Description 对于吃货来说,过年最幸福的事就是吃了,没有之一! 但是对于女生来说,卡路里(热量)是天敌啊! 资深美女湫湫深谙“胖来如山倒,胖去如抽丝”的道理,所以她希望你能帮忙制定一个食谱,能使她吃得开心的同时,不会制造太多的天敌。 当然,为了方便你制作食谱,湫湫给了你每日食物清单,上面描述了当天她想吃的每种食物能带给她的幸福程度,以及会增加的卡路里量。 Input 输入包含多组测试用例。 每组数据以一个整数n开始,表示每天的食物清单有n种食物。
2015-03-22 15:34:36 1295
原创 2013 蓝桥杯 2013预赛C本科-A组 所有试题解析,高斯日记+排它平方数+振兴中华+颠倒的价牌+前缀判断+逆波兰表达式+买不到的数目+剪格子+大臣的旅费
第一题:题目标题: 高斯日记 大数学家高斯有个好习惯:无论如何都要记日记。 他的日记有个与众不同的地方,他从不注明年月日,而是用一个整数代替,比如:4210 后来人们知道,那个整数就是日期,它表示那一天是高斯出生后的第几天。这或许也是个好习惯,它时时刻刻提醒着主人:日子又过去一天,还有多少时光可以用于浪费呢? 高斯出生于:1777年4月30日。 在高斯发现的一个重要定理的日记上标注着:5343,因此可算出那天是:1791年12月15日。
2015-03-22 14:39:36 2386
原创 hdu 1455 Sticks DFS 又是一个花样剪枝 ,累觉不爱
Problem DescriptionGeorge took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how many sticks he had originally and how long they were origin
2015-03-20 09:28:42 1149
原创 hdu 1525 Euclid's Game 博弈~~需要分析一下
Problem DescriptionTwo players, Stan and Ollie, play, starting with two natural numbers. Stan, the first player, subtracts any positive multiple of the lesser of the two numbers from the greater of the two numbers, provided that the resulting number must
2015-03-18 19:05:30 1474
原创 hdu 1518 Square 深搜,,,,花样剪枝啊!!!
Problem DescriptionGiven a set of sticks of various lengths, is it possible to join them end-to-end to form a square? InputThe first line of input contains N, the number of test cases. Each test case begins with an integer 4 <= M <= 20, the number of
2015-03-18 16:14:04 1008
原创 hdu 1500 Chopsticks 动态规划 比较经典
Problem DescriptionIn China, people use a pair of chopsticks to get food on the table, but Mr. L is a bit different. He uses a set of three chopsticks -- one pair, plus an EXTRA long chopstick to get some big food by piercing it through the food. As you m
2015-03-17 20:09:48 1971
原创 hdu 1542 Atlantis 线段树求面积并,,,尼玛数据真坑人,数组千万不能开小!
Problem DescriptionThere are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of parts of the island. But unfortunately, these maps describe different regions of Atlantis. Your frie
2015-03-17 10:36:13 1085
原创 hdu 1113 Word Amalgamation 字符串处理 ,加上哈希 ,水题~
Problem DescriptionIn millions of newspapers across the United States there is a word game called Jumble. The object of this game is to solve a riddle, but in order to find the letters that appear in the answer it is necessary to unscramble four words. Yo
2015-03-16 20:58:20 898
原创 hdu 1088 Write a simple HTML Browser 字符串处理
Problem DescriptionIf you ever tried to read a html document on a Macintosh, you know how hard it is if no Netscape is installed. Now, who can forget to install a HTML browser? This is very easy because most of the times you don't need one on a MAC becau
2015-03-16 20:15:33 791
原创 hdu 1062 Text Reverse 字符串处理。简单水题
Problem DescriptionIgnatius likes to write words in reverse way. Given a single line of text which is written by Ignatius, you should reverse all the words and then output them. InputThe input contains several test cases. The first line of the input i
2015-03-15 11:07:44 1218
原创 hdu 1247 Hat’s Words 字典树,还是比较有意思的题目
Problem DescriptionA hat’s word is a word in the dictionary that is the concatenation of exactly two other words in the dictionary.You are to find all the hat’s words in a dictionary. InputStandard input consists of a number of lowercase words, one p
2015-03-14 16:37:04 1187
原创 hdu 1124 Factorial 数论,就是求一个数的阶乘的结果末尾有多少0.
Problem DescriptionThe most important part of a GSM network is so called Base Transceiver Station (BTS). These transceivers form the areas called cells (this term gave the name to the cellular phone) and every phone connects to the BTS with the strongest
2015-03-14 15:25:12 828
原创 hdu 1214 圆桌会议 简单数论
Problem DescriptionHDU ACM集训队的队员在暑假集训时经常要讨论自己在做题中遇到的问题.每当面临自己解决不了的问题时,他们就会围坐在一张圆形的桌子旁进行交流,经过大家的讨论后一般没有解决不了的问题,这也只有HDU ACM集训队特有的圆桌会议,有一天你也可以进来体会一下哦:),在一天在讨论的时候,Eddy想出了一个极为古怪的想法,如果他们在每一分钟内,一对相邻的两个ACM队员交换一下位子,那么要多少时间才能得到与原始状态相反的座位顺序呢?(即对于每个队员,原先在他左面的队员后来在他右面
2015-03-14 15:07:41 920
原创 hdu 1262 寻找素数对 数论 打表。
Problem Description哥德巴赫猜想大家都知道一点吧.我们现在不是想证明这个结论,而是想在程序语言内部能够表示的数集中,任意取出一个偶数,来寻找两个素数,使得其和等于该偶数.做好了这件实事,就能说明这个猜想是成立的.由于可以有不同的素数对来表示同一个偶数,所以专门要求所寻找的素数对是两个值最相近的. Input输入中是一些偶整数M(5<M<=10000). Output对于每个偶数,输出两个彼此最接近的素数,其和等于该偶数.
2015-03-14 14:45:15 980
原创 hdu 2964 Prime Bases 数论~~
Problem DescriptionGiven any integer base b >= 2, it is well known that every positive integer n can be uniquely represented in base b. That is, we can writen = a0 + a1*b + a2*b*b + a3*b*b*b + ... where the coefficients a0, a1, a2, a3, ... are between
2015-03-13 17:39:39 1016
原创 hdu 2674 N!Again 数论水题啊~~~
Problem DescriptionWhereIsHeroFrom: Zty, what are you doing ?Zty: I want to calculate N!......WhereIsHeroFrom: So easy! How big N is ?Zty: 1 <=N <=1000000000
2015-03-13 15:09:23 901
原创 hdu 2161 Primes 筛法求素数 大水题
Problem DescriptionWrite a program to read in a list of integers and determine whether or not each number is prime. A number, n, is prime if its only divisors are 1 and n. For this problem, the numbers 1 and 2 are not considered primes. InputEach inp
2015-03-13 13:48:12 1452
mail.jar和activation.jar
2015-11-29
javaMail文档
2015-11-29
现代编译原理(虎书,包含c版和java版中英文,源码,全书答案
2015-07-28
java api1.6中文文档
2015-07-24
EditPlus V3.6.0.740中文破解版
2015-07-24
cocos2d-x3.3 坦克大战
2015-07-07
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人