会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
蒟蒻LQL
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
···
16
下一页
2019年2月15日
Codeforces Round #538 (Div. 2)
摘要: A.Got Any Grapes? 根据题意模拟就好。 B.Yet Another Array Partitioning Task 题意: 给出一个大小为n的数组,把它分成k段,每一段最大的m个数字加起来和最大。 题解: 那么最好的答案就是这n个数里面最大的m*k个数都被取到。 C.Trailing
阅读全文
posted @ 2019-02-15 16:37 蒟蒻LQL
阅读(296)
评论(0)
推荐(0)
2018年11月26日
【BZOJ4154】Generating Synergy【kd树】
摘要: 题意 给定一棵以1为根的有根树,初始所有节点颜色为1,每次将距离节点a不超过l的a的子节点染成c,或询问点a的颜色 分析 我们以dfs序为横坐标,深度为纵坐标,建kd树。我们每次更新,都是在kd树中更新一个矩形,横坐标为[st[a],en[a]],纵坐标[depth[a],depth[a]+l]。那
阅读全文
posted @ 2018-11-26 23:21 蒟蒻LQL
阅读(204)
评论(0)
推荐(1)
【BZOJ3489】A simple rmq problem【kd树】
摘要: 题意 给出一个长度为n的序列,给出M个询问:在[l,r]之间找到一个在这个区间里只出现过一次的数,并且要求找的这个数尽可能大。如果找不到这样的数,则直接输出0。我会采取一些措施强制在线。 分析 预处理出pre[i],nxt[i]分别代表左边离它最近的相同数字的坐标,nxt[i]代表右边离它最近的相同
阅读全文
posted @ 2018-11-26 23:09 蒟蒻LQL
阅读(278)
评论(0)
推荐(1)
【BZOJ2716】天使玩偶【kd树】
摘要: 这个题要求kd树支持两个操作。 1.插入一个新的点。 2.查询某个点最近曼哈顿距离。 注意查询曼哈顿距离和查询欧几里得距离,是有区别的。(估价函数不同)。 1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 #inclu
阅读全文
posted @ 2018-11-26 22:55 蒟蒻LQL
阅读(282)
评论(0)
推荐(0)
2018年11月24日
Codeforces Round #520 (Div. 2)
摘要: A.prank 题意:给出一个含有n个数的递增的序列,问最多能删除多少个连续的数字,使得这个数列还是只可能有这一种形式。 分析:那就找出一段最长的差为1的序列就行。 1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 #i
阅读全文
posted @ 2018-11-24 14:00 蒟蒻LQL
阅读(202)
评论(0)
推荐(0)
2018年11月21日
Codeforces Round #521 (Div. 3)
摘要: A.Frog Jumping 1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 #include <iostream> 5 #include <set> 6 #include <map> 7 #include <vec
阅读全文
posted @ 2018-11-21 23:15 蒟蒻LQL
阅读(193)
评论(0)
推荐(0)
2018年11月14日
Educational Codeforces Round 54
摘要: 这套题不难,但是场上数据水,导致有很多叉点 A. 因为是让求删掉一个后字典序最小,那么当a[i]>a[i+1]的时候,删掉a[i]一定最优!这个题有个叉点,当扫完一遍如果没有满足条件的,就删去最后一个字符。 1 #include <cstdio> 2 #include <cstring> 3 #in
阅读全文
posted @ 2018-11-14 01:45 蒟蒻LQL
阅读(222)
评论(0)
推荐(0)
2018年11月2日
【hdu3507】Print Article 【斜率优化dp】
摘要: 题意 https://cn.vjudge.net/problem/HDU-3507 分析 斜率优化的模板题 1 #include <cstdio> 2 #include <cstring> 3 #include <algorithm> 4 #include <iostream> 5 6 using
阅读全文
posted @ 2018-11-02 09:36 蒟蒻LQL
阅读(159)
评论(0)
推荐(0)
【HDU5992】Finding Hotels 【KD树】
摘要: 题意 给出n个酒店的坐标和价格,然后m个查询,每个查询给出一个人的坐标和能承受的最大价格,然后找出在他价格承受范围以内,距离他最近的宾馆,如果有多个,那么输出第一个 分析 kd树的模板题 1 #include <cstdio> 2 #include <cstring> 3 #include <alg
阅读全文
posted @ 2018-11-02 09:21 蒟蒻LQL
阅读(265)
评论(0)
推荐(0)
【hdu4347】The Closest M Points 【KD树模板】
摘要: 题意 一个k维空间,给出n个点的坐标,给出t个询问,每个询问给出一个点的坐标和一个m。对于每个询问找出跟这个点最接近的m个点 分析 kd树的模板题。 1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 #include <
阅读全文
posted @ 2018-11-02 09:16 蒟蒻LQL
阅读(501)
评论(0)
推荐(1)
上一页
1
2
3
4
5
6
···
16
下一页
公告