摘要: 题面:传送门 题目大意: 给定一个空集合,有两种操作: 一种是往集合中插入一个元素x,一种是给三个数x,k,s,问集合中是否存在v,使得gcd(x,v)%k==0,且x+vO(n−−√log2n)O(nlog2n) 操作2时间复杂度 O(log2n" rol... 阅读全文
posted @ 2018-06-02 19:47 birchtree 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 题面传送门 题目大意: L(h)的值是区间[L,R]内,abs(h[i]-h[j])/(i-j)的最大值。现在有q个询问,每个询问表示询问区间[L,R]内,所有子序列的L(h)的值的和分析将|h[i]−h[j]i−j|" role... 阅读全文
posted @ 2018-05-28 20:42 birchtree 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 题面 传送门 题目大意: 给你一个计算区间f函数的公式,举例f(1,2,4,8)=f(1⊕2,2⊕4,4⊕8)=f(3,6,12)=f(3⊕6,6⊕12)=f(5,10)=f(5⊕10)=f(15)=15 然后现在给你一个数列,n<=5000,然后q个询问,q<=100000,每次询问[l,r]区间 阅读全文
posted @ 2018-05-28 19:54 birchtree 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 题面 传送门:http://codeforces.com/problemset/problem/515/C Drazil is playing a math game with Varda. Let’s define f(x)f(x)for positive integer x as a produ 阅读全文
posted @ 2018-05-21 18:34 birchtree 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 题面:传送门:http://codeforces.com/problemset/problem/475/D Given a sequence of integers a1, …, an and q queries x1, …, xq on it. For e... 阅读全文
posted @ 2018-05-21 13:06 birchtree 阅读(378) 评论(0) 推荐(0) 编辑
摘要: 题面 Labyrinth Time Limit: 2000MS Memory Limit: 32768K Total Submissions: 4997 Accepted: 1861 Description The northern part of the Pyramid contains a ve 阅读全文
posted @ 2018-05-19 19:13 birchtree 阅读(296) 评论(0) 推荐(0) 编辑
摘要: 题面 传送门:http://codeforces.com/problemset/problem/691/E E. Xor-sequences time limit per test3 seconds memory limit per test256 megabytes inputstandard i 阅读全文
posted @ 2018-05-15 20:10 birchtree 阅读(249) 评论(0) 推荐(0) 编辑
摘要: 题面 传送门:http://codeforces.com/problemset/problem/833/B B. The Bakery time limit per test2.5 seconds memory limit per test256 megabytes inputstandard in 阅读全文
posted @ 2018-05-14 21:40 birchtree 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 题面 传送门:http://codeforces.com/problemset/problem/840/C C. On the Bench time limit per test2 seconds memory limit per test256 megabytes inputstandard in 阅读全文
posted @ 2018-05-09 19:02 birchtree 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 1.格雷码的概念1.性质格雷码(Grey Code),又叫循环二进制码或反射二进制码,是一种编码方式,它的基本特点是任意两个相邻的格雷码只有一位二进制数不同。 常用的二进制数与格雷码间的转换关系如下表: 从表中我们可以发现任意两个相邻的格雷码只有一位二进制... 阅读全文
posted @ 2018-05-05 22:41 birchtree 阅读(769) 评论(0) 推荐(0) 编辑