11 2018 档案

摘要:求逆序对数(10分) 求逆序对数(10分) 题目内容: 对于一个长度为N的整数序列A,满足i < j 且 Ai > Aj.的数对(i,j)称为整数序列A的一个逆序<j<=n且ai><j<=n且ai><j<=n且ai><j<=n且ai> 请求出整数序列A的所有逆序对个数 输入格式: 输入包含多组测试数 阅读全文
posted @ 2018-11-28 15:04 TobicYAL 阅读(611) 评论(0) 推荐(0)
摘要:描述 Farmer John completed his new barn just last week, complete with all the latest milking technology. Unfortunately, due to engineering problems, all 阅读全文
posted @ 2018-11-26 19:33 TobicYAL 阅读(302) 评论(0) 推荐(0)
摘要:描述 FJ has moved his K (1 <= K <= 30) milking machines out into the cow pastures among the C (1 <= C <= 200) cows. A set of paths of various lengths ru 阅读全文
posted @ 2018-11-26 19:29 TobicYAL 阅读(245) 评论(0) 推荐(0)
摘要:描述 As you know, all the computers used for ACM contests must be identical, so the participants compete on equal terms. That is why all these computers 阅读全文
posted @ 2018-11-23 18:19 TobicYAL 阅读(283) 评论(0) 推荐(0)
摘要:兔子与星空(10分) 题目内容: 很久很久以前,森林里住着一群兔子。兔子们无聊的时候就喜欢研究星座。如图所示,天空中已经有了n颗星星,其中有些星星有边相连。兔子们希望删除掉一些边,然后使得保留下的边仍能是n颗星星连通。他们希望计算,保留的边的权值之和最小是多少? 输入格式: 第一行只包含一个表示星星 阅读全文
posted @ 2018-11-20 15:41 TobicYAL 阅读(1029) 评论(0) 推荐(0)
摘要:描述 Consider the two networks shown below. Assuming that data moves around these networks only between directly connected nodes on a peer-to-peer basis 阅读全文
posted @ 2018-11-16 18:42 TobicYAL 阅读(260) 评论(0) 推荐(0)
摘要:描述 Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exch 阅读全文
posted @ 2018-11-16 18:38 TobicYAL 阅读(253) 评论(0) 推荐(0)
摘要:二叉树的深度(10分) 题目内容: 给定一棵二叉树,求该二叉树的深度 二叉树深度定义:从根结点到叶结点依次经过的结点(含根、叶结点)形成树的一条路径,最长路径的节点个数为树的深度 输入格式: 第一行是一个整数n,表示二叉树的结点个数。二叉树结点编号从1到n,根结点为1,n <= 10 接下来有n行, 阅读全文
posted @ 2018-11-13 15:28 TobicYAL 阅读(807) 评论(0) 推荐(0)
摘要:描述 Caocao was defeated by Zhuge Liang and ZhouYu in the battle of Chibi. But he wouldn't give up. Caocao's army still was not good at water battles, s 阅读全文
posted @ 2018-11-08 09:53 TobicYAL 阅读(353) 评论(0) 推荐(0)
摘要:描述 In order to make their sons brave, Jiajia and Wind take them to a big cave. The cave has n rooms, and one-way corridors connecting some rooms. Each 阅读全文
posted @ 2018-11-08 09:47 TobicYAL 阅读(321) 评论(0) 推荐(0)
摘要:描述 Every cow's dream is to become the most popular cow in the herd. In a herd of N (1 <= N <= 10,000) cows, you are given up to M (1 <= M <= 50,000) o 阅读全文
posted @ 2018-11-08 09:31 TobicYAL 阅读(293) 评论(0) 推荐(0)
摘要:题目内容: 我们知道如何按照三种深度优先次序来周游一棵二叉树,来得到中根序列、前根序列和后根序列。反过来,如果给定二叉树的中根序列和后根序列,或者给定中根序列和前根序列,可以重建一二叉树。本题输入一棵二叉树的中根序列和后根序列,要求在内存中重建二叉树,最后输出这棵二叉树的前根序列。 用不同的整数来唯 阅读全文
posted @ 2018-11-02 20:41 TobicYAL 阅读(2426) 评论(0) 推荐(0)