POJ 1887 Testing the CATCHER[最长非升子序列O(nlog(n))]
2010-07-13 09:34
337 查看
题型:同Poj 1631.
思路:注意非升子序列需要考虑相等的情况,在二分的时候需要注意。
思路:注意非升子序列需要考虑相等的情况,在二分的时候需要注意。
if (x > best[0]) { best[0] = x; continue; } if (x <= best[sol-1]) { //key best[sol++] = x; continue; } int low = 0, high = sol-1, mid, ans; while (low <= high) { //key mid = (low+high)/2; if (best[mid] < x) { high = mid - 1; ans = mid; }else if (best[mid] > x) { low = mid + 1; }else { low = mid + 1; ans = mid; } } best[ans] = x;
相关文章推荐
- 【最长非升子序列】北大 POJ 1887 Testing the CATCHER
- POJ 1887 Testing the CATCHER(最长非升子序列)
- POJ-1887-Testing the CATCHER-最长递减子序列-DP动态规划
- poj 1887 Testing the CATCHER 最长不升子序列
- POJ 1887 Testing the CATCHER 最长不下降序列(LIS)问题
- POJ 1887 Testing the CATCHER(最长递减子序列)
- POJ 1887 Testing the CATCHER(LIS的反面 最大递减子序列)
- POJ 1887 Testing the CATCHER(最长下降子序列)
- poj 1887 Testing the CATCHER(最长递增子序列)
- POJ-1887 Testing the CATCHER(dp,最长下降子序列)
- POJ 1887 Testingthe CATCHER (LIS:最长下降子序列)
- POJ-1887 Testing the CATCHER(dp,最长下降子序列)
- POJ-1887-Testing the CATCHER【最长不上升子序列nlogn】
- Testing the CATCHER - POJ 1887 最长递减子序列
- poj 1887 Testing the CATCHER_最长上升子序列
- POJ 1887-Testing the CATCHER(dp_最长下降子序列)
- POJ 1887 —— Testing the CATCHER 最长下降子序列
- poj 1887 Testing the CATCHER_最长上升子序列
- POJ 1887:Testing the CATCHER 求递减序列的最大值
- POJ 1887:Testing the CATCHER 求递减序列的最大值