会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
HocRiser
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
···
44
下一页
2019年5月1日
[Luogu5319][BJOI2019]奥术神杖(分数规划+AC自动机)
摘要: 对最终答案取对数,得到$\ln(Ans)=\frac{1}{c}\sum \ln(v_i)$,典型的分数规划问题。二分答案后,对所有咒语串建立AC自动机,然后套路地$f[i][j]$表示走到T的第i个字符,当前在自动机的第j个位置,能得到的最大收益。注意二分的r初始不能设太大,25就可以了,二分终止
阅读全文
posted @ 2019-05-01 10:34 HocRiser
阅读(193)
评论(0)
推荐(0)
2019年4月29日
Forethought Future Cup - Elimination Round
摘要: A.最长不会超过a的个数的两倍-1。 1 #include<cstdio> 2 #include<cstring> 3 #include<iostream> 4 #include<algorithm> 5 #define rep(i,l,r) for (int i=(l); i<=(r); i++)
阅读全文
posted @ 2019-04-29 19:03 HocRiser
阅读(179)
评论(0)
推荐(0)
2019年4月28日
莫比乌斯反演笔记
摘要: 经典问题(以下全部默认$n\leqslant m$):$\sum\limits_{i=1}^n\sum\limits_{j=1}^{m}gcd(i,j)=\sum_{d=1}^n\varphi(d)\lfloor\frac{n}{d}\rfloor\lfloor\frac{m}{d}\rfloor$
阅读全文
posted @ 2019-04-28 17:43 HocRiser
阅读(181)
评论(0)
推荐(0)
2019年4月25日
Codeforces Round 554 (Div.2)
摘要: A.奇数配偶数。 1 #include<cstdio> 2 #include<cstring> 3 #include<iostream> 4 #include<algorithm> 5 #define rep(i,l,r) for (int i=(l); i<=(r); i++) 6 typedef
阅读全文
posted @ 2019-04-25 19:14 HocRiser
阅读(140)
评论(0)
推荐(0)
Educational Codeforces Round 63 (Div.2)
摘要: A.若存在解则一定存在某个i使得a[i]>a[i+1],翻转它即可。 1 #include<cstdio> 2 #include<cstring> 3 #include<iostream> 4 #include<algorithm> 5 #define rep(i,l,r) for (int i=(
阅读全文
posted @ 2019-04-25 19:04 HocRiser
阅读(133)
评论(0)
推荐(0)
2019年4月22日
Tenka1 Programmer Contest 2019
摘要: A.一定是前半段白后半段黑,枚举分界点预处理前后缀和。 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 #include<iostream> 5 #define rep(i,l,r) for (int i=(l); i<=
阅读全文
posted @ 2019-04-22 20:38 HocRiser
阅读(166)
评论(0)
推荐(0)
2019年4月20日
Codeforces Hello 2019
摘要: A.直接判。 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 #include<iostream> 5 #define rep(i,l,r) for (int i=(l); i<=(r); i++) 6 typedef l
阅读全文
posted @ 2019-04-20 11:42 HocRiser
阅读(133)
评论(0)
推荐(0)
2019年4月19日
二进制分组
摘要: 二进制分组思想很简单,就是把下标拆成几个2的次幂的和,对每个2的次幂维护答案,复杂度是暴力重构一组的复杂度乘log(如果可以归并可能会少个log)。 这里其实想整理下一些修改独立的数据结构题的套路。 离线算法: (1) 只有插入:CDQ分治。 (2) 有删除: 支持删除操作:CDQ分治。 不支持删除
阅读全文
posted @ 2019-04-19 11:04 HocRiser
阅读(780)
评论(0)
推荐(0)
2019年4月17日
GXOI/GZOI2019部分题解
摘要: D1T1:与或和 对每位处理,问题变成所有内部不包含0/1的矩阵的个数,单调栈维护即可。 1 #include<cstdio> 2 #include<algorithm> 3 #include<cstring> 4 #define rep(i,l,r) for (int i=(l); i<=(r);
阅读全文
posted @ 2019-04-17 20:00 HocRiser
阅读(222)
评论(0)
推荐(0)
Educational Codeforces Round 61 (Div.2)
摘要: A.(c1=0&&c3>0)||(c1!=c4) 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 #include<iostream> 5 #define rep(i,l,r) for (int i=(l); i<=(r)
阅读全文
posted @ 2019-04-17 19:53 HocRiser
阅读(156)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
···
44
下一页
公告