poj2533 LIS
来源:互联网 发布:unity3d 性能分析 编辑:程序博客网 时间:2024/05/12 13:30
/************************************************ *Author :jibancanyang *Created Time :一 4/ 4 01:43:38 2016 *题目类型:水.*************************************************/#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>#include <vector>#include <queue>#include <set>#include <map>#include <string>#include <cmath>#include <cstdlib>#include <ctime>#include <stack>using namespace std;typedef pair<int, int> pii;typedef long long ll;typedef unsigned long long ull;vector<int> vi;#define xx first#define yy second#define sa(n) scanf("%d", &(n))#define rep(i, a, n) for (int i = a; i < n; i++)#define vep(c) for(decltype((c).begin() ) it = (c).begin(); it != (c).end(); it++) const int mod = int(1e9) + 7, INF = 0x3fffffff, maxn = 1e5 + 12;int dp[maxn / 100], a[maxn / 100];int main(void){#ifdef LOCAL //freopen("in.txt", "r", stdin); //freopen("out.txt", "w", stdout);#endif cin.sync_with_stdio(false); int n; while (cin >> n) { rep (i, 0, n) cin >> a[i], dp[i] = 1; rep (i, 1, n) { for (int j = i - 1; j >= 0; j--) { if (a[i] > a[j]) dp[i] = max(dp[i], dp[j] + 1); } } int ans = 0; rep (i, 0, n) ans = max(ans, dp[i]); cout << ans << endl; } return 0;}
0 0
- poj2533--LIS
- poj2533(LIS)
- poj2533 LIS
- POJ2533(LIS)
- poj2533 简单DP LIS
- POJ2533 LIS模板题
- poj2533,LIS问题(n^2)
- POJ2533:Longest Ordered Subsequence(LIS)
- POJ2533:Longest Ordered Subsequence(LIS)
- POJ2533-Longest Ordered Subsequence(LIS)
- POJ2533:Longest Ordered Subsequence(LIS) 动态规划
- poj2533
- POJ2533
- poj2533
- poj2533
- poj2533
- POJ2533
- poj2533
- 用 Console 实现 Web Server 支持上传文件组件 plupload
- 每天laravel-20160703|ClearCommand
- 两年后,再议“站内信”的实现
- 正则表达式使用
- 光标形状汇总
- poj2533 LIS
- boa安装注意
- [POJ 2391]Ombrophobic Bovines[最大流][二分答案]
- 使用ToolRunner运行Hadoop程序基本原理分析
- poj1458 LCS
- C#像QQ一样隐藏窗体
- 全国和国际天气预报API免费接口
- 3.7.4 event_request_timer:安排定时事件
- Spring源代码解析(二):IoC容器在Web容器中的启动