- 博客(14)
- 资源 (2)
- 收藏
- 关注
原创 主席树模版
参考wuyiqi#include #include #include using namespace std;const int maxn = 100010;int ls[maxn*20], rs[maxn*20], sum[maxn*20];int T[maxn], tot;void build(int l, int r, int& rt){ rt = ++tot; s
2015-03-24 16:33:56 1508
原创 2013成都现场
A. Assignment For Princess构造题B. Beautiful Soup模拟 未ACC. Clumsy AlgorithmD. Dinner Coming Soon优先队列+DPE. Exhausted RobotF. Fibonacci Tree生成树G. GRE Words RevengeAC自动机未ACH. Hard Dis
2015-03-24 15:54:18 977
原创 2013杭州现场
A Lights Against Dudely爆搜B Stealing Harry Potter’s Precious状态压缩DPC Zhuge Liang’s Password签到题D Problem of ApolloniusE Random Number GeneratorF Infinite GoG AntsH Rabbit Kingdom离线+
2015-03-24 15:48:01 1082
原创 2013常春现场
A.Hard Code签到题B.Golden Radio Base根据给你的2个公式 转化成φ进制C.Little Tiger vs. Deep Monkey简单DPD.BathysphereE.Min-max-multiplyF.RP problemG.Mosaic2维线段树模版题H.TowerI.String字符串哈希J.Tri-war
2015-03-23 13:32:18 876
原创 扩展baby step giant step模版
#include #include #include #include using namespace std;typedef __int64 LL;LL gcd(LL a, LL b){ return b ? gcd(b, a%b) : a;}LL pow_mod(LL a, LL p, LL n){ LL ans = 1; while(p) { if(p&1)
2015-03-16 16:42:27 706
原创 BZOJ 2820 YY的GCD
#include #include #include using namespace std;typedef long long LL;const int maxn = 10000010;int mu[maxn], prime[maxn], vis[maxn], sum[maxn];int cnt;int a, b;void mobi(int n){ mu[1] = 1;
2015-03-11 15:04:10 751
原创 莫比乌斯模版
#include #include #include using namespace std;typedef long long LL;const int maxn = 100010;int mu[maxn], prime[maxn], vis[maxn];int cnt;int a, b, c, d, k;void mobi(int n){ mu[1] = 1; for(
2015-03-11 14:44:29 763
原创 Codeforces Round #291 (Div. 2)
A简单题B简单题C求改变一个字母的单词是否出现过字典树+dfsDk次射击 每次可以把一列都减小1 总共m列 m列都为0就被破坏掉 问最多连续多少个被破坏掉二分答案 在用数据结构询问某一段的最大值E每个节点都n个儿子 并且距离告诉你 无限延伸 问你距离根不超过x的节点有几个dp[i]为距离根i的数量 dp[i] = dp[i-1]*sum[1]+dp[
2015-03-07 14:22:34 678
原创 Codeforces Round #292 (Div. 1)
A简单题B用1*2的砖块铺满所有的点 方案数是否唯一消去度数为1的 直到不能消为止 还有点就是无解或者不唯一C求任意两个端点u,v, 2 * h[u] + 2 * h[v] + d[u] + d[u+1] + ... +d[v]的最大值转换a[i] = 2*h[i]+(d[1]+d[2]+...+d[i])b[i]= 2*h[i]-(d[1]+d[2]+...+
2015-03-07 14:06:49 548
原创 Codeforces Round #293 (Div. 2)
A简单题B简单题C简单题D简单期望E求最小的sum(|a[i]|) 使得每连续k个a[i]之和组成的新序列单调递增显然a[i]找到一段连续的?和左端点和右端点 贪心即可#include #include #include typedef __int64 LL;int a[100010], b[100010], c[100010];int n
2015-03-07 12:38:54 614
原创 Codeforces Round #294 (Div. 2)
A简单题B简单题C简单题D简单题E 一棵树 给你2个点 求树上有多少个点到这两个点的距离相等#include #include #include using namespace std;const int maxn = 100010;int anc[maxn][20];int fa[maxn], L[maxn], sum[maxn];
2015-03-04 14:27:05 607
原创 Codeforces Round #295 (Div. 1)
A简单题B有m个方块 每个方块有一个值 并且是堆起来稳定的 一个方块可以拿掉当且仅当剩下的还是稳定的 双方轮流拿 从左到右放组成一个m进制的数#include #include #include #include #include #include using namespace std;const __int64 mod = 1000000009;struct
2015-03-03 13:17:02 692
原创 SGU 131.Hardwood floor 状态压缩DP
#include #include typedef __int64 LL;LL dp[10][1<<10];int n, m;int st, flag;void dfs(int i, int s, int ns, int j, LL num){ if(j == m) { dp[i+1][ns] += num; return; } if((s&(1<<j)) == 0)
2015-03-02 14:27:19 1040
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人