- 博客(52)
- 收藏
- 关注
原创 【强连通分量】 HDOJ 1269 迷宫城堡
tarjan模板题。。。#include #include #include #include #include #include #include #include #include #include #include #include #include #define maxn 10005#define maxm 1000
2014-07-25 19:19:31 498
原创 【主席树】 HDOJ 4866
将所有目标与起点线的距离离散化作为下标,建立函数式线段树,将距离按区间端点从1到X的顺序加入函数式线段树,左端点+1,右端点-1,记录区间元素的距离和,以及元素的个数。对于在x位置的询问,找到其对应的端点,这个可以二分找到,然后在该端点对应的线段树上进行二分查找求解,最后判断前一个答案与P的大小得到当前问题的答案。
2014-07-24 11:52:25 447
原创 【杂题】 codeforces 449A Jzzhu and Chocolate
附一份CF给出的题解。。。。。We assume that n ≤ m (if n > m, we can simply swap n and m).If we finally cut the chocolate into x rows and y columns (1 ≤ x ≤ n, 1 ≤ y ≤ m, x + y = k + 2), we should maxi
2014-07-21 15:37:25 604
原创 【treap tree】 HDOJ 3726 && LA 5031 && UVA 1479 Graph and Queries
在线转离线。。先构建出
2014-07-21 14:04:40 591
原创 【杂题】 codeforces 448D Multiplication Table
简单二分。。比赛时没想到。。#include #include #include #include #include #include #include #include #include #include #include #include #define maxn 1000005#define eps 1e-10#defi
2014-07-18 10:59:39 562
原创 【数论】 HDOJ 1930 && ZOJ 2945 And Now, a Remainder from Our Sponsor
中国剩余定理的简单应用。。。给你
2014-07-17 16:54:26 704 2
原创 【中国剩余定理模板】
LL a[maxn], b[maxn], n;void extend_gcd(LL a, LL b, LL &d, LL &x, LL &y){ if(b == 0) { d = a, x = 1, y = 0; } else { extend_gcd(b, a%b, d, y, x), y -= x*(a/b); }}void extend_chinese_reminde
2014-07-17 14:58:42 652
原创 【后缀数组】 HDOJ 2459 && POJ 3693 Maximum repetition substring
这道题在后缀数组的那篇神论文中
2014-07-15 23:16:30 605
原创 【后缀数组】 POJ 1743 Musical Theme
后缀数组+二分,和上一题类似,比较简单。#include #include #include #include #include #include #include #include #include #include #include #include #include #include #define ma
2014-07-10 21:28:57 464
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人