摘要: 1 #include 2 using namespace std; 3 const int maxn=1000000; 4 typedef long long ll; 5 int p[maxn],a[maxn]; 6 ll n,k,A,B; 7 const int mod=1e9+7; 8 9 ll Pow(ll x,ll n) 10 { 11 ll res=... 阅读全文
posted @ 2019-01-22 22:33 tttttttttrx 阅读(136) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/qq_37632935/article/details/81264965 阅读全文
posted @ 2019-01-22 22:11 tttttttttrx 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 参考 https://blog.csdn.net/m0_37286282/article/details/78869512 位运算:http://blog.csdn.net/stay_accept/article/details/47204619 容斥 3种模板:https://blog.csdn. 阅读全文
posted @ 2019-01-22 21:01 tttttttttrx 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 题意 给出一个序列 每次查询区间的max-min是多少 思路:直接维护max 和min即可 写两个query分别查最大最小值 阅读全文
posted @ 2019-01-22 02:18 tttttttttrx 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 题意:给一段0-8000的线段染色 问最后 颜色x 有几段 题解:标准线段树 但是没有push_up 最后查询是单点按顺序查询每一个点 考虑过使用区间来维护不同的线段有多少种各色的线段 思路是 两个子区间合并:左子区最右边和右子区最左边如果相同,那么就不变,不同就+1 但是不好维护 所以直接单点查还 阅读全文
posted @ 2019-01-22 02:16 tttttttttrx 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 题意 给出一段初始化全为1的区间 后面可以一段一段更改成 1 或 2 或3 问最后整段区间的和是多少 思路:标准线段树区间和模版题 阅读全文
posted @ 2019-01-22 02:06 tttttttttrx 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 题意 贴海报 最后可以看到多少海报 思路 :离散化大区间 其中[1,4] [5,6]不能离散化成[1,2] [2,3]因为这样破坏了他们的非相邻关系 每次离散化区间 [x,y]时 把y+1点也加入就行了 注:参考了上海全能王csl的博客! 阅读全文
posted @ 2019-01-22 02:04 tttttttttrx 阅读(188) 评论(0) 推荐(0) 编辑