摘要: cycleke神说要用半平面交(其实他也用的凸包),把我吓了一跳,后来发现(看题解)其实可以先按斜率排序,再将最小的两条线入栈,如果其与栈顶元素的交点在上一个点的左边,则将栈顶元素出栈。这是一个开口向上的半凸包。 c++ include include include include include 阅读全文
posted @ 2016-11-04 08:29 chenhaowen 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1080 神暴力,待搞懂. 代码 阅读全文
posted @ 2016-10-22 11:55 chenhaowen 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 【题目描述】 lxhgww最近收到了一个01序列,序列里面包含了n个数,这些数要么是0,要么是1,现在对于这个序列有五种变换操作和询问操作: 0 a b 把[a, b]区间内的所有数全变成0 1 a b 把[a, b]区间内的所有数全变成1 2 a b 把[a,b]区间内的所有数全部取反,也就是说把 阅读全文
posted @ 2016-10-22 11:44 chenhaowen 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 传送门 :http://www.lydsy.com/JudgeOnline/problem.php?id=3223 splay区间翻转的基础题,然而我还是调了一晚上(蒟蒻的悲哀) c++ include include include include include using namespace 阅读全文
posted @ 2016-10-22 11:42 chenhaowen 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://poj.org/problem?id=1636 题意:有两个监狱,每个监狱有n个人,有m种关系,表示A监狱第i个人不能跟B监狱第j个人在一个监狱,问你最多能换几组人(从A,B监狱互换一个人,ans include include using namespace std; str 阅读全文
posted @ 2016-10-22 11:31 chenhaowen 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 题目: 有n个木块排成一行,从左到右依次编号为1~n。你有k种颜色的油漆,其 中第i 种颜色的油漆足够涂ci 个木块。所有油漆刚好足够涂满所有木块,即c1+c2+…+ck=n。相邻两个木块涂相同色显得很难看,所以你希望统计任意两个相邻木块颜色不同的着色方案。 输入输出格式 输入格式: 第一行为一个正 阅读全文
posted @ 2016-10-22 11:30 chenhaowen 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=3223 思路:15?好,状压,OK. 这是转移方程 if((s[k]&j)==s[k]) f[i][j]+=max(f[i+1][j],f[i+1][j|1 include include in 阅读全文
posted @ 2016-10-21 22:19 chenhaowen 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://poj.org/problem?id=2774 裸的后缀数组,我只是为了贴个版而已 代码 c++ include include include include include define ll long long define mod 1000000007 using na 阅读全文
posted @ 2016-10-21 22:18 chenhaowen 阅读(77) 评论(0) 推荐(0) 编辑
摘要: 原博客http://blog.csdn.net/chen20000804/ 手动搬了几篇博客,总结性的和水的题就没有搬了. 阅读全文
posted @ 2016-10-21 22:15 chenhaowen 阅读(107) 评论(0) 推荐(0) 编辑