- 博客(33)
- 资源 (1)
- 收藏
- 关注
原创 成长路上的小程序之—— 哈夫曼编码、译码
这是大二数据结构第七次上机老师布置的任务:实现文件操作,对文件进行哈夫曼编码、译码之所以为此写一篇博客,是因为自认为这个程序对我的意义比较重大。我是以一个课程设计的要求来写的,大一结束的暑假也做了一个课程设计:《学生通讯录》但是太水了,完全没有难度。这个相对来说则有一些巧妙的思想,完全是我独立完成的!哈哈哈代码如下:#include #include #includ
2013-11-29 21:05:29 1104
原创 UVa 11997 K Smallest Sums
K Smallest SumsYou're given k arrays, each array has k integers. There are kk ways to pick exactly one element in each array and calculate the sum of the integers. Your task is to find the k s
2013-11-16 19:34:46 652
原创 UVa 11234 Expressions
Arithmetic expressions are usually written with the operators in between the two operands (which is called infix notation). For example,(x+y)*(z-w) is an arithmetic expression in infix notation. Howev
2013-11-16 15:28:08 793
原创 UVa 11111 Generalized Matrioshkas
dVladimir worked for years making matrioshkas, those nesting dolls that certainly represent truly Russian craft. A matrioshka is a doll that may be opened in two halves, so that one finds anot
2013-11-14 16:30:27 545
原创 UVa 442 Matrix Chain Multiplication
Matrix Chain Multiplication Suppose you have to evaluate an expression like A*B*C*D*E where A,B,C,D and E are matrices. Since matrix multiplication is associative, the order in which m
2013-11-13 19:54:13 997
原创 Codeforces #211 (Div. 2) B. Fence
B. Fencetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is a fence in front of Polycarpus's home. The
2013-11-11 20:47:11 1167
原创 Codeforces #211 (Div. 2) A. Soroban
A. Sorobantime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou know that Japan is the country with almost th
2013-11-11 20:40:29 636
原创 UVa 10152 ShellSort
He made each turtle stand on another one's backAnd he piled them all up in a nine-turtle stack.And then Yertle climbed up. He sat down on the pile.What a wonderful view! He could see 'most a mil
2013-11-11 15:32:26 669
原创 UVa 673 Parentheses Balance
Parentheses Balance You are given a string consisting of parentheses () and []. A string of this type is said to be correct:(a)if it is the empty string(b)if A and B are correct, A
2013-11-11 14:29:00 679
原创 UVa 133 The Dole Queue
The Dole Queue In a serious attempt to downsize (reduce) the dole queue, The New National Green Labour Rhinoceros Party has decided on the following strategy. Every day all dole applic
2013-11-11 14:23:44 654
原创 UVa 101 The Blocks Problem
The Blocks Problem Background Many areas of Computer Science use simple, abstract domains for both analytical and empirical studies. For example, an early AI study of planning
2013-11-11 13:19:22 688
原创 UVa 127 Accordian Patience
``Accordian'' Patience You are to simulate the playing of games of ``Accordian'' patience, the rules for which are as follows:Deal cards one by one in a row from left to right,
2013-11-10 14:06:22 606
原创 HDU 2093 考试排名
考试排名Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2179 Accepted Submission(s): 786 Problem DescriptionC++编程考试使用的实时提
2013-11-09 21:39:57 546
原创 HDU 1236 排名
排名Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2919 Accepted Submission(s): 951 Problem Description今天的上机考试
2013-11-08 14:03:22 611
原创 hdu 2104 hide handkerchief
hide handkerchiefTime Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3831 Accepted Submission(s): 1293 Problem Descr
2013-11-07 17:40:46 552
原创 UVa 846 Steps
Steps One steps through integer points of the straight line. The length of a step must be nonnegative and can be by one bigger than, equal to, or by one smaller than the length of the
2013-11-07 16:29:47 549
原创 UVa 10014 Simple calculations
d Simple calculations The ProblemThere is a sequence of n+2 elements a0, a1,…, an+1 (n i 1000). It is known that ai = (ai–1 + ai+1)/2 – ci for each i=1, 2, ..., n. Yo
2013-11-06 21:14:02 601
原创 UVa 10916 Factstone Benchmark
Problem B: Factstone BenchmarkAmtel 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 eve
2013-11-06 20:22:03 608
原创 UVa 10719 Quotient Polynomial
A polynomial of degree n can be expressed asIf k is any integer then we can write:Here q(x) is called the quotient polynomial of p(x) of degree (n-1) and r is any integer which is called the r
2013-11-06 19:33:14 598
原创 UVa 10177 (2/3/4)-D Sqr/Rects/Cubes/Boxes?
Problem J(2/3/4)-D Sqr/Rects/Cubes/Boxes?Input: standard inputOutput: standard outputTime Limit: 2 seconds You can see a (4x4) grid below. Can you tell me how many squares and rectangles a
2013-11-06 18:58:45 653
原创 UVa 10790 How Many Points of Intersection?
How Many Points of Intersection? We have two rows. There are a dots on the top row and b dots on the bottom row. We draw line segments connecting every dot on the top row with every dot
2013-11-06 18:15:54 568
原创 UVA 10499 The Land of Justice
Problem HThe Land of JusticeInput: standard inputOutput: standard outputTime Limit: 4 secondsIn the Land of Justice the selling price of everything is fixed all over the country. Nobody
2013-11-05 20:40:07 599
原创 UVA 573 The Snail
The Snail A 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 sna
2013-11-05 20:18:50 401
原创 UVA 107 The Cat in the Hat
The Cat in the Hat Background(An homage to Theodore Seuss Geisel)The Cat in the Hat is a nasty creature,But the striped hat he is wearing has a rather nifty feature.Wit
2013-11-03 20:01:06 868
原创 UVA 621 Secret Research
Secret Research At a certain laboratory results of secret research are thoroughly encrypted. A result of a single experiment is stored as an information of its completion:`posi
2013-11-03 19:56:10 564
原创 UVA 113 Power of Cryptography
Power of Cryptography BackgroundCurrent work in cryptography involves (among other things) large prime numbers and computing powers of numbers modulo functions of these primes. W
2013-11-03 19:53:17 743
原创 UVA 10025 The ? 1 ? 2 ? ... ? n = k problem
The ? 1 ? 2 ? ... ? n = k problem The problemGiven the following formula, one can set operators '+' or '-' instead of each '?', in order to obtain a given k? 1 ? 2 ? ... ? n =
2013-11-03 19:49:33 1023
原创 UVA 253 Cube painting
Cube painting We have a machine for painting cubes. It is supplied with three different colors: blue, red and green. Each face of the cube gets one of these colors. The cube's faces are
2013-11-03 19:44:45 610
原创 UVA 591 Box of Bricks
Box of Bricks Little Bob likes playing with his box of bricks. He puts the bricks one upon another and builds stacks of different height. ``Look, I've built a wall!'', he tells his older
2013-11-03 19:41:17 682
原创 UVA 10970 Big Chocolate
Problem GBig ChocolateMohammad has recently visited Switzerland. As he loves his friends very much, he decided to buy some chocolate for them, but as this fine chocolate is very expensive(You know
2013-11-03 19:37:38 492
原创 UVA 10161 Ant on a Chessboard
Ant on a Chessboard Background One day, an ant called Alice came to an M*M chessboard. She wanted to go around all the grids. So she began to walk along the chessboard according to t
2013-11-03 19:34:02 576
转载 C++中基本数据类型字节数及取值范围
机器字长:是指计算机进行一次整数运算所能处理的二进制数据的位数(整数运算即定点整数运算)。机器字长也就是运算器进行定点数运算的字长,通常也是CPU内部数据通路的宽度。现在一般为32位即4个字节,也有64位和16位的。 算术类型的存储空间按照机器而定。一般,short类型为半个机器字长,int为一个机器字长,long为1或2个机器字长,float为一个机器字长,double为两个字,
2013-11-03 15:49:14 1093 1
原创 POJ 一 1163 The Triangle
The TriangleTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 34295 Accepted: 20418Description73 88 1 02 7 4 44 5 2 6 5(Figure
2013-11-01 16:39:33 456
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人