随笔分类 - vj刷题练习
刷题练习
摘要:输入一个数n,按照字典顺序从小到大打印出(1-n)的全排列。两个序列的字典序大小关系等价于从头开始第一个不相同位置处的大小关系。 Input 正整数n(1<=n<=7)。 Output 按照字典顺序从大到小打印全排列。每个样例之间有一个空格 Sample Input 1 2 3 4 Output 1
阅读全文
摘要:A ring is composed of n (even number) circles as shown in diagram. Put natural numbers 1*,2,...,n* into each circle separately, and the sum of numbers
阅读全文
摘要:A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits eac
阅读全文
摘要:Little Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital letters in t
阅读全文
摘要:A Strange Tree (S-tree) over the variable set Xn = {x1*,x2,...,xn*} is a binary tree representing a Boolean function f : {0*,1}n → {0,*1}. Each path o
阅读全文
摘要: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
阅读全文
摘要:In this problem, a dictionary is collection of key-value pairs, where keys are lower-case letters, and values are non-negative integers. Given an old
阅读全文
摘要:The word “search engine” may not be strange to you. Generally speaking, a search engine searches the web pages available in the Internet, extracts and
阅读全文
摘要:In this problem, we consider a simple programming language that has only declarations of onedimensional integer arrays and assignment statements. The
阅读全文
摘要:In order to understand early civilizations, archaeologists often study texts written in ancient languages. One such language, used in Egypt more than
阅读全文
摘要: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 quadran
阅读全文
摘要:The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of
阅读全文
摘要: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 o
阅读全文
摘要:Before being an ubiquous communications gadget, a mobile was just a structure made of strings and wires suspending colourfull things. This kind of mob
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Trees are fundamental in many branches of computer science (Pun definitely intended). Current stateof-the art parallel computers such as Thinking Mach
阅读全文
摘要:Background from Wikipedia: “Set theory is a branch of mathematics created principally by the German mathematician Georg Cantor at the end of the 19th
阅读全文
摘要:Most crossword puzzle fans are used to anagrams — groups of words with the same letters in different orders — for example OPTS, SPOT, STOP, POTS and P
阅读全文
摘要:Many areas of Computer Science use simple, abstract domains for both analytical and empirical studies. For example, an early AI study of planning and
阅读全文