会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
html_11
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
2019年6月2日
Codeforces Round # 555 (Div. 3) Minimum array (multiset)
摘要: 题目链接:http://codeforces.com/contest/1157/problem/E 题意:调整b数组顺序,使得c数组最小化(c[i] = a[i] + b[i]) % n,因为这里a[i],b[i] < n,所以我们对每个a[i]在b数组中查找一个>=n - a[i]的值即可满足c数
阅读全文
posted @ 2019-06-02 13:17 html_11
阅读(137)
评论(0)
推荐(0)
2019年6月1日
Codeforces Round # 555 (Div. 3) C2. Increasing subsequence (complicated version) (贪心)
摘要: 题目链接:http://codeforces.com/contest/1157/problem/C2 当左右两边数字相同时,需要判断一下取哪边能得到更长的递增序列 #include <iostream> #include <cstring> #include <algorithm> #include
阅读全文
posted @ 2019-06-01 16:17 html_11
阅读(119)
评论(0)
推荐(0)
ZOJ 4124 Median (拓扑 DFS)
摘要: 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=6026 拓扑排序判断环是否存在,DFS搜1~n大于/小于i的元素数量 #include <iostream> #include <cstdio> #include <al
阅读全文
posted @ 2019-06-01 11:24 html_11
阅读(182)
评论(0)
推荐(0)
ZOJ 4110 Strings in the Pocket (思维 Manacher)
摘要: 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4110 两个字符串不相同时的情况比较简单: 只需要分别找到两个字符串左右两边第一个不相同字符的下标,然后开始对称匹配两个字符串,判断出是否有可能翻转一次使得s1->s
阅读全文
posted @ 2019-06-01 11:22 html_11
阅读(104)
评论(0)
推荐(0)
Codeforces Round # 560 (Div. 3) F2. Microtransactions (complicated version) (二分)
摘要: 题目链接:http://codeforces.com/contest/1165/problem/F2 题意:n种物品需要购买,每种物品需要购买a[i]件,每件物品价格为2bourle,有m次优惠活动(di,ti):第di天物品ti价值优惠为1bourle 每天可以得到1bourle,求买完所有物品的
阅读全文
posted @ 2019-06-01 11:14 html_11
阅读(137)
评论(0)
推荐(0)
2019年5月31日
Codeforces Round # 560 (Div. 3) E. Two arrays and the sum of functions (思维)
摘要: 题目链接:http://codeforces.com/contest/1165/problem/E 题意: 改变数组B的顺序,使得最小 我们可以把 a[i] * (i + 1)*(n - i) 可以处理成定值,然后从大到小排序与从小到大排序的b数组相乘即为答案 #include <iostream>
阅读全文
posted @ 2019-05-31 11:58 html_11
阅读(197)
评论(0)
推荐(0)
2019年5月29日
HDU 6521 Party (吉司机线段树)
摘要: 线段树 题目链接 普通的线段树,跑了2000ms... #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <map> #include <set> #include <vect
阅读全文
posted @ 2019-05-29 23:08 html_11
阅读(222)
评论(0)
推荐(0)
HDU 6514 Monitor (二维前缀和 差分)
摘要: 二维前缀和 差分 题目链接 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <map> #include <set> #include <vector> #include <
阅读全文
posted @ 2019-05-29 00:14 html_11
阅读(144)
评论(0)
推荐(0)
2019年5月26日
HDU 6534 Chika and Friendly Pairs (树状数组 离散化 莫队)
摘要: 树状数组 离散化 莫队 题目链接 求[L,R]内有多少对(i, j)满足|a[i] - a[j]| <= K,我们转换为求[a[i] - k - 1, a[i] + k]的个数 离散化处理a[i], a[i] - k, a[i] + k的下标(二分处理) 然后莫队查询,用树状数组维护这些数,实现区间
阅读全文
posted @ 2019-05-26 23:21 html_11
阅读(361)
评论(0)
推荐(0)
P1494 [国家集训队]小Z的袜子 (莫队)
摘要: 离线莫队 题目链接 [L,R]区间内: 设每种袜子的数量分别为: 则答案为: 化简即为: 所以我们求:即可 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <map> #in
阅读全文
posted @ 2019-05-26 18:53 html_11
阅读(133)
评论(0)
推荐(0)
上一页
1
2
公告