1. 动态规划,使用一个数组保存当前的最大递增子序列长度,时间复杂度为O(N^2) # include <iostream> # include <cstdlib> # include <climits> using namespace std; int longestsub(int a[],int ...
分类:
其他好文 时间:
2017-06-28 19:01:18
阅读次数:
144
链接:http://poj.org/problem?id=2533 Longest Ordered Subsequence Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 38875 Accepted: 17066 Descrip ...
分类:
其他好文 时间:
2017-06-06 14:21:49
阅读次数:
134
UCloud 的安全秘钥(困难) 1200ms 262144K 每个 UCloud 用户会构造一个由数字序列组成的秘钥,用于对服务器进行各种操作。作为一家安全可信的云计算平台,秘钥的安全性至关重要。因此,UCloud 每年会对用户的秘钥进行安全性评估,具体的评估方法如下: 首先,定义两个由数字序列组 ...
分类:
其他好文 时间:
2017-06-04 00:13:36
阅读次数:
278
#include<cstdio> #include<cmath> #include<climits> #include<algorithm> #define INF 1000000000 using namespace std; struct p { double x,y; }spot[110]; ...
分类:
其他好文 时间:
2017-05-13 12:31:39
阅读次数:
129
题目链接:http://ac.jobdu.com/problem.php?pid=1077 详解链接:https://github.com/zpfbuaa/JobduInCPlusPlus 参考代码: ...
分类:
其他好文 时间:
2017-05-03 19:11:46
阅读次数:
238
这题对我真的非常难。实在做不出来,就去百度了,搜到了一种状压DP的方法。这是第一种 详细见凝视 #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #include <climits> #include ...
分类:
其他好文 时间:
2017-04-28 23:48:46
阅读次数:
207
一种挺简单的做法,欧拉标准算法,贴上程序 vvvvvv #include<iostream> #include<cstring> #include<string> #include<fstream> #include<queue> #include<climits> #include<vector> ...
分类:
其他好文 时间:
2017-03-15 14:44:31
阅读次数:
241
题意:有N个人M个房间,初始时所有人都在1号房间,维护:1、让某个人去某个房间 2、假如[l,r]中所有的人还未一起统计过,Ans+=人数。输出Ans 题解: 集合HASH get 根据异或的性质,a^x^x=a,因此一个集合的HASH值就是其所有元素的异或起来的值 接下来就是STL大法好 将每个房 ...
分类:
其他好文 时间:
2017-03-01 00:09:05
阅读次数:
317
题意:给定一张有N个点的有向图,求0到N-1长度为T的路径的总条数。 题解:把长度为K的边拆成K条长度为1的边,然后建出邻接矩阵快速幂裸上。 #include <cstdio> #include <cstring> #include <cstdlib> #include <climits> #inc ...
分类:
其他好文 时间:
2017-02-26 12:47:12
阅读次数:
233
参考:挑战程序设计竞赛·[第二版] 169页 线段树是一颗区间树,也是一颗满二叉树 实现代码: ...
分类:
其他好文 时间:
2017-02-12 17:03:48
阅读次数:
207