![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
algorithm
IYreality
HELLO WORLD
展开
-
无重复组合
给定一个无重复的字符串,输出长度为3的无重复的所有组合情况:暴力穷举:#include<iostream>using namespace std;bool notEqual(int i,int j,int k){ if(i==j || i==k || j==k) return false; return true;}int main(...原创 2019-07-03 10:20:41 · 202 阅读 · 0 评论 -
暴力搜索
给出X,YX 代表 m,n 的最小公约数,Y代表m,n的最小公倍数求出m,n:ANS1:#include<iostream>using namespace std;int main(){ int x,y; cin >> x >> y; int m,n; // y = m*n/x; //so...原创 2019-07-03 09:20:37 · 107 阅读 · 0 评论 -
1035 DNA matching
DescriptionDNA (Deoxyribonucleic acid) is founded in every living creature as the storage medium for genetic information. It is comprised of subunits called nucleotides that are strung togethe...原创 2019-06-23 21:04:25 · 171 阅读 · 0 评论 -
1027. MJ, Nowhere to Hide
1027. MJ, Nowhere to HideConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionOn BBS, there is a familiar term called MJ (short for MaJia), which means another BBS ID of one person ...原创 2019-06-23 19:46:09 · 177 阅读 · 0 评论 -
斯坦纳树问题
斯坦纳树典型例题https://wenku.baidu.com/view/32769df17c1cfad6195fa7a0.html状态转移方程https://www.cnblogs.com/tgycoder/p/5037559.html动态规划总结 详细原创 2019-06-16 12:44:59 · 667 阅读 · 0 评论 -
1020 big integer
按照题目的输出输出直接理解就是用一些互质的数作为基数表示一个很长的数字,这个很长的数字要用string或者char []表示。如果这个大数字是Int,则下面的代码就可以解决问题:#include<iostream>using namespace std;int main(){ int T,x[101]; cin >> T; w...原创 2019-06-20 14:23:48 · 117 阅读 · 0 评论 -
拓扑排序
在图论中,拓扑排序(Topological Sorting)是一个有向无环图(DAG, Directed Acyclic Graph)的所有顶点的线性序列。且该序列必须满足下面两个条件:每个顶点出现且只出现一次。若存在一条从顶点 A 到顶点 B 的路径,那么在序列中顶点 A 出现在顶点 B 的前面。有向无环图(DAG)才有拓扑排序,非DAG图没有拓扑排序一说。什么是拓扑排序拓扑排序...原创 2019-06-16 12:44:03 · 296 阅读 · 0 评论 -
动态规划专项复习
入门进阶讲的很好!!!!第一题:钢条切割问题:Serling公司购买长钢条,将其切割为短钢条出售。切割工序本身没有成本支出。公司管理层希望知道最佳的切割方案。假定我们知道Serling公司出售一段长为i英寸的钢条的价格为pi(i=1,2,…,单位为美元)。钢条的长度均为整英寸。图15-1给出了一个价格表的样例。钢条切割问题是这样的:给定一段长度为n英寸的钢条和一个价格表pi...原创 2019-06-16 12:44:25 · 244 阅读 · 0 评论 -
斐波拉契数列
递归解法:#include<iostream>using namespace std;int f[100];int fib(int n){ if(n==0) return 0; if(n==1) return 1; return fib(n-1)+fib(n-2);}int main(){ int n; while(cin...原创 2019-06-20 10:00:30 · 252 阅读 · 0 评论 -
最大子序列和的问题
一,问题描述给定(可能有负数)n个整数,求该序列连续子序列的最大值。为方便起见,若所有的整数为负数,则最大子序列和为0.也就是:在一系列整数中,找出连续的若干个整数,这若干个整数之和 最大。二,解法解法1:#include<iostream>using namespace std;void max(int *a,int n);int main(){ in...原创 2018-11-28 15:08:04 · 162 阅读 · 0 评论