08 2018 档案
摘要:Problem Description There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this “How
阅读全文
摘要:先来一段代码压压惊: 想像一下对于一个字符串,如何求它的最长的回文子串,暴力的做法就是枚举每一个点然后往两边扩,但是这个算法的时间复杂度是O(n2)O(n^2)O(n2)时间很不进人意,于是就诞生了Manacher算法 Manacher 开始Manacher之前我们首先要准备两个变量maxr和mid
阅读全文
摘要:In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacen
阅读全文
摘要:Problem Description CC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there a
阅读全文
摘要:Describe 有一个神奇的盒子,它有N (2 <= N <= 1e5)个空间,这些空间依次编号为a1,…,aN (0 <= ai <= 1e9). 有x (2 <= x <= N)巧克力,如果多个巧克力放在一个空间就会爆炸。为了不让巧克力爆炸。我们需要使任意两个巧克力之间的最小距离尽可能的大,那
阅读全文
摘要:Hotel Description The cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a vacation on the sunny shores of Lake
阅读全文
摘要:题意: 五百年后,龙珠的数量会出乎意料地增加,因此孙悟空(吴)将所有的龙球聚集在一起太难了。 他的国家有N个城市,世界上正好有N个龙球。起初,对于第i个龙球,神圣的龙将把它放在第i个城市。长年以来,一些城市的龙球将被运往其他城市。为了挽救体力,吴孔计划采用飞行云中云,一种神奇的飞云收集龙珠。 每次武
阅读全文
摘要:Description 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 <=
阅读全文
摘要:Problem Description During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Gen
阅读全文
摘要:Vasya’s house is situated in a forest, and there is a mushroom glade near it. The glade consists of two rows, each of which can be divided into n cons
阅读全文
摘要:LCS 最长公共子序列,大神博客 在这里不再 一 一 赘述LCS,如果为小白请参见链接, 接下来谈一下LCS的路径回溯问题,大神的博客中已经提到了一种路径回溯的方法,我这里在提供一种以供选择 code: LIS 最长上升子序列, 大神博客 LIS重点是在第二种贪心加二分的求法,第三种着重掌握树状数组
阅读全文
摘要:01背包 01背包是所有背包的基础,很重要也很基础而且最重要的是有很多变形,能够运用得非常灵活,网上有很好的介绍01背包的博客我在这里就不写他的原理和详细步骤了,只是转载一下他们的博客,包括下面的完全背包,多维背包 等等,我想写这篇博客的主要目的是介绍背包的用法,当然了转载的博客是很基础的,因此小白
阅读全文
摘要:描述 给出一组长度为n的序列,a1a2a3......ana1a2a3......an求出这个序列长度为kk的严格递增子序列的个数 输入 第一行输入T组数据 T (0≤T≤10) 第二行输入序列大小n(1≤n≤100),长度k(1≤k≤n) 第三行输入n个数字 输出 数据规模很大, 答案请对1e9+
阅读全文
摘要:Multivariate function 描述 输入 第一行一个整数T,表示T组测试数据 (1≤T≤10). 每组数据第一行一个整数n(4≤n≤1000). 第二行 n个浮点数: X1,X2X3......Xn(1<=Xi<=1000000)X1,X2X3......Xn(1<=Xi<=10000
阅读全文
摘要:Mayor’s posters Description The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their
阅读全文
摘要:Description Building and maintaining roads among communities in the far North is an expensive business. With this in mind, the roads are build such th
阅读全文
摘要:Quoit Design Problem Description Have you ever played quoit in a playground? Quoit is a game in which flat rings are pitched at some toys, with all th
阅读全文
摘要:题目描述 某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统。但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能高于前一发的高度。某天,雷达捕捉到敌国的导弹来袭。由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹。 输入导弹依次飞来的高
阅读全文
摘要:Now give you an string which only contains 0, 1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9.You are asked to add the sign ‘+’ or ’-’ between the characters. Just like giv
阅读全文
摘要:Count Color Description Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get
阅读全文

浙公网安备 33010602011771号