![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
递归
陶鸿杰
这个作者很懒,什么都没留下…
展开
-
快速排序
明天要面试,听说会考快速排序,预习一下/*选在一个基准数,比它小的在它的左边,比它大的在它的右边。(分治)然后再对左右两部分进行上面的操作一直到最后时间复杂度O(n^2)到O(nlogn)不是稳定的排序方式*/#include<bits/stdc++.h>using namespace std;void QuickSOrt(int a[], int start, int last){ if(start>=last) return ; i原创 2020-07-05 23:53:51 · 315 阅读 · 2 评论 -
Hex-a-bonacci ————记忆化搜索
Given a code (not optimized), and necessary inputs, you have to find the output of the code for the inputs. The code is as follows:int a, b, c, d, e, f;int fn( int n ) { if( n == 0 ) return a...原创 2018-08-10 14:49:14 · 294 阅读 · 0 评论 -
FatMouse and Cheese ————记忆化搜索
FatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <= p < n and 0 <= q < n. At each grid lo...原创 2018-08-10 14:54:16 · 162 阅读 · 0 评论 -
HDU 2011 How Many Equations Can You Find ——————DFS
How Many Equations Can You FindTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1477 Accepted Submissi...原创 2018-09-07 10:13:14 · 138 阅读 · 0 评论 -
HDU 1269迷宫城堡——————强连通模板(Kosaraju算法)
Summer HolidayTime Limit: 10000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4952 Accepted Submission(s): 2205Problem DescriptionTo see a World in a Gr...原创 2019-05-14 18:49:29 · 192 阅读 · 0 评论 -
POJ 2186 Popular Cows——————(Kosaraju求强连通分量,缩点)
Popular CowsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 42216 Accepted: 17135DescriptionEvery cow’s dream is to become the most popular cow in the herd. In a herd of N (1 <= N &...原创 2019-05-14 18:57:20 · 197 阅读 · 0 评论 -
HDU 1827 Summer Holiday——————(Kosaraju求强连通分量,缩点)
Summer HolidayTime Limit: 10000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4954 Accepted Submission(s): 2207Problem DescriptionTo see a World in a Gr...原创 2019-05-14 19:00:28 · 183 阅读 · 0 评论 -
HDU 2767 Proving Equivalences——————Kosaraju求强连通分量
Proving EquivalencesProblem DescriptionConsider the following exercise, found in a generic linear algebra textbook.Let A be an n × n matrix. Prove that the following statements are equivalent:A i...原创 2019-05-15 18:32:16 · 173 阅读 · 0 评论 -
HDU 3836Equivalent Sets——————Kosaraju求强连通分量
Equivalent SetsProblem DescriptionTo prove two sets A and B are equivalent, we can first prove A is a subset of B, and then prove B is a subset of A, so finally we got that these two sets are equiva...原创 2019-05-15 20:45:42 · 164 阅读 · 0 评论 -
HDU - 1312 Red and Black————搜索
There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can’...原创 2018-08-05 10:12:22 · 387 阅读 · 0 评论 -
Ultra-QuickSort ————分治
n this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the sequence is sorted in...原创 2018-08-03 21:05:02 · 220 阅读 · 0 评论 -
HDU2041超级楼梯(递归)(简单动态规划)(斐波那契)
超级楼梯Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 71947 Accepted Submission(s): 36678Problem Description有一楼梯共M级,刚开始时你在第一级,若每次只能跨上一级或二级,要走上第...原创 2018-05-06 22:21:38 · 462 阅读 · 0 评论 -
HDU 2045 LELE的RPG难题 (递归) or(动归)
不容易系列之(3)—— LELE的RPG难题Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 62635 Accepted Submission(s): 24959Problem Description人称“AC女之杀手”的超级偶像LE...原创 2018-05-07 14:11:51 · 449 阅读 · 0 评论 -
HDU_2046骨牌铺方格 (斐波那契) (动归初步)
骨牌铺方格Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 61822 Accepted Submission(s): 29913Problem Description在2×n的一个长方形方格中,用一个1× 2的骨牌铺满方格,输入n ,...原创 2018-05-07 14:23:55 · 194 阅读 · 0 评论 -
HDU_2047阿牛的EOF牛肉串 (找规律+递归)
阿牛的EOF牛肉串Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 42877 Accepted Submission(s): 20176Problem Description今年的ACM暑期集训队一共有18人,分为6支队伍。其中有一个...原创 2018-05-07 16:13:36 · 274 阅读 · 0 评论 -
HDU_2048 神、上帝以及老天爷 (错排公式)
神、上帝以及老天爷Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 48315 Accepted Submission(s): 19581Problem DescriptionHDU 2006'10 ACM contest的颁奖晚会隆重...原创 2018-05-07 16:47:25 · 228 阅读 · 0 评论 -
HDU_2049考新郎 ( 错排)
不容易系列之(4)——考新郎Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 44888 Accepted Submission(s): 16447Problem Description国庆期间,省城HZ刚刚举行了一场盛大的集体婚礼,为...原创 2018-05-07 17:00:58 · 191 阅读 · 0 评论 -
HDU 2050折线分割平面(递推)
折线分割平面Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 36479 Accepted Submission(s): 24442Problem Description我们看到过很多直线分割平面的题目,今天的这个题目稍微有些变化,我们...原创 2018-05-07 17:07:04 · 222 阅读 · 0 评论 -
最长公共子序列(打印路径)(51Nod1006)
1006 最长公共子序列Lcs 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注给出两个字符串A B,求A与B的最长公共子序列(子序列不要求是连续的)。比如两个串为: abcicbaabdkscab ab是两个串的子序列,abc也是,abca也是,其中abca是这两个字符串最长的子序列。Input第1行...原创 2018-05-16 19:40:42 · 485 阅读 · 0 评论 -
HDU2044一只小蜜蜂...(递归)
一只小蜜蜂...Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 90448 Accepted Submission(s): 32139Problem Description有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房,不能反向爬行。请编...原创 2018-05-06 22:09:23 · 929 阅读 · 0 评论