- 博客(42)
- 资源 (4)
- 收藏
- 关注
原创 HDU 1130 How Many Trees?
Problem DescriptionA binary search tree is a binary tree with root k such that any node v reachable from its left has label (v) label (k). It is a search structure which can find a node with labe
2012-08-29 19:37:10 2768
原创 HDU 1267 下沙的沙子有几粒?
Problem Description2005年11月份,我们学校参加了ACM/ICPC 亚洲赛区成都站的比赛,在这里,我们获得了历史性的突破,尽管只是一枚铜牌,但获奖那一刻的激动,也许将永远铭刻在我们几个人的心头。借此机会,特向去年为参加ACM亚洲赛而艰苦集训了近半年的各位老队员表示感谢。实际上,除了获奖以外,在这次比赛期间还有一件事也让我们记忆深刻。那是比赛当天等待入场的时候,听到
2012-08-28 20:59:57 662
原创 HDU 1250 Hat's Fibonacci
Problem DescriptionA Fibonacci sequence is calculated by adding the previous two members the sequence, with the first two members being both 1.F(1) = 1, F(2) = 1, F(3) = 1,F(4) = 1, F(n>4) = F(n
2012-08-28 15:51:01 2887 1
原创 POJ 2299 Ultra-QuickSort
DescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the seque
2012-08-26 10:04:00 5020
原创 POJ 1700 Crossing River
DescriptionA group of N people wishes to go across a river with only one boat, which can at most carry two persons. Therefore some sort of shuttle arrangement must be arranged in order to row the
2012-08-25 18:37:20 1206
原创 C++中string.h自编的几个函数
今天刘老师讲了const,类型转换,函数指针的用法,以前没能认识到函数指针的强大,刘老师写排序时用到了函数指针,暧昧感觉到了函数指针的强大;最后他留了个作业,就是写string.h里的几个函数,我写了下,感觉写的很操蛋,效率不高,明天看看老师怎么写吧!char* strcpy(char s1[],const char s2[]){ char *head=s1; while
2012-08-23 23:14:37 969
原创 HDU 1596 find the safest road
Problem DescriptionXX星球有很多城市,每个城市之间有一条或多条飞行通道,但是并不是所有的路都是很安全的,每一条路有一个安全系数s,s是在 0 和 1 间的实数(包括0,1),一条从u 到 v 的通道P 的安全度为Safe(P) = s(e1)*s(e2)…*s(ek) e1,e2,ek是P 上的边 ,现在8600 想出去旅游,面对这这么多的路,他想找一条最安全的路。但是
2012-08-22 22:13:56 1996 1
原创 HDU 1690 Bus System
DescriptionBecause 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 p
2012-08-21 23:26:16 954
原创 POJ 1154 LETTERS
DescriptionA single-player game is played on a rectangular board divided in R rows and C columns. There is a single uppercase letter (A-Z) written in every position in the board. Before the begg
2012-08-20 22:40:51 1455
原创 HDU 1018 Big Number
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 ar
2012-08-20 09:33:08 4000
原创 HDU 1002 A + B Problem II
Problem DescriptionI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. InputThe first line of the input contains an integer
2012-08-20 08:53:24 9789 4
原创 HDU 1443 Joseph
Problem DescriptionThe Joseph\\\\\\\'s problem is notoriously known. For those who are not familiar with the original problem: from among n people, numbered 1, 2, . . ., n, standing in circle ever
2012-08-19 22:28:20 2440 1
翻译 vim 教程
vim 是一个具有很多命令的功能非常强大的编辑器。限于篇幅,在本教程当中 就不详细介绍了。本教程的设计目标是讲述一些必要的基本命令,而掌握好这 些命令,您就能够很容易将vim当作一个通用的万能编辑器来使用了。 完成本教程的内容大约需要25-30分钟,取决于您训练的时间。 每一节的命令操作将会更改本文。推荐您复制本文的一个副本,然后在副本上
2012-08-19 09:24:59 857
原创 POJ 2240 Arbitrage
DescriptionArbitrage is the use of discrepancies in currency exchange rates to transform one unit of a currency into more than one unit of the same currency. For example, suppose that 1 US Dollar
2012-08-19 09:05:08 2731 1
原创 HDU 1066 Last non-zero Digit in N!
Problem DescriptionThe expression N!, read as "N factorial," denotes the product of the first N positive integers, where N is nonnegative. So, for example, N N! 0 1 1 1 2 2 3 6 4 24
2012-08-18 22:38:50 4087 1
原创 2011/2012学年实践学期教学课程表
日期\周次第一节第二节第三节第四节第五节第六节第七节第八节20/8 (一)嵌入式软件开发项目导引二;郑纯军 ;G21921/8 (二)数学实验课;严维军 ;E203嵌入式软件开发项目导引二;郑纯军 ;G219大学英语综合
2012-08-17 18:44:32 779
原创 HDU 1166 敌兵布阵
DescriptionLily 特别喜欢养花,但是由于她的花特别多,所以照料这些花就变得不太容易。她把她的花依次排成一行,每盆花都有一个美观值。如果Lily把某盆花照料的好的话,这盆花的美观值就会上升,如果照料的不好的话,这盆花的美观值就会下降。有时,Lily想知道某段连续的花的美观值之和是多少,但是,Lily的算术不是很好,你能快速地告诉她结果吗?Input
2012-08-14 16:11:59 558
原创 POJ 2299 Ultra-QuickSort
DescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the sequence
2012-08-14 08:03:39 537
原创 POJ 2352 Stars
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 ar
2012-08-14 07:40:46 586
原创 POJ 2661 Factstone Benchmark
DescriptionAmtel has announced that it will release a 128-bit computer chip by 2010, a 256-bit computer by 2020, and so on, continuing its strategy of doubling the word-size every ten years. (Amte
2012-08-11 09:53:30 1596
原创 POJ 2363 Blocks
DescriptionDonald wishes to send a gift to his new nephew, Fooey. Donald is a bit of a traditionalist, so he has chosen to send a set of N classic baby blocks. Each block is a cube, 1 inch by 1 in
2012-08-11 08:50:38 1742
原创 HDOJ 2147 kiki’s game
Problem DescriptionRecently kiki has nothing to do. While she is bored, an idea appears in his mind, she just playes the checkerboard game.The size of the chesserboard is n*m.First of all, a coin
2012-08-10 23:36:40 1613
原创 UVA 138 Street Numbers
Description Street Numbers A computer programmer lives in a street with houses numbered consecutively (from 1) down one side of the street. Every evening she walks her dog by
2012-08-10 23:13:42 868
转载 轻松理解扩展欧几里德算法
欧几里德算法用来求两个数的最大公约数的算法。具体如下int gcd(int a,int b){ if(b == 0) return a; return gcd(b,a%b); }首先看正确性证明,实际上需要证明gcd(a,b)=gcd(b,a%b),我们只要证明gcd(a,b)=gcd(a-b,b)即可,因为可以由此逐步扩展为gcd(a,b) = gcd(a
2012-08-10 10:09:27 723
原创 POJ 1164 放苹果
Description把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。Input第一行是测试数据的数目t(0 Output对输入的每组数据M和N,用一行输出相应的K。Sample Input17 3
2012-08-07 23:03:09 1401
原创 POJ 2479 Maximum sum
DescriptionGiven a set of n integers: A={a1, a2,..., an}, we define a function d(A) as below:Your task is to calculate d(A).InputThe input consists of T(Each test case contains two l
2012-08-07 22:28:40 799
原创 POJ 2245 Lotto
DescriptionIn the German Lotto you have to select 6 numbers from the set {1,2,...,49}. A popular strategy to play Lotto - although it doesn't increase your chance of winning - is to select a subse
2012-08-07 14:03:49 1123
原创 POJ 2449 Remmarguts' Date
Description"Good man never makes girls wait or breaks an appointment!" said the mandarin duck father. Softly touching his little ducks' head, he told them a story. "Prince Remmarguts lives i
2012-08-07 12:19:19 781
原创 暑期培训计划
日期上午(9:30~11:30)下午(13:30~15:30)晚上(18:00~21:00)7.30图论基础+Bfs(张超)Dfs (张超)练习赛7.31动态规划入门(一)(姚翔)练习赛(13:30~16:30)
2012-08-06 07:17:09 1381
转载 搜索剪枝
搜索算法的通用优化方法[DFS][搜索剪枝]在很多情况下,我们已经找到了一组比较好的解。但是计算机仍然会义无返顾地去搜索比它更“劣”的其他解,搜索到后也只能回溯。为了避免出现这种情况,我们需要灵活地去定制回溯搜索的边界。*例题 计算机网络连接要将n(n台计算机连成网络,连接方法:去除首尾两台计算机与一台计算机相连以外,其他计算机只与两台计算机相连。连接的长度则为计算机连接的电缆的长度。求:一种
2012-08-06 06:10:17 6357
原创 POJ 3624 Charm Bracelet
DescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best charms possible from the N (1 ≤ N ≤ 3,402) available charms. Each
2012-08-05 23:09:34 585
原创 POJ 1163 The Triangle
Description73 88 1 02 7 4 44 5 2 6 5(Figure 1)Figure 1 shows a number triangle. Write a program that calculates the highest sum of numbers passed on a route that st
2012-08-05 22:45:39 548
原创 POJ To the Max
DescriptionGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater located within the whole array. The sum of a rectangl
2012-08-05 22:04:39 1067
原创 HDU 2084 数塔
Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?已经告诉你了,这是个DP的题目,你能AC吗? Input输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1
2012-08-05 16:30:53 2541
原创 HDU 1248 寒冰王座
Problem Description不死族的巫妖王发工资拉,死亡骑士拿到一张N元的钞票(记住,只有一张钞票),为了防止自己在战斗中频繁的死掉,他决定给自己买一些道具,于是他来到了地精商店前.死亡骑士:"我要买道具!"地精商人:"我们这里有三种道具,血瓶150块一个,魔法药200块一个,无敌药水350块一个."死亡骑士:"好的,给我一个血瓶."说完他掏出那张
2012-08-05 15:55:01 1135
原创 LightOJ 1035 Intelligent Factorial Factorization
DescriptionGiven an integer N, you have to prime factorize N! (factorial N).InputInput starts with an integer T (≤ 125), denoting the number of test cases.Each case contains an integ
2012-08-05 15:28:11 1016
原创 LightOJ 1077 How Many Points?
DescriptionGiven two points A and B on the X-Y plane, output the number of the lattice points on the segment AB. Note that A and B are also lattice point. Those who are confused with the definit
2012-08-05 15:19:19 1321
原创 UVALive 5066 Fire Drill
DescriptionJoko is taking part in a fire drill which is held by the Jakarta Fire Department to recruit new firemen. The drill is about rescuing volunteers (who act as unconscious people) trapp
2012-08-05 15:09:54 812
原创 CodeForces 201A Symmetry
DescriptionConsider some square matrix A with side n consisting of zeros and ones. There are n rows numbered from 1 to n from top to bottom and n columns numbered from 1 to n from left to righ
2012-08-03 21:19:51 898
原创 POJ 1125 Stockbroker Grapevine
DescriptionStockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the stockbrokers to give your employer the tactical ed
2012-08-02 21:58:10 637
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人