程序控

IPPP (Institute of Penniless Peasent-Programmer) Fellow

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: :: 管理 ::
  77 随笔 :: 0 文章 :: 442 评论 :: 0 引用

2010年8月20日

摘要:Time limit: 3.000 seconds限时:3.000秒Problem问题Given two convex polygons, they may or may not overlap. If they do overlap, they will do so to differing degrees and in different ways. Write a program that ... 阅读全文
posted @ 2010-08-20 14:12 Devymex 阅读 (2391) 评论 (4) 编辑

2010年8月19日

摘要:概念平面内两条线段位置关系的判定在很多领域都有着广泛的应用,比如游戏、CAD、图形处理等,而两线段交点的求解又是该算法中重要的一环。本文将尽可能用通俗的语言详细的描述一种主流且性能较高的判定算法。外积,又称叉积,是向量代数(解析几何)中的一个概念。两个二维向量v1(x1, y1)和v2(x2, y2)的外积v1×v2=x1y2-y1x2。如果由v1到v2是顺时针转动,外积为负,反之为正,为0表示二者方向相同(平行)。此外,文中涉及行例式和方程组的概念,请参阅线性代数的相关内容。为方便计算,对坐标点的大小比较作如下定义:x坐标较大的点为大,x坐标相等但y坐标较大的为大,x与y都相等的点 阅读全文
posted @ 2010-08-19 21:44 Devymex 阅读 (19090) 评论 (10) 编辑

2010年8月18日

摘要:Time limit: 3.000 seconds限时:3.000秒Background背景The saying "You can't see the wood for the trees" is not only a cliche, but is also incorrect. The real problem is that you can't see the trees for the wo... 阅读全文
posted @ 2010-08-18 23:30 Devymex 阅读 (1402) 评论 (2) 编辑

摘要:Problem问题The well-known physicist Alfred E Neuman is working on problems that involve multiplying polynomials of x and y. For example, he may need to calculate著名的物理学家纽曼(译注:杜撰人名)正在研究的问题中需要计算多项式的乘积,他可能需... 阅读全文
posted @ 2010-08-18 01:57 Devymex 阅读 (1011) 评论 (0) 编辑

2010年8月17日

摘要:Background背景Problems that process input and generate a simple "yes" or "no" answer are called decision problems. One class of decision problems, the NP-complete problems, are not amenable to general e... 阅读全文
posted @ 2010-08-17 20:01 Devymex 阅读 (1795) 评论 (5) 编辑

摘要:概念全排列的生成算法有很多种,有递归遍例,也有循环移位法等等。C++/STL中定义的next_permutation和prev_permutation函数则是非常灵活且高效的一种方法,它被广泛的应用于为指定序列生成不同的排列。本文将详细的介绍prev_permutation函数的内部算法。按照STL... 阅读全文
posted @ 2010-08-17 02:37 Devymex 阅读 (11043) 评论 (13) 编辑

摘要:Time limit: 3.000 seconds限时:3.000秒Background背景Order is an important concept in mathematics and in computer science. For example, Zorn's Lemma states: "a partially ordered set in which every chain has ... 阅读全文
posted @ 2010-08-17 00:56 Devymex 阅读 (1229) 评论 (0) 编辑

2010年8月16日

摘要:Time limit: 3.000 seconds限时:3.000秒Background背景Searching and sorting are part of the theory and practice of computer science. For example, binary search provides a good example of an easy-to-understand... 阅读全文
posted @ 2010-08-16 14:44 Devymex 阅读 (1202) 评论 (0) 编辑

2010年8月15日

摘要:Background背景Trees are fundamental in many branches of computer science. Current state-of-the art parallel computers such as Thinking Machines' CM-5 are based on fat trees. Quad- and octal-trees are fu... 阅读全文
posted @ 2010-08-15 19:15 Devymex 阅读 (2940) 评论 (2) 编辑

摘要:Time limit: 3.000 seconds限时:3.000秒Background背景Filters, or programs that pass "processed" data through in some changed form, are an important class of programs in the UNIX operating system. A pipe is a... 阅读全文
posted @ 2010-08-15 15:17 Devymex 阅读 (1561) 评论 (0) 编辑

摘要:Time limit: 3.000 seconds限时:3.000秒Background背景Stacks and Queues are often considered the bread and butter of data structures and find use in architecture, parsing, operating systems, and discrete even... 阅读全文
posted @ 2010-08-15 01:01 Devymex 阅读 (5730) 评论 (6) 编辑

2010年8月14日

摘要:Time limit: 3.000 seconds限时:3.000秒Background背景Computer generated and assisted proofs and verification occupy a small niche in the realm of Computer Science. The first proof of the four-color problem w... 阅读全文
posted @ 2010-08-14 19:22 Devymex 阅读 (2068) 评论 (0) 编辑

摘要:Time limit: 3.000 seconds限时:3.000秒The Problem问题This problem involves determining, for a group of gift-giving friends, how much more each person gives than they receive (and vice versa for those that v... 阅读全文
posted @ 2010-08-14 18:18 Devymex 阅读 (1886) 评论 (0) 编辑

2010年8月13日

摘要:Time limit: 3.000 seconds限时:3.000秒Background背景Robotics, robot motion planning, and machine learning are areas that cross the boundaries of many of the subdisciplines that comprise Computer Science: ar... 阅读全文
posted @ 2010-08-13 23:37 Devymex 阅读 (849) 评论 (0) 编辑

摘要:Time limit: 3.000 seconds限时3.000秒Background背景Graph algorithms form a very important part of computer science and have a lineage that goes back at least to Euler and the famous Seven Bridges of Kö... 阅读全文
posted @ 2010-08-13 18:46 Devymex 阅读 (2070) 评论 (0) 编辑

摘要:Time limit: 3.000 seconds限时:3.000秒Background背景Problems that require minimum paths through some domain appear in many different areas of computer science. For example, one of the constraints in VLSI ro... 阅读全文
posted @ 2010-08-13 02:37 Devymex 阅读 (3004) 评论 (1) 编辑

2010年8月12日

摘要:Time limit: 3.000 seconds限时:3.000秒Background背景Expression trees, B and B* trees, red-black trees, quad trees, PQ trees; trees play a significant role in many domains of computer science. Sometimes the ... 阅读全文
posted @ 2010-08-12 21:32 Devymex 阅读 (2880) 评论 (2) 编辑

2010年8月11日

摘要:Time limit: 3.000 secondsBackgroundSimulation is an important application area in computer science involving the development of computer models to provide insight into real-world events. There are man... 阅读全文
posted @ 2010-08-11 03:08 Devymex 阅读 (784) 评论 (0) 编辑

2010年8月10日

摘要:Time limit: 3.000 seconds限时: 3.000秒Background背景Current work in cryptography involves (among other things) large prime numbers and computing powers of numbers modulo functions of these primes. Work in ... 阅读全文
posted @ 2010-08-10 22:22 Devymex 阅读 (1728) 评论 (2) 编辑

摘要:Time limit: 3.000 seconds限时:3.000秒Background背景LISP was one of the earliest high-level programming languages and, with FORTRAN, is one of the oldest languages currently being used. Lists, which are the... 阅读全文
posted @ 2010-08-10 20:31 Devymex 阅读 (2617) 评论 (0) 编辑

摘要:Time limit: 3.000 secondsBackgroundMany problems in Computer Science involve maximizing some measure according to constraints.Consider a history exam in which students are asked to put several histori... 阅读全文
posted @ 2010-08-10 15:22 Devymex 阅读 (1342) 评论 (0) 编辑

摘要:Time limit: 3.000 seconds限时:3.000秒Background背景Sorting holds an important place in computer science. Analyzing and implementing various sorting algorithms forms an important part of the education of mo... 阅读全文
posted @ 2010-08-10 03:05 Devymex 阅读 (1230) 评论 (0) 编辑

2010年8月9日

摘要:本博客致力于基础算法的学习与研究,文章每字每句都经过仔细斟酌。如果您对算法或C++/STL感兴趣,相信随便看看也会有所收获!OJ ProblemsOJ解题志关于OJ系列文章的说明转载:UVa OJ全部题目列表(按难度分级,仅标题)ZOJ 1002 - Fire NetUVa OJ 100 - The 3n + 1 problem (3n + 1问题)UVa OJ 101 - The Blocks Problem (积木问题)UVa OJ 102 - Ecological Bin Packing (生态学装箱问题)UVa OJ 103 - Stacking Boxes (嵌套盒子)UVa OJ 阅读全文
posted @ 2010-08-09 17:32 Devymex 阅读 (19146) 评论 (0) 编辑

摘要:概念凸包(Convex Hull)是一个计算几何(图形学)中的概念。用不严谨的话来讲,给定二维平面上的点集,凸包就是将最外层的点连接起来构成的凸多边型,它能包含点集中所有点的。严谨的定义和相关概念参见维基百科:凸包。这个算法是由数学大师葛立恒(Graham)发明的,他曾经是美国数学学会(AMS)主席... 阅读全文
posted @ 2010-08-09 17:06 Devymex 阅读 (14680) 评论 (5) 编辑

摘要:Time limit: 3.000 secondsBackgroundSome problems are difficult to solve but have a simplification that is easy to solve. Rather than deal with the difficulties of constructing a model of the Earth (a ... 阅读全文
posted @ 2010-08-09 02:39 Devymex 阅读 (1344) 评论 (0) 编辑

2010年8月8日

摘要:Time limit: 3.000 secondsBackgroundA problem that is simple to solve in one dimension is often much more difficult to solve in more than one dimension. Consider satisfying a boolean expression in conj... 阅读全文
posted @ 2010-08-08 15:56 Devymex 阅读 (1993) 评论 (0) 编辑

摘要:Time limit: 3.000 secondsBackground(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.With one flick of his wrist h... 阅读全文
posted @ 2010-08-08 03:56 Devymex 阅读 (1754) 评论 (0) 编辑

2010年8月7日

摘要:ime Limit: 1 Second Memory Limit: 32768 KBBackgroundSuppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or... 阅读全文
posted @ 2010-08-07 13:16 Devymex 阅读 (1435) 评论 (0) 编辑

摘要:什么是UVa OJ?UVa OJ(英文)是西班牙巴利亚多利德大学提供的一套在线评判系统(OJ)。它提供多达近3000道ACM算法题,而且还在增加。任何人在免费注册后都可以浏览题目和提交自己的解答程序。服务器会自动编译你提交的代码,用特殊的数据(不是题目中的Test Case)进行测试,并立即做出评判。如果程序在限定条件内运行出符合要求的结果,系统会给出运行时间和下列结果:正确(Accepted, ... 阅读全文
posted @ 2010-08-07 04:30 Devymex 阅读 (3783) 评论 (1) 编辑

摘要:Time limit: 3.000 secondsBackgroundWith the advent of high speed graphics workstations, CAD (computer-aided design) and other areas (CAM, VLSI design) have made increasingly effective use of computers... 阅读全文
posted @ 2010-08-07 03:08 Devymex 阅读 (2731) 评论 (1) 编辑

2010年8月4日

摘要:Time limit: 3.000 secondsBackgroundCryptography deals with methods of secret communication that transform a message (the plaintext) into a disguised form (the ciphertext) so that no one seeing the cip... 阅读全文
posted @ 2010-08-04 17:42 Devymex 阅读 (1197) 评论 (0) 编辑

摘要:Time limit: 3.000 seconds限时:3.000秒Background背景In the movie "Die Hard 3", Bruce Willis and Samuel L. Jackson were confronted with the following puzzle. They were given a 3-gallon jug and a 5-gallon jug... 阅读全文
posted @ 2010-08-04 16:08 Devymex 阅读 (1161) 评论 (0) 编辑

摘要:Time limit: 3.000 seconds限时:3.000秒Background背景How can anagrams result from sequences of stack operations? There are two sequences of stack operators which can convert "TROT" to "TORT":怎样才能通过一系列的堆栈操作,将... 阅读全文
posted @ 2010-08-04 16:02 Devymex 阅读 (1969) 评论 (0) 编辑

摘要:Time limit: 3.000 seconds限时:3.000秒Background背景Some concepts in Mathematics and Computer Science are simple in one or two dimensions but become more complex when extended to arbitrary dimensions. Consi... 阅读全文
posted @ 2010-08-04 14:22 Devymex 阅读 (1634) 评论 (0) 编辑

摘要:Time limit: 3.000 seconds限时:3.000秒Background背景Bin packing, or the placement of objects of certain weights into different bins subject to certain constraints, is an historically interesting problem. So... 阅读全文
posted @ 2010-08-04 14:05 Devymex 阅读 (1969) 评论 (0) 编辑

摘要:Time limit: 3.000 second限时:3.000秒Background背景Many areas of Computer Science use simple, abstract domains for both analytical and empirical studies. For example, an early AI study of planning and robot... 阅读全文
posted @ 2010-08-04 14:01 Devymex 阅读 (8247) 评论 (0) 编辑

摘要:Time limit: 3.000 seconds限时:3.000秒Background背景Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an algorithm whose classification is not known for all possible inputs.计算 阅读全文
posted @ 2010-08-04 13:46 Devymex 阅读 (6015) 评论 (5) 编辑