UVA
文章平均质量分 83
SIO__Five
这个作者很懒,什么都没留下…
展开
-
350 - Pseudo-Random Numbers
Pseudo-Random Numbers Computers normally cannot generate really random numbers, but frequently are used to generate sequences of pseudo-random numbers. These are generated by some algorithm, but a原创 2013-07-26 17:48:33 · 847 阅读 · 0 评论 -
10112 - Myacm Triangles
Problem B: Myacm TrianglesSource file:triangle.{c, cpp, java, pas}Input file:triangle.inOutput file:triangle.outThere has been considerable archeological work o原创 2013-07-28 13:41:11 · 944 阅读 · 0 评论 -
548 - Tree (UVa OJ)
Tree You are to determine the value of the leaf node in a given binary tree that is the terminal node of a path of least value from the root of the binary tree to any leaf. The value of a path is原创 2013-08-04 14:01:38 · 1176 阅读 · 0 评论 -
699 - The Falling Leaves
The Falling Leaves Each year, fall in the North Central region is accompanied by the brilliant colors of the leaves on the trees, followed quickly by the falling leaves accumulating under the tree原创 2013-08-07 22:16:38 · 1000 阅读 · 0 评论 -
327 - Evaluating Simple C Expressions
Evaluating Simple C Expressions The task in this problem is to evaluate a sequence of simple C expressions, buy you need not know C to solve the problem! Each of the expressions will appear on a l原创 2013-08-07 22:39:20 · 1036 阅读 · 0 评论 -
657 - The die is cast
The die is cast InterGames is a high-tech startup company that specializes in developing technology that allows users to play games over the Internet. A market analysis has alerted them to the fac原创 2013-08-07 22:59:41 · 940 阅读 · 0 评论 -
712 - S-Trees
S-Trees A Strange Tree (S-tree) over the variable set is a binary tree representing a Boolean function . Each path of the S-tree begins at the root node and consists of n+1 nodes. Each of the原创 2013-08-07 21:52:33 · 1222 阅读 · 0 评论 -
839 - Not so Mobile
Not so Mobile Before being an ubiquous communications gadget, a mobile was just a structure made of strings and wires suspending colourfull things. This kind of mobile is usually found hanging ove原创 2013-08-07 22:47:36 · 1256 阅读 · 0 评论 -
784 - Maze Exploration
Maze Exploration A maze of rectangular rooms is represented on a two dimensional grid as illustrated in figure 1a. Each point of the grid is represented by a character. The points of room walls ar原创 2013-08-12 10:48:33 · 1030 阅读 · 0 评论 -
10387 - Billiard
Problem A: BilliardIn a billiard table with horizontal side a inches and vertical side b inches, a ball is launched from the middle of the table. After s > 0 seconds the ball returns to the point原创 2013-07-28 13:30:09 · 922 阅读 · 0 评论 -
112 - Tree Summing
Tree Summing BackgroundLISP 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 fundamental da原创 2013-08-03 21:35:36 · 1045 阅读 · 0 评论 -
10392 - Factoring Large Numbers
Problem F: Factoring Large NumbersOne of the central ideas behind much cryptography is that factoring large numbers is computationally intensive. In this context one might use a 100 digit number t原创 2013-07-26 19:27:33 · 731 阅读 · 0 评论 -
10879 - Code Refactoring
Problem BCode RefactoringTime Limit: 2 seconds"Harry, my dream is a code waiting to bebroken. Break the code, solve the crime."Agent CooperSeveral algorithms in modern cryp原创 2013-07-26 19:28:59 · 758 阅读 · 0 评论 -
10250 - The Other Two Trees
Problem EThe Other Two TreesInput: standard inputOutput: standard outputTime Limit: 2 seconds You have a quadrilateral shaped land whose opposite fences are of equal length. You have four原创 2013-07-26 19:33:50 · 730 阅读 · 0 评论 -
579 - ClockHands
ClockHands The medieval interest in mechanical contrivances is well illustrated by the development of the mechanical clock, the oldest of which is driven by weights and controlled by a verge, an o原创 2013-07-26 19:37:40 · 737 阅读 · 0 评论 -
375 - Inscribed Circles and Isosceles Triangles
Inscribed Circles and Isosceles Triangles Given two real numbersBthe width of the base of an isosceles triangle in inchesHthe altitude of the same isosceles triangle in inchesCompute to原创 2013-07-27 11:16:10 · 1100 阅读 · 0 评论 -
540 - Team Queue
Team Queue Queues and Priority Queues are data structures which are known to most computer scientists. The Team Queue, however, is not so well known, though it occurs often in everyday life. At lu原创 2013-08-03 21:13:44 · 1225 阅读 · 0 评论 -
10050 - Hartals
Problem D: Hartals A social research organization has determined a simple set of parameters to simulate the behavior of the political parties of our country. One of the parameters is a positive in原创 2013-08-03 21:19:23 · 829 阅读 · 0 评论 -
297 - Quadtrees (UVa)
Quadtrees A quadtree is a representation format used to encode images. The fundamental idea behind the quadtree is that any image can be split into four quadrants. Each quadrant may again be split原创 2013-08-04 18:08:08 · 1216 阅读 · 0 评论 -
532 - Dungeon Master
Dungeon Master You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to原创 2013-08-12 10:52:28 · 982 阅读 · 0 评论 -
数据结构
先按照刘汝佳的算法竞赛入门经典中的分类整理一些题目,之后会陆陆续续的加上一些其他题目。原创 2014-01-17 14:15:28 · 891 阅读 · 0 评论 -
[UVA 10557] XYZZY (DFS + BFS 判环)
XYZZY题目链接:http://acm.bnu.edu.cn/bnuoj/problem_show.php?pid=2051题目大意:有一副有向图,每个顶点都有一个值。(顶点最多100)现在你从起点出发,能量初值为100,每到一个点,能量值要加上该点的值。如果相加之后能量值小于等于0,就算失败。问能否从起点成功的到达终点。(图中会出现环)解题思路:(DFS + BFS原创 2014-02-03 16:02:43 · 1075 阅读 · 0 评论 -
[UVA 10054] The Necklace (图的连通性 + 欧拉回路)
The Necklace题目链接:http://acm.bnu.edu.cn/bnuoj/problem_show.php?pid=18472题目大意:有一些珍珠(最多1000个),珍珠的两头有颜色(颜色最多50种,编号为1到50),现在问你能否将珍珠按照一定的规律串成一串项链?如果可以,则输出应该如何安排珍珠的先后顺序,否则输出不行。规律是:前一个珍珠的尾色必须和后一个珍珠的前色原创 2014-01-22 14:47:53 · 1122 阅读 · 0 评论 -
[UVA 11234] Expressions (二叉树的建立与层次遍历)
Expressions题目链接:http://acm.bnu.edu.cn/bnuoj/problem_show.php?pid=14332题目大意: 一个表达式,可以用栈来处理,同时可以用队列来处理。现在告诉你用栈处理的表达式顺序,求其用队列表示的顺序? 几种操作数为小写字母,操作符为大写字母。如输入:2xyPzwIMabcABdefgCDEF则输出原创 2014-01-17 22:22:39 · 1322 阅读 · 0 评论 -
大数加法 424 - Integer Inquiry
UVa OJRoot :: AOAPC I: Beginning Algorithm Contests (Rujia Liu) :: Volume 1. Elementary Problem Solving :: Big Number Integer Inquiry One of the first users of BI原创 2013-07-08 23:47:42 · 939 阅读 · 0 评论 -
大数乘法 10106 - Product
UVa OJRoot :: AOAPC I: Beginning Algorithm Contests (Rujia Liu) :: Volume 1. Elementary Problem Solving :: Big Number Product The ProblemThe problem is to multiply原创 2013-07-08 23:53:04 · 904 阅读 · 0 评论 -
大数加法 465 - Overflow
UVa OJRoot :: AOAPC I: Beginning Algorithm Contests (Rujia Liu) :: Volume 1. Elementary Problem Solving :: Big Number Overflow Write a program that reads an expression consis原创 2013-07-09 09:59:13 · 996 阅读 · 0 评论 -
大数乘法 748 - Exponentiation
UVa OJ Exponentiation Problems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxing ex原创 2013-07-09 11:14:33 · 916 阅读 · 0 评论 -
大数除法 10494 - If We Were a Child Again
Problem CIf We Were a Child AgainInput: standard inputOutput: standard outputTime Limit: 7 seconds “Oooooooooooooooh!If I could do the easy mathematics like my school days!!I原创 2013-07-09 15:52:32 · 918 阅读 · 0 评论 -
LA 3942 Remember the Word (Trie)
Remember the Word题目:链接题意:给出一个有S个不同单词组成的字典和一个长字符串。把这个字符串分解成若干个单词的连接(单词可以重复使用),有多少种方法?思路:令d[i]表示从字符i开始的字符串(后缀s[i..L])的分解数,这d[i] = sum{d(i+len(x)) | 单词x是其前缀}。然后将所有单词建成一个Trie树,就可以将搜索单词的复杂度降低原创 2014-08-12 20:30:30 · 921 阅读 · 0 评论 -
[UVA 705] Slash Maze (建图 + DFS)
Slash Maze题目链接:http://acm.bnu.edu.cn/bnuoj/problem_show.php?pid=17844题目大意:有一个斜的迷宫,如下图所示,其中有两个环,而最长的环为16格方格。题目就是给定一个斜的迷宫,问能否有环存在,如果存在,求出最长的环。解题思路:这道题目放了很久,之前一直不知道怎么建图。有想过把图放大两倍来原创 2014-02-03 16:23:23 · 1235 阅读 · 0 评论 -
[UVA 11205] The broken pedometer (二进制枚举)
The broken pedometer题目链接:http://acm.bnu.edu.cn/bnuoj/problem_show.php?pid=19623题目大意:7101 1 1 0 1 1 10 0 1 0 0 1 01 0 1 1 1 0 11 0 1 1 0 1 10 1 1 1 0 1 01 1 0 1 0 1 11 1 0 1 1 1 11 0原创 2014-02-03 19:16:35 · 1098 阅读 · 0 评论 -
[UVA 10305] Ordering Tasks (拓扑排序)
Ordering Tasks题目链接:http://acm.bnu.edu.cn/bnuoj/problem_show.php?pid=18723题目大意:有一些任务需要完成,其中有些任务必须比另一些任务先完成。让你按照完成时间的先后顺序对任务进行排序。解题思路:拓扑排序:搜索该图的顶点,把所有只有出度没有入度的点输出,然后把与这些点相连的点的入度减一。重复该过程即可同原创 2014-01-22 15:03:00 · 1123 阅读 · 0 评论 -
[UVA 10160] Servicing Stations (DFS回溯 + 剪枝)
Servicing Stations题目链接:http://acm.bnu.edu.cn/bnuoj/problem_show.php?pid=18578题目大意:在一个镇上有N个车站,其中有M条道路连通,现在需要在若干个车站装上服务站,而每一个服务站能够服务该站与该站直接相连的车站,问最少需要装多少服务站。解题思路:由于车站最多为35个。如果暴力枚举,2^35次肯原创 2014-02-03 21:16:03 · 929 阅读 · 0 评论 -
[UVA 196] Spreadsheet (DFS深搜 + 递推)
Spreadsheet题目链接:http://acm.bnu.edu.cn/bnuoj/problem_show.php?pid=17335题目大意:有一张类似于Excel的表格,其中编号如下: 现在在这些单元格中填入内容,可以为数字,也可以为字符串,其中字符串的格式必须为“=()+()……”。如以下一个例子:4 310 34 37 =A1+B1原创 2014-02-03 16:39:19 · 1187 阅读 · 0 评论 -
[UVA 10129] Play on Words (图的连通性 + 欧拉回路)
Play on Words题目链接: http://acm.bnu.edu.cn/bnuoj/problem_show.php?pid=18547题目大意:有N个单词(均为小写) (N最大为100000),现在要将它们按照一定的规律排成一行,为能否实现?规律是:前一个单词的最后一个字母必须是后一个单词的首字母,类似于单词接龙解题思路:这道题其实是一个欧拉道路问题,每原创 2014-01-22 14:26:09 · 1128 阅读 · 0 评论 -
[UVA 529] Addition Chains (迭代加深搜索)
题目链接:原创 2014-02-10 12:32:42 · 965 阅读 · 0 评论 -
[UVA 10562] Undraw the Trees (根据图形建立二叉树)
Undraw the Trees题目链接:http://acm.bnu.edu.cn/bnuoj/problem_show.php?pid=18980题目大意: 有一颗树用如下方式表示:2A|--------B C D| |--------- --E F G#e|----f g#其中,2表示样例数,每组样原创 2014-01-17 22:48:06 · 978 阅读 · 0 评论 -
[UVA 307] Sticks (DFS回溯 + 剪枝)
Sticks题目链接:http://acm.bnu.edu.cn/bnuoj/problem_show.php?pid=17446题目大意:有n根小木棍,长短不一,现在要求你将它们拼成一些长度一样的木棒,问拼成多少长度的木棒,可以得到最多的木棒数。如样例:95 2 1 5 2 1 5 2 1输出:6解题思路:这道题目很容易想到DFS回溯,关键是剪枝原创 2014-02-03 21:30:00 · 843 阅读 · 0 评论 -
[UVA 208] Firetruck (双向搜索)
Firetruck题目链接:http://acm.bnu.edu.cn/bnuoj/problem_show.php?pid=17347题目大意:消防车从起点1出发,到终点n。问有多少条路径(每个结点只能通过一次),将路径按照字典序输出。首先是一副无向图,结点数最大为21。如以下样例:61 21 33 43 54 65 62 32 40 0表示原创 2014-02-03 20:05:08 · 1031 阅读 · 0 评论