摘要: 博客搬至 http://blog.csdn.net/littlewhite520 阅读全文
posted @ 2017-09-30 18:07 黑码的博客 阅读(120) 评论(0) 推荐(0)
摘要: You have a string s = s1s2...s|s|, where |s| is the length of string s, and si its i-th character.Let's introduce several definitions:A substring s[i.... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(473) 评论(0) 推荐(0)
摘要: 给定整数N,求1using namespace std;const int maxn=1e7+10; bool vis[maxn]; int prime[maxn],mu[maxn]; int cnt; typedef long long ll;void Init(){ ... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(99) 评论(0) 推荐(0)
摘要: Zeus 和 Prometheus 做了一个游戏,Prometheus 给 Zeus 一个集合,集合中包含了N个正整数,随后 Prometheus 将向 Zeus 发起M次询问,每次询问中包含一个正整数 S ,之后 Zeus 需要在集合当中找出一个正整数 K ,使得 K 与 S 的异... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(105) 评论(0) 推荐(0)
摘要: Give you an array A[1..n]A[1..n],you need to calculate how many tuples (i,j,k) (i,j,k) satisfy that (i j 的情况 只要把每次更新的ak的时候把前面的所有的数都当成是非法... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(66) 评论(0) 推荐(0)
摘要: In ACM/ICPC contest, the ”Dirt Ratio” of a team is calculated in the following way. First let’s ignore all the problems the team didn’t pass, ... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(92) 评论(0) 推荐(0)
摘要: HDU1695的题目大意是这样的,给你 a , b , c , d , k 五个值 (题目说明了 你可以认为 a=c=1) x 属于 [1,b] ,y属于[1,d] 让你求有多少对这样的 (x,y)满足gcd(x,y)==k。这一题和hdu 6053不一样的地方在于,在hdu60... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(101) 评论(0) 推荐(0)
摘要: 给定一棵N个节点的树,每个点有一个权值,对于M个询问(u,v,k),你需要回答u xor lastans和v这两个节点间第K小的点权。其中lastans是上一个询问的答案,初始为0,即第一个询问的u是明文。Input 第一行两个整数N,M。 第二行有N个整数,其中第i个整数表示点i的... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(107) 评论(0) 推荐(0)
摘要: 总算是把动态求区间第k个数的算法看明白了。 在主席树的基础上,如果有修改操作,则要通过套树状数组来实现任意区间求第k小的问题。 刚开始看不明白什么意思,现在有一点理解。树状数组的每个元素是一个线段树,来维护修改后的前后缀和,树状数组能在log时间内更整个数组,现在用相同的方式更新整个... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(139) 评论(0) 推荐(0)
摘要: Mr. Frog has an integer sequence of length n, which can be denoted as a1,a2,⋯,ana1,a2,⋯,anThere are m queries. In the i-th query, you are given two in... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(186) 评论(0) 推荐(0)