2013年7月13日

EOJ 2743 Stock Exchange

摘要: EOJ 2743 http://acm.cs.ecnu.edu.cn/problem.php?problemid=2743本题为LIS:即Longest Increasing Sequence.(本题中严格递增)最长上升子序列(LIS)长度的O(nlogn)算法:(对状态转移时查找的优化) 用len[ i ]存放当前(需不断更新) 长度为 i 的上升子序列的末尾 的最小值, 注意到,len[]严格递增,可对其进行二分查找, 找到最大的i ,且满足len[ i ] 2 #include 3 #include 4 #include 5 #include 6 #include 7 ... 阅读全文

posted @ 2013-07-13 21:18 KimKyeYu 阅读(281) 评论(0) 推荐(0) 编辑

POJ-3468 A Simple Problem with Integers

摘要: http://poj.org/problem?id=3468第一次手写的线段树,以后就用这个做模板好了。自己风格的线段树:(区段更新 1 #define maxn 100005 2 #define ls(p) p=L && R>=r){37 t[p].f+=v;38 ... 阅读全文

posted @ 2013-07-13 01:30 KimKyeYu 阅读(314) 评论(0) 推荐(0) 编辑

导航