08 2016 档案

摘要:题目地址:http://poj.org/problem?id=1463 题目: Strategic game Time Limit: 2000MS Memory Limit: 10000K Total Submissions: 7929 Accepted: 3692 Description Bob 阅读全文
posted @ 2016-08-31 17:15 weeping 阅读(202) 评论(0) 推荐(0)
摘要:传送门:http://codeforces.com/problemset/problem/711/C 题目: C. Coloring Trees time limit per test 2 seconds memory limit per test 256 megabytes input stand 阅读全文
posted @ 2016-08-30 15:46 weeping 阅读(266) 评论(0) 推荐(0)
摘要:计算几何 目录 ㈠ 点的基本运算 1. 平面上两点之间距离 1 2. 判断两点是否重合 1 3. 矢量叉乘 1 4. 矢量点乘 2 5. 判断点是否在线段上 2 6. 求一点饶某点旋转后的坐标 2 7. 求矢量夹角 2 ㈡ 线段及直线的基本运算 1. 点与线段的关系 3 2. 求点到线段所在直线垂线的垂足 4 3. 点到线段的最近点 4 4. 点到线段所在直线的距离... 阅读全文
posted @ 2016-08-19 23:21 weeping 阅读(1455) 评论(0) 推荐(1)
摘要:/* * this code is made by crazyacking * Verdict: Accepted * Submission Date: 2015-08-19-21.48 * Time: 0MS * Memory: 137KB */ #include #include #include #include #include #include #include #inc... 阅读全文
posted @ 2016-08-19 12:57 weeping 阅读(286) 评论(0) 推荐(0)
摘要:题目地址:http://poj.org/problem?id=3903 题目: Description The world financial crisis is quite a subject. Some people are more relaxed while others are quite 阅读全文
posted @ 2016-08-18 00:02 weeping 阅读(312) 评论(0) 推荐(0)
摘要:#include #include #include using namespace std; typedef long long ll; ll mod_pow(ll x, ll n, ll p){ ll res = 1; while(n){ if(n & 1) res =res * x % p; x = x * x % p; ... 阅读全文
posted @ 2016-08-13 01:11 weeping 阅读(756) 评论(0) 推荐(1)
摘要:unsigned int BKDRHash(char*str) { unsigned int seed=131 ;// 31 131 1313 13131 131313 etc.. unsigned int hash=0 ; while(*str) { hash=hash*seed+(*str+... 阅读全文
posted @ 2016-08-10 20:54 weeping 阅读(1040) 评论(0) 推荐(0)
摘要:题目地址:http://poj.org/problem?id=3261 题目: Description Farmer John has noticed that the quality of milk given by his cows varies from day to day. On furt 阅读全文
posted @ 2016-08-08 23:36 weeping 阅读(961) 评论(0) 推荐(0)
摘要://求两圆相交的面积 #include #include #include #include #include #include #define esp 1e-8 using namespace std; struct Circle{ double x,y; double r; }p[3000]; int cmp(Circle ta,Circle tb) { retu... 阅读全文
posted @ 2016-08-08 14:01 weeping 阅读(515) 评论(0) 推荐(0)
摘要:后缀数组 DA(倍增)算法求 SA[N] 与 Rank[N] (时间O(NlogN),空间O(N)) sa[i] : 表示 排在第i位的后缀 起始下标 rank[i] : 表示后缀 suffix(i)排在第几 height[i] : 表示 sa[i-1] 与 sa[i] 的LCP 值 h[i]: 表 阅读全文
posted @ 2016-08-07 21:51 weeping 阅读(1367) 评论(0) 推荐(0)
摘要:kmp模板: 扩展kmp模板: 阅读全文
posted @ 2016-08-04 22:35 weeping 阅读(2361) 评论(0) 推荐(0)
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=2594 题目: Problem Description Homer: Marge, I just figured out a way to discover some of the talents we 阅读全文
posted @ 2016-08-04 00:01 weeping 阅读(154) 评论(0) 推荐(0)
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=2203 思路: Problem Description 人随着岁数的增长是越大越聪明还是越大越笨,这是一个值得全世界科学家思考的问题,同样的问题Eddy也一直在思考,因为他在很小的时候就知道亲和串如何判断 阅读全文
posted @ 2016-08-03 23:21 weeping 阅读(169) 评论(0) 推荐(0)
摘要:思路: 简单模拟下。从左向右扫描一次,求出挖出该区间空地的花费,并取个最小值即可。 至于怎么求区间内的高度最小值,就用线段树就好了。 阅读全文
posted @ 2016-08-03 23:05 weeping 阅读(251) 评论(0) 推荐(0)
摘要:思路:1.把所有有长度的剑看做点。Ai点是肯定要取。然后求另一把剑。 先对右区间排个序,然后每次看这个区间范围内有没有剑,如果没有就添加一把(值为右端点的剑); 如果有并且数量为1且这条龙的Ai等这把剑的长度的话,说用还需要一把剑,再添加一把。 否则不添加。 至于怎么查询某个区间有没有剑,可以用树状 阅读全文
posted @ 2016-08-03 23:02 weeping 阅读(567) 评论(0) 推荐(0)
摘要:思路:排个序,依次选就好了。 阅读全文
posted @ 2016-08-03 22:53 weeping 阅读(169) 评论(0) 推荐(0)
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=3746 题目: Problem Description CC always becomes very depressed at the end of this month, he has checked 阅读全文
posted @ 2016-08-03 22:49 weeping 阅读(155) 评论(0) 推荐(0)
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1686 题目: Problem Description The French author Georges Perec (1936–1982) once wrote a book, La disparit 阅读全文
posted @ 2016-08-02 22:56 weeping 阅读(451) 评论(0) 推荐(0)
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1711 题目: Problem Description Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2] 阅读全文
posted @ 2016-08-02 22:42 weeping 阅读(186) 评论(0) 推荐(0)
摘要:呃,从网上看的题解,然而其实有点地方还没搞懂,先放在这,以后再回来理解。 题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=4749 题目:2013 is the 60 anniversary of Nanjing University of Scienc 阅读全文
posted @ 2016-08-02 22:21 weeping 阅读(304) 评论(0) 推荐(0)