- 博客(24)
- 收藏
- 关注
原创 Solution of ZOJ 1078 Palindrome Number
We say that a number is a palindrom if it is the sane when read from left to right or from right to left. The objective of this problem is to verify if a set of given numbers are palindroms in any basis from 2 to 16.
2011-05-29 19:38:00 595
原创 Solution of ZOJ 1067 Color Me Less
A color reduction is a mapping from a set of discrete colors to a smaller one. The solution to this problem requires that you perform just such a mapping in a standard twenty-four bit RGB color space. The input consists of a target set of sixteen RGB color
2011-05-29 19:21:00 691
原创 Non-recursive Version of DFS Algorithm
DFS is the most important graph traversal algorithm and has been adopted as the default traversal module for many software system. In this short article, the non-recursive implementation of DFS in C++ is given.
2011-05-21 12:30:00 874
原创 Solution of ZOJ 2679 Old Bill
<br />Among grandfather��s papers a bill was found:<br />72 turkeys $_679_<br />The first and the last digits of the number that obviously represented the total price of those turkeys are replaced here by blanks (denoted _), for they are faded and are now
2011-05-17 16:29:00 755
原创 Solution of ZOJ 2840 File Search
Have you ever used file searching tools provided by an operating system? For example, in DOS, if you type "dir *.exe", the OS will list all executable files with extension "exe" in the current directory.
2011-05-17 15:36:00 1011
原创 Solution of ZOJ 2420 Calendar
<br />A calendar is a system for measuring time, from hours and minutes, to months and days, and finally to years and centuries. The terms of hour, day, month, year and century are all units of time measurements of a calender system.<br />According to the
2011-05-16 13:42:00 777
原创 Solution of ZOJ 2109 FatMouse' Trade
FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean.
2011-05-13 01:24:00 817
原创 Solution of ZOJ 2748 Free Kick
声明:转载或引用本文代码,请务必注明出处! http://blog.csdn.net/fduan思路分析:此题为一道几何题,可以证明当人墙与右边两条直线所成三角形为等腰三角形时,人墙长度最短。接下来就是非常简单的几何计算了。下面给出我的实现代码,有一点需要注意,即使用三角函数时,有可能得出的人数为负数,这时应输出0。
2011-05-12 22:44:00 751
原创 Solution of ZOJ 1205 Martian Addition
In the 22nd Century, scientists have discovered intelligent residents live on the Mars. Martians are very fond of mathematics. Every year, they would hold an Arithmetic Contest on Mars (ACM). The task of the contest is to calculate the sum of two 100-digit
2011-05-12 15:05:00 683
原创 Solution of ZOJ 1949 Error Correcting
A boolean matrix has the parity property when each row and each column has an even sum, i.e. contains an even number of bits which are set. Here's a 4 x 4 matrix which has the parity property: 1 0 1 00 0 0 01 1 1 10 1 0 1The sums of the rows
2011-05-12 12:02:00 777
原创 Solution of ZOJ 1188 DNA Sorting
One measure of ``unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to each other. For instance, in the letter sequence ``DAABEC'', this measure is 5, since D is greater than four letters to its right and E is
2011-05-12 09:59:00 1796
原创 Solution of ZOJ 2095 Divisor Summation (Online Version)
Give a natural number n (1
2011-05-12 01:12:00 1320
原创 Solution of ZOJ 2850 Beautiful Meadow
Tom has a meadow in his garden. He divides it into N * M squares. Initially all the squares were covered with grass. He mowed down the grass on some of the squares and thinks the meadow is beautiful if and only if Not all squares are covered with grass
2011-05-11 22:32:00 1093
原创 Solution of ZOJ 2857 Image Transformation
Convert color images to a gray-level images.
2011-05-11 20:01:00 771
原创 算法百题007:数字逆序求和(Adding Reversed Numbers)
Reversed number is a number written in arabic numerals but the order of digits is reversed. Calculate the reversed sum of a set of reversed numbers.
2011-05-11 16:35:00 2068
原创 Solution of ZOJ 1797 Least Common Multiplier
Calculating the least common multiple (LCM) of a set of positive integers.
2011-05-11 14:51:00 801
原创 算法百题006:单词逆序输出(Word Reversal)
For each list of words, output a line with each word reversed without changing the order of the words.
2011-05-11 10:34:00 3801
原创 算法百题005:数字根(Digital Roots)
The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value contains two or more digits, those digits are summed and the process
2011-05-10 12:14:00 2877 1
原创 算法百题004:数据压缩——游程编码
题目:给定一个包含ASCII码的字符串,利用下列规则进行编码。1)将子串中连续k个相同字符c编为kc;2)若子串长度为1,则1忽略。
2011-05-08 19:30:00 1646
原创 A Simple Implementation of Binary Search Tree in C++
A Simple Implementation of Binary Search Tree in C++
2011-05-08 15:35:00 802
原创 Algorithm Visualization of USFCA
Cited from http://www.cs.usfca.edu/~galles/visualization/Algorithms.html
2011-05-08 13:14:00 1306
原创 算法百题003:两数组等值数目
题目:有两个整型数组f和g,其元素已有序排列,且两数组中元素各不相同。求这两个数组之间有多少组相同的元素。例如 f[] = {1, 3, 5, 7, 9}, g[] = {3, 5, 7, 9, 10 }则相同的组为 f[1], g[0]; f[2], g[1]; ...
2011-05-06 18:12:00 870
原创 算法百题002:支配值数目
题目:已知f[]和g[]两数组已按升序排列,求f[]中每个元素比g[]中元大的个数总和。声明:本题解法为fduan原创,转载请注明出处。
2011-05-06 18:05:00 784
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人