上一页 1 ··· 5 6 7 8 9

2014年4月13日

next_permutation函数

摘要: 这是一个求一个排序的下一个排列的函数,可以遍历全排列,要包含头文件与之完全相反的函数还有prev_permutation(1) int 类型的next_permutationint main(){int a[3];a[0]=1;a[1]=2;a[2]=3;do{cout> ch;sort(ch, c... 阅读全文

posted @ 2014-04-13 22:57 52Cyan 阅读(112) 评论(0) 推荐(0)

the Triangle

摘要: 思路就是建立一个数组,由下向上动态规划,保存页子节点到当前节点的最大值#include#includeusing namespace std;int main(){ int t,i,j,b[100][100]; while(cin>>t) { for(i=0;i>b[i][j... 阅读全文

posted @ 2014-04-13 22:09 52Cyan 阅读(107) 评论(0) 推荐(0)

单调递增最长子序列

摘要: 地址:http://acm.nyist.net/JudgeOnline/problem.php?pid=17题目分析:同NYOJ 79拦截导弹先解释下什么叫子序列。若a序列删去其中若干个元素后与b序列完全相同,则称b是a的子序列。我们假定存在一个单调序列{An}(以递增序列为例),现在在其后面添加一... 阅读全文

posted @ 2014-04-13 20:22 52Cyan 阅读(133) 评论(0) 推荐(0)

上一页 1 ··· 5 6 7 8 9

导航